【java-Apache Camel程序包扫描】教程文章相关的互联网学习教程文章

java – com.sun.org.apache.xerces.internal.dom.ElementImpl的替代方案【代码】

我正在使用一个使用SharePoint列表中的数据的java应用程序(在netbeans中).我按照本教程从SharePoint检索数据:http://davidsit.wordpress.com/2010/02/10/reading-a-sharepoint-list-with-java-tutorial/ 好的是,它有效.坏消息是,我得到了一个我无法解决的警告. 一个浓缩的片段:Lists service = new Lists(); ListsSoap port = service.getListsSoap(); GetListItemsResponse.GetListItemsResult result = port.getListItems("myL...

如何从TomCat中运行的Java应用程序中读取Apache Httpd Env变量?【代码】

我在Apache Httpd后面的TomCat容器中运行了几个Java应用程序.在Apache Httdp中,如果安装了mod_env,则可以使用SetEnv FOO bar设置Env变量.如何在TomCat中运行的Java应用程序中读取这些变量?Java应用程序主要使用Stripes构建,如果有帮助的话.解决方法:因为Tomcat是在Apache之外启动的,所以它无法访问Apache环境.这意味着您需要一些方法将环境变量从Apache传递到Tomcat. 如果使用mod_jk连接Apache和Tomcat,则可以使用JkEnvVar指令将特...

java – Base64是否确定(Apache Commons lib或其他)?【代码】

我正在使用Apache Commons库中的Base64编码器.现在,我的运行时/ IDE会发生一些有趣的事情,或者他们对Base64编码(或Base64作为规范)的实现是不确定的:val test = Base64.encodeBase64("hello".getBytes).toString val test2 = Base64.encodeBase64("hello".getBytes).toString val test3 = Base64.encodeBase64("hello".getBytes).toString以上每一个都产生不同的结果.这是预期的吗?我在Scala中写这个…解决方法:您发布的Scala代码...

java – Apache Curator分布式锁【代码】

我知道Apache Curator可以执行分布式锁定功能,该功能构建在zookeeper的顶部.根据Apache Curator官方网站上发布的文档,它看起来很容易使用.例如:RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3); CuratorFramework client = CuratorFrameworkFactory.newClient("host:ip",retryPolicy); client.start();InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(client, path); if(lock.acquire(10, Ti...

java – Apache POI克隆风格和获取风格之间的区别【代码】

做:之间是否有任何显着差异:CellStyle newCellStyle = workbook.createCellStyle(); neweCellStyle.cloneStyleFrom(oldCell.getCellStyle()); newCell.setCellStyle(newCellStyle);与CellStyle newCellStyle = oldCell.getCellStyle(); newCell.setCellStyle(newCellStyle);我之所以这样问是因为我不确定采用第一种方法是否有可能造成太多的CellStyles,我遇到了一些问题,如果我在一个特定的工作簿中创建了太多的CellStyles,那么工...

java.lang.ClassNotFoundException:org.apache.http.config.RegistryBuilder【代码】

我正在用春天和cglib运行硒. 我收到此错误:java.lang.ClassNotFoundException:org.apache.http.config.RegistryBuilder 但我无法找到相关的包裹在哪里!有人可以帮忙吗? 谢谢解决方法:该软件包包含在ApacheHttpComponents httpcore中. 如果使用Maven,只需在pom.xml中添加以下内容作为依赖项.<dependency><groupId>org.apache.httpcomponents</groupId><artifactId>httpcore</artifactId><version>4.3.3</version> </dependency>

java – Apache POI DataFormatter返回科学记数法【代码】

我有一个xlsx文件,我正在阅读Java 6中的apache poi 3.17.在一个实例中,我有一个值为123456789011的单元格.这被读入java作为NUMERIC CellTypeEnum Cell.当我使用DataFormatter获取单元格的值时,如下所示: DataFormatter formatter = new DataFormatter(Locale.US); String strVal = formatter.formatCellValue(cell); 字符串值的格式为“1.234567 11”.我需要单元格中的实际值“123456789011”.我怎么能得到它? 我已经尝试在Java中...

java – 使用apache poi – 检测到Zip Bomb

当我尝试使用包含超过64000条记录的apache poi将数据写入excel表时,使用SXSSF并且我收到以下错误,Zip bomb detected! The file would exceed the max. ratio of compressed file size to the size of the expanded data. This may indicate that the file is used to inflate memory usage and thus could pose a security risk. You can adjust this limit via ZipSecureFile.setMinInflateRatio() if you need to work with file...

Apache Struts和Java EE之间的区别?

我目前正在学习Java EE,或者更具体地说,学习Servlets和.jsp.在我的编程中,我已经使用模型 – 视图 – 控制器模型来编写我的代码.就我用Google搜索而言,Apache Struts只是像Tomcat这样的服务器.那么,Apache Struts究竟与Java EE中的Java,Java EE和Servlet类有什么关系呢?解决方法:Struts不是另一台服务器.这是一个应用程序框架.它建立在JSP和Servlet架构之上.所以它是servlet环境的抽象. 使用像Struts这样的框架有一些优点,例如:应...

java – Apache Camel中对null体的处理能否更优雅?【代码】

我是Camel的新手,并试图学习习语和最佳实践.我正在编写需要处理几种不同错误情况的Web服务.这是我的错误处理和路由:onException(JsonParseException.class).inOut("direct:syntaxError").handled(true); onException(UnrecognizedPropertyException.class).inOut("direct:syntaxError").handled(true);// Route service through direct to allow testing. from("servlet:///service?matchOnUriPrefix=true").inOut("direct:servic...

java – 获取InputStream forom Apache的POI工作簿

有没有办法获得Apache的POI工作簿的InputStream? 我需要它来管道到另一个OutputStream,但我无法找到这样的方法(如果它存在). 如果没有,任何关于获得它的替代方法的提示?解决方法:有几种方法可以解决这个问题: >您可以使用标准的java PipetInputStream和PipedOutputStream.但是你必须为使用PipedInputStream创建不同的线程(如http://docs.oracle.com/javase/7/docs/api/java/io/PipedInputStream.html中所述)>您可以将内容写入By...

Apache Camel抛出java.lang.NoSuchMethodError:org.apache.camel.util.ObjectHelper.notNull【代码】

我有一个时髦的剧本,我正试着去;它的工作是读取一个消息队列,然后将消息重新排队到我们正在运行的一组新MQ中. 这是代码:@Grab(group='org.apache.camel', module='camel-core', version='2.11.0') @Grab(group='org.apache.activemq', module='activemq-core', version='5.7.0') @Grab(group='org.apache.activemq', module='activemq-camel', version='5.8.0') @Grab(group='ch.qos.logback', module='logback-classic', version...

使用java中的Apache POI从数字单元读取整数【代码】

我有一个应用程序,使用apache poi读取xls表.当单元格具有数值时,我通过row.getCell(i).getNumericValue()读取它.但它返回浮点数.就像单元格值为1一样,它返回1.0.我可以将它转换为int吗?任何帮助,将不胜感激.我尝试了Integer.parseInt(value) – 但它抛出了NumberFormat异常.感谢任何帮助.这里是伪代码:FileInputStream file = new FileInputStream(new File("C:\\test.xls")); HSSFWorkbook workbook = new HSSFWorkbook(file); ...

缺少Apache POI Java的单元策略

有人可以解释一下Apache POI的Missing cell策略吗?究竟缺少什么细胞?我没有发现Apache POI docs link对于确切缺失的单元格是不言自明的.解决方法:你读过Apache POI Excel Busy Developer’s Guide吗?In some cases, when iterating, you need full control over how missing or blank rows and cells are treated, and you need to ensure you visit every cell and not just those defined in the file. (The CellIterator wil...

java – 在Tomcat上的webapp中使用Batik时“找不到SAX2驱动程序类org.apache.crimson.parser.XMLReaderImpl”【代码】

这可能与类路径问题有关,但我现在还不确定,因为我在某些机器上没有出现此错误. 堆栈顶部的错误是找不到SAX2驱动程序类org.apache.crimson.parser.XMLReaderImpl.为什么我只在某些环境中获得此错误,而不是其他环境?我该如何进一步调查和/或解决这个问题? 环境: > Mac或PC上的Jetty ==好的> Mac上的Tomcat 5或6 == OK> Win XP上的Tomcat 5或6 ==错误> CentOS上的Tomcat 6 ==错误 POM中的版本: >蜡染:蜡染:罐子:1.5:编译> net...

程序包 - 相关标签