Java中的log4j-1.2.15.jar

没有添加log4j-1.2.15.jar包之前:同时是404错误。
java.lang.NoClassDefFoundError: org/apache/log4j/LogManager
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at org.springframework.web.context.ContextLoader.(ContextLoader.java:146)
at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.LogManager
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 23 more

*******************************

添加log4j-1.2.15.jar之后显示错误如下:依然是404错误,404应该是路径问题,但是此处问题出在哪里呢

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.

二月 12, 2015 11:53:47 下午 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 31 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration
at org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean.(AnnotationSessionFactoryBean.java:99)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 33 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.AnnotationConfiguration
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 39 more

1个回答

这不还有org/hibernate/cfg/AnnotationConfiguration找不到吗
看看引入了hibernate-annototions.jar吗

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
log4j配置报org.apache.log4j.xml.DOMConfigurator

错误:java.lang.ClassNotFoundException: org.apache.log4j.xml.DOMConfigurator 版本:log4j-core-2.3.jar web.xml配置: ``` <context-param> <param-name>log4jConfigLocation</param-name> <param-value>classpath:log4j.xml</param-value> </context-param> <context-param> <param-name>log4jRefreshInterval</param-name> <param-value>60000</param-value> </context-param> </listener> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> ``` log4j.xml ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <appender name="INFO" class="org.apache.log4j.DailyRollingFileAppender"> <param name="File" value="${user.home}/logs/app-info.log" /> <param name="Append" value="true" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%t]%c %d{ISO8601}-- %p -- %m%n" /> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMin" value="INFO" /> <param name="LevelMax" value="INFO" /> </filter> </appender> <logger name="cn.edu.ynu.demo"> <level value="INFO" /> </logger> </log4j:configuration> ``` 报错信息: ``` Caused by: java.lang.ClassNotFoundException: org.apache.log4j.xml.DOMConfigurator at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139) ... 12 more ``` 求大神看看问题在哪?

关于在MyEclipse下使用Log4j的问题

本人刚学习JAVA不久,在MyEclipse下建了一个工程,加入了lo4j-1.2.15.jar,commons-collections-2.1.1.jar。 启动TOMCAT的时候没有出错,但是执行的时候提示这样的错误。大家帮我看看是什么原因造成的。 错误: log4j:ERROR Could not instantiate class [org.apache.log4j.ConsoleAppener]. java.lang.ClassNotFoundException: org.apache.log4j.ConsoleAppener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.apache.log4j.helpers.Loader.loadClass(Loader.java:179) at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:320) at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:121) at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:664) at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647) at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471) at org.apache.log4j.LogManager.<clinit>(LogManager.java:125) at org.apache.log4j.Logger.getLogger(Logger.java:105) at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229) at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351) at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:116) at hibernate.ch04.ViewLog.<clinit>(ViewLog.java:23) at hibernate.ch04.ViewLogServlet.doPost(ViewLogServlet.java:114) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) [b]问题补充:[/b] to jansel: 我已经在MyEclipse中这个项目的Java Build Path里加入log包了。 to yangtao309, hsbljyy: 我刚检查了一下lo4j-1.2.15.jar,里面有org/apache/log4j/ConsoleAppener.class 大家再帮我想想。 [b]问题补充:[/b] to jansel: "${Tomcat的路径}webapp/你的工程/WEB-INF/lib"底下有log4j的包.我还在找其他的原因,大家也帮我一起找找.

log4j 写入数据库遇到问题

Hi 向通过log4j将日志写入指定资料库中,但报出错误,麻烦看看哪有问题?!先谢过 log4j:去apache下的最新的(log4j-1.2.15.jar) DB:oralce 10g,driver使用的是ojdbc14.jar (换过两个版本,2005年和2008年的) 程式代码: Java code import sun.jdbc.odbc.*; import java.sql.*; import org.apache.log4j.Category; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.apache.log4j.jdbc.*; public class Test { public static void main(String[] args) { final Category cat = Category.getInstance(Test.class.getName()); PropertyConfigurator.configure ( "resx/property/log4j.properties" ); cat.debug ("just test") ; } } 配置文件log4j.properties内容: BatchFile code log4j.rootLogger=DEBUG,DATABASE log4j.appender.DATABASE=org.apache.log4j.jdbc.JDBCAppender #connstring log4j.appender.DATABASE.URL=jdbc:oracle:thin:@localhost:1521:dbname log4j.appender.DATABASE.BufferSize=40 log4j.appender.DATABASE.driver=oracle.jdbc.driver.OracleDriver #user log4j.appender.DATABASE.user= #pswd log4j.appender.DATABASE.password= log4j.appender.DATABASE.sql=INSERT INTO test3(time,message) values(sysdate,'%c-%-4r[%t]%-5p%c%x-%m%n') log4j.appender.DATABASE.layout=org.apache.log4j.PatternLayout log4j.appender.DATABASE.layout.ConversionPattern=-%c-%-4r[%t]%-5p%c%x-%m%n [b]问题补充:[/b] Hi 向通过log4j将日志写入指定资料库中,但报出错误,麻烦看看哪有问题?!先谢过 log4j:去apache下的最新的(log4j-1.2.15.jar) DB:oralce 10g,driver使用的是ojdbc14.jar (换过两个版本,2005年和2008年的) 程式代码: Java code import sun.jdbc.odbc.*; import java.sql.*; import org.apache.log4j.Category; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.apache.log4j.jdbc.*; public class Test { public static void main(String[] args) { final Category cat = Category.getInstance(Test.class.getName()); PropertyConfigurator.configure ( "resx/property/log4j.properties" ); cat.debug ("just test") ; } } 配置文件log4j.properties内容: BatchFile code log4j.rootLogger=DEBUG,DATABASE log4j.appender.DATABASE=org.apache.log4j.jdbc.JDBCAppender #connstring log4j.appender.DATABASE.URL=jdbc:oracle:thin:@localhost:1521:dbname log4j.appender.DATABASE.BufferSize=40 log4j.appender.DATABASE.driver=oracle.jdbc.driver.OracleDriver #user log4j.appender.DATABASE.user= #pswd log4j.appender.DATABASE.password= log4j.appender.DATABASE.sql=INSERT INTO test3(time,message) values(sysdate,'%c-%-4r[%t]%-5p%c%x-%m%n') log4j.appender.DATABASE.layout=org.apache.log4j.PatternLayout log4j.appender.DATABASE.layout.ConversionPattern=-%c-%-4r[%t]%-5p%c%x-%m%n 很抱歉,忘记添出错误信息了! 错误讯息: log4j:ERROR Failed to load driver java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.apache.log4j.jdbc.JDBCAppender.setDriver(JDBCAppender.java:351) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:206) at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:165) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:130) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97) at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689) at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647) at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:334) at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:342) at Test.main(Test.java:12)

好几天了,JPA + hibernate 一直连接不上

我初学 jpa,照猫画虎,做了一个 jpa + hibernate 程序片段。但好几天了,数据库始终连不上。错误信息如下:(resin 3.1) Caused by: java.lang.NullPointerException at com.caucho.amber.manager.AmberPersistenceProvider.createEntityManagerFactory(AmberPersistenceProvider.java:65) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69) at com.darta.collate.wicket.CollateApplication.init(CollateApplication.java:68) 错误信息表明, Persistence.createEntityManagerFactory 空指针。 本段程序如下: ....... private EntityManagerFactory emf; // 构建. public CollateApplication() { } public EntityManagerFactory getEntityManagerFactory() { return emf; } @Override protected void init() { super.init(); System.out.println("shell emf"); emf = Persistence.createEntityManagerFactory("collatePU"); System.out.println("********************** emf OK!!"); 控制台只显示"shell emf". jpa 配置文件 persistence.xml: <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="collatePU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name = "hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/> <property name = "hibernate.connection.driver_class" value = "com.mysql.jdbc.Driver"/> <property name = "hibernate.connection.url" value = "jdbc:mysql://localhost:3306/collate?useUnicode=true&amp;characterEncoding=utf-8"/> <property name = "hibernate.connection.username" value = "admin"/> <property name = "hibernate.connection.password" value = "aaaaaaa"/> <property name = "hibernate.hbm2ddl.auto" value = "update"/> </properties> </persistence-unit> </persistence> 数据库在非 jpa 时可以连通。我想同实体暂时无关吧?代码就不贴了。 衷心请求帮助,万分感谢! [b]问题补充:[/b] 谢谢lovewhzlq的回答。persistence.xml 文件不是放在 /WEB-INF/classes/META-INF 下吗?程序中还要做什么工作? 我把它发布到 tomcat6 下面,错误信息如下,请帮助看一看: 信息: Deploying web application archive collate.war(这是我的war文件) shell emf (程序中显示到控制台的) shell emf (为什么显示两次?) 2009-8-19 18:50:28 org.apache.catalina.core.StandardContext start 严重: Error filterStart 2009-8-19 18:50:28 org.apache.catalina.core.StandardContext start 严重: Context [/collate] startup failed due to previous errors 似乎和 web.xml 文件有关 <filter> <filter-name>CollateApplication</filter-name> <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class> <init-param> <param-name>applicationClassName</param-name> <param-value>com.darta.collate.wicket.CollateApplication</param-value> </init-param> </filter> <filter-mapping> <filter-name>CollateApplication</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> 问题在那里? [b]问题补充:[/b] [b][size=medium]万分感激 lovewhzlq 的热情帮助。[/size][/b] filter有问题就是 emf = Persistence.createEntityManagerFactory("collatePU"); 这一行。去掉它,一切正常。就是 createEntityManagerFactory 出错。 有什么建议? [b]问题补充:[/b] [size=medium][b]万分感激 lovewhzlq !!! 我下个教程看看,不清楚的再请教。[/b][/size] [b]问题补充:[/b] [size=medium][color=darkred]非常非常感谢 lovewhzlq,按照您推荐的资料,问题解决了。 我过去用过 Hibernate 3.2,照猫画虎成功过一次,但不甚了了。这次用了新版的 3.3.1, 依赖库发生了变化,造成依赖库冲突。为了避免其他朋友和我一样走弯路,现将我可以使用的依赖库发在下面: antlr-2.7.6.jar c3p0-0.9.1.jar cglib-2.2.jar commons-collections-3.1.jar dom4j-1.6.1.jar ehcache-1.2.3.jar ejb3-persistence.jar hibernate-annotations.jar 3.4GA hibernate-commons-annotations.jar 3.4GA hibernate-entitymanager.jar 3.4GA hibernate3.jar 3.3.1 javassist-3.9.0.GA.jar jboss-cache-1.4.1.GA.jar jbosscache-core-3.1.0.GA.jar jta-1.1.jar log4j-1.2.15.jar oscache-2.1.jar proxool-0.8.3.jar slf4j-api-1.5.8.jar slf4j-log4j12-1.5.8.jar swarmcache-1.0RC2.jar 可能有些不是必需的,但肯定不冲突。 再次感谢 lovewhzlq 的指点![/color][/size]

spring配置问题

<p>刚学spring,一开始就遇到个异常。 <br>Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: <span style="color: #ff0000;">Unexpected exception parsing XML document from class path resource [xml/1.xml];</span> nested exception is org.springframework.beans.FatalBeanException: Unable to load schema mappings from location [META-INF/spring.schemas]; <span style="color: #ff0000;">nested exception is java.util.zip.ZipException: 拒绝访问。</span></p> <p> 我一共就干了3件事。</p> <p>加jar包</p> <p>aspectjrt.jar</p> <p>aspectjweaver.jar</p> <p>cglib-nodep-2.1_3.jar</p> <p>common-annotations.jar</p> <p>commons-dbcp.jar</p> <p>commons-logging.jar</p> <p>commons-pool.jar</p> <p>log4j-1.2.15.jar</p> <p>spring.jar</p> <p>spring-webmvc-struts.jar</p> <p>写配置文件</p> <p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a>"<br> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br> xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a> <br> <a href="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</a>"&gt;<br>&lt;/beans&gt;</p> <p> </p> <p>搞个main方法测一下。。。。结果就报错。。。</p> <p>public static void main(String[] args){<br>  ApplicationContext ac = new ClassPathXmlApplicationContext(<br>  "xml/1.xml");<br> }</p> <p> </p> <p> </p>

docx4j将word 转换长pdf 中文出现乱码

所需的jar: jaxb-impl 2.1 avalon-framework-4.1.5 commons-io-2.4 docx4j-2.7.1 log4j-1.2.15 serializer-2.7.1 xmlgraphics-commons-1.3 batik-util-1.6-1 commons-logging-1.1.3 fop-0.93 xalan-2.7.1 public static void main(String[] args) { try { long start = System.currentTimeMillis(); InputStream is = new FileInputStream(new File("D:\\test.doc")); WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(is); Mapper fontMapper = new IdentityPlusMapper(); PhysicalFont font = PhysicalFonts.getPhysicalFonts().get("Arial Unicode MS"); fontMapper.getFontMappings().put("Algerian", font); wordMLPackage.setFontMapper(fontMapper); PdfSettings pdfSettings = new PdfSettings(); org.docx4j.convert.out.pdf.PdfConversion conversion = new org.docx4j.convert.out.pdf.viaXSLFO.Conversion( wordMLPackage); //注释生成pdf 默认的内容 org.docx4j.convert.out.pdf.viaXSLFO.Conversion.log.setLevel(Level.OFF); OutputStream out = new FileOutputStream(new File("D:\\javadomain.pdf")); conversion.output(out, pdfSettings); System.err.println("Time taken to Generate pdf " + (System.currentTimeMillis() - start) + "ms"); } catch (Exception e) { e.printStackTrace(); } }

iReport在linux终端中运行,但没有使用PHP exec命令

<div class="post-text" itemprop="text"> <p>I'm having problems executing the next command in a PHP file:</p> <pre><code>$cmd = '-Djava.awt.headless=true -Dlog4j.configuration=file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/log4j.properties -classpath "custom/ZuckerReports2/resources/:custom/ZuckerReports2/resources/areas_negocio.jasper_files/:modules/zr2_Report/jasper/jasperreports-javaflow-5.1.2.jar: modules/zr2_Report/jasper/zuckerreports-1.0.jar:modules/zr2_Report/jasper/commons-beanutils-1.8.0.jar: modules/zr2_Report/jasper/batik-anim.jar:modules/zr2_Report/jasper/bcel-5.2.jar: modules/zr2_Report/jasper/barcode4j-2.0.jar: modules/zr2_Report/jasper/ant-1.7.1.jar: modules/zr2_Report/jasper/jasperreports-applet-5.1.2.jar: modules/zr2_Report/jasper/batik-css.jar: modules/zr2_Report/jasper/servlet.jar:modules/zr2_Report/jasper/commons-digester-1.7.jar: modules/zr2_Report/jasper/batik-awt-util.jar:modules/zr2_Report/jasper/jasperreports-5.1.2.jar: modules/zr2_Report/jasper/antlr-2.7.5.jar:modules/zr2_Report/jasper/xml-apis-ext.jar: modules/zr2_Report/jasper/poi-3.6.jar:modules/zr2_Report/jasper/iText-2.1.7.jar: modules/zr2_Report/jasper/jxl-2.6.10.jar:modules/zr2_Report/jasper/commons-logging-1.0.4.jar: modules/zr2_Report/jasper/batik-gvt.jar:modules/zr2_Report/jasper/spring-beans-2.5.5.jar: modules/zr2_Report/jasper/mysql-connector-java-3.1.11-bin.jar: modules/zr2_Report/jasper/batik-parser.jar:modules/zr2_Report/jasper/batik-util.jar: modules/zr2_Report/jasper/hibernate3.jar:modules/zr2_Report/jasper/groovy-all-1.7.5.jar: modules/zr2_Report/jasper/barbecue-1.5-beta1.jar:modules/zr2_Report/jasper/jcommon-1.0.15.jar: modules/zr2_Report/jasper/jasperreports-functions-5.1.2.jar: modules/zr2_Report/jasper/log4j-1.2.15.jar:modules/zr2_Report/jasper/saaj-api-1.3.jar: modules/zr2_Report/jasper/jpa.jar:modules/zr2_Report/jasper/jfreechart-1.0.12.jar: modules/zr2_Report/jasper/spring-core-2.5.5.jar:modules/zr2_Report/jasper/mondrian-3.1.1.12687.jar: modules/zr2_Report/jasper/hsqldb-1.8.0-10.jar:modules/zr2_Report/jasper/batik-script.jar: modules/zr2_Report/jasper/serializer.jar:modules/zr2_Report/jasper/commons-collections-2.1.1.jar: modules/zr2_Report/jasper/batik-svggen.jar:modules/zr2_Report/jasper/batik-dom.jar: modules/zr2_Report/jasper/rhino-1.7R1.jar:modules/zr2_Report/jasper/batik-ext.jar: modules/zr2_Report/jasper/joda-time-1.2.1.jar:modules/zr2_Report/jasper/xml-apis.jar: modules/zr2_Report/jasper/batik-bridge.jar:modules/zr2_Report/jasper/xercesImpl-2.7.0.jar: modules/zr2_Report/jasper/TestZucker.jar:modules/zr2_Report/jasper/batik-svg-dom.jar: modules/zr2_Report/jasper/jasperreports-fonts-5.1.2.jar:modules/zr2_Report/jasper/jdt-compiler-3.1.1.jar: modules/zr2_Report/jasper/xalan-2.7.1.jar:modules/zr2_Report/jasper/png-encoder-1.5.jar: modules/zr2_Report/jasper/bsh-2.0b4.jar:modules/zr2_Report/jasper/batik-xml.jar: modules/zr2_Report/jasper/jaxen-1.1.1.jar:modules/zr2_Report/jasper/commons-javaflow-20060411.jar" at.go_mobile.zuckerreports.JasperBatchMain custom/ZuckerReports2/temp/4f558394-298d-4783-4600-51e812a588ef/cmd.properties 2&gt;&amp;1'; exec($cmd,$out,$res); </code></pre> <p>The result of this execution is this error:</p> <pre><code>Exception in thread "main" java.lang.ExceptionInInitializerError at net.sf.jasperreports.engine.fill.JRBaseFiller.&lt;init&gt;(JRBaseFiller.java:121) at net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:88) at net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:103) at net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:61) at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:55) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:170) at at.go_mobile.zuckerreports.JasperBatchMain.main(JasperBatchMain.java:126) Caused by: net.sf.jasperreports.engine.JRRuntimeException: java.io.IOException: Problem reading font data. at net.sf.jasperreports.engine.fonts.SimpleFontFace.&lt;init&gt;(SimpleFontFace.java:108) at net.sf.jasperreports.engine.fonts.SimpleFontFace.&lt;init&gt;(SimpleFontFace.java:128) at net.sf.jasperreports.engine.fonts.SimpleFontFace.getInstance(SimpleFontFace.java:67) at net.sf.jasperreports.engine.fonts.SimpleFontFamily.setNormal(SimpleFontFamily.java:99) at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamily(SimpleFontExtensionHelper.java:261) at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamilies(SimpleFontExtensionHelper.java:232) at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:193) at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:162) at net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:56) at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:110) at net.sf.jasperreports.engine.util.JRStyledTextParser.&lt;clinit&gt;(JRStyledTextParser.java:83) ... 8 more Caused by: java.io.IOException: Problem reading font data. at java.awt.Font.createFont0(Font.java:999) at java.awt.Font.createFont(Font.java:876) at net.sf.jasperreports.engine.fonts.SimpleFontFace.&lt;init&gt;(SimpleFontFace.java:100) ... 18 more </code></pre> <p>However, when I run the command directly in a linux terminal, the report is generated right.</p> <p>These are the lines from the log4j log file:</p> <pre><code>11:05:39,673 DEBUG ExtensionsEnvironment,main:78 - Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry 11:05:39,683 DEBUG DefaultExtensionsRegistry,main:130 - Loading registries for cache key sun.misc.Launcher$AppClassLoader@1b0620c 11:05:39,684 DEBUG JRLoader,main:873 - Found resource jasperreports_extension.properties at jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-javaflow-5.1.2.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@1b0620c 11:05:39,685 DEBUG JRLoader,main:873 - Found resource jasperreports_extension.properties at jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-5.1.2.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@1b0620c 11:05:39,685 DEBUG JRLoader,main:873 - Found resource jasperreports_extension.properties at jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-functions-5.1.2.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@1b0620c 11:05:39,686 DEBUG JRLoader,main:873 - Found resource jasperreports_extension.properties at jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-fonts-5.1.2.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@1b0620c 11:05:39,695 DEBUG DefaultExtensionsRegistry,main:158 - Loading JasperReports extension properties resource jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-javaflow-5.1.2.jar!/jasperreports_extension.properties 11:05:39,697 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.engine.style.PropertyStyleProviderExtensionFactory for property net.sf.jasperreports.extension.registry.factory.property.style.provider 11:05:39,697 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for property.style.provider using factory class net.sf.jasperreports.engine.style.PropertyStyleProviderExtensionFactory 11:05:39,699 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.components.headertoolbar.HeaderToolbarConditionalStyleProviderExtensionFactory for property net.sf.jasperreports.extension.registry.factory.header.toolbar.style.provider 11:05:39,700 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for header.toolbar.style.provider using factory class net.sf.jasperreports.components.headertoolbar.HeaderToolbarConditionalStyleProviderExtensionFactory 11:05:39,701 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory for property net.sf.jasperreports.extension.registry.factory.header.toolbar.parameter.contributor 11:05:39,701 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for header.toolbar.parameter.contributor using factory class net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory 11:05:39,702 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.governor 11:05:39,703 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for governor using factory class net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory 11:05:39,704 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.web.util.ContentTypeMappingExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.content.type.mapping 11:05:39,704 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for content.type.mapping using factory class net.sf.jasperreports.web.util.ContentTypeMappingExtensionsRegistryFactory 11:05:39,706 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.data.adapter.services 11:05:39,706 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for data.adapter.services using factory class net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory 11:05:39,709 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.jackson.mapping 11:05:39,709 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for jackson.mapping using factory class net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory 11:05:39,710 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.engine.query.SQLQueryClauseFunctionsExtensions for property net.sf.jasperreports.extension.registry.factory.sql.clause.functions 11:05:39,710 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for sql.clause.functions using factory class net.sf.jasperreports.engine.query.SQLQueryClauseFunctionsExtensions 11:05:39,719 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.components 11:05:39,720 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for components using factory class net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory 11:05:39,746 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.default 11:05:39,746 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory 11:05:39,748 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.repository 11:05:39,748 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for repository using factory class net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory 11:05:39,749 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.castor.mapping 11:05:39,749 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for castor.mapping using factory class net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory 11:05:39,750 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.types.date.DateRangeQueryClauseExtensions for property net.sf.jasperreports.extension.registry.factory.date.range.clause.functions 11:05:39,751 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for date.range.clause.functions using factory class net.sf.jasperreports.types.date.DateRangeQueryClauseExtensions 11:05:39,754 DEBUG DefaultExtensionsRegistry,main:158 - Loading JasperReports extension properties resource jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-5.1.2.jar!/jasperreports_extension.properties 11:05:39,758 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.engine.style.PropertyStyleProviderExtensionFactory for property net.sf.jasperreports.extension.registry.factory.property.style.provider 11:05:39,766 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for property.style.provider using factory class net.sf.jasperreports.engine.style.PropertyStyleProviderExtensionFactory 11:05:39,766 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.components.headertoolbar.HeaderToolbarConditionalStyleProviderExtensionFactory for property net.sf.jasperreports.extension.registry.factory.header.toolbar.style.provider 11:05:39,767 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for header.toolbar.style.provider using factory class net.sf.jasperreports.components.headertoolbar.HeaderToolbarConditionalStyleProviderExtensionFactory 11:05:39,767 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory for property net.sf.jasperreports.extension.registry.factory.header.toolbar.parameter.contributor 11:05:39,767 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for header.toolbar.parameter.contributor using factory class net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory 11:05:39,767 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.governor 11:05:39,768 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for governor using factory class net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory 11:05:39,768 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.web.util.ContentTypeMappingExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.content.type.mapping 11:05:39,768 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for content.type.mapping using factory class net.sf.jasperreports.web.util.ContentTypeMappingExtensionsRegistryFactory 11:05:39,768 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.data.adapter.services 11:05:39,776 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for data.adapter.services using factory class net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory 11:05:39,776 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.jackson.mapping 11:05:39,776 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for jackson.mapping using factory class net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory 11:05:39,776 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.engine.query.SQLQueryClauseFunctionsExtensions for property net.sf.jasperreports.extension.registry.factory.sql.clause.functions 11:05:39,776 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for sql.clause.functions using factory class net.sf.jasperreports.engine.query.SQLQueryClauseFunctionsExtensions 11:05:39,777 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.components 11:05:39,777 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for components using factory class net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory 11:05:39,777 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.default 11:05:39,777 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory 11:05:39,777 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.repository 11:05:39,778 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for repository using factory class net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory 11:05:39,778 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.castor.mapping 11:05:39,778 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for castor.mapping using factory class net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory 11:05:39,778 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.types.date.DateRangeQueryClauseExtensions for property net.sf.jasperreports.extension.registry.factory.date.range.clause.functions 11:05:39,778 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for date.range.clause.functions using factory class net.sf.jasperreports.types.date.DateRangeQueryClauseExtensions 11:05:39,779 DEBUG DefaultExtensionsRegistry,main:158 - Loading JasperReports extension properties resource jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-functions-5.1.2.jar!/jasperreports_extension.properties 11:05:39,779 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.functions.FunctionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.functions 11:05:39,779 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for functions using factory class net.sf.jasperreports.functions.FunctionsRegistryFactory 11:05:39,786 DEBUG DefaultExtensionsRegistry,main:158 - Loading JasperReports extension properties resource jar:file:/opt/lampp/htdocs/crm2/modules/zr2_Report/jasper/jasperreports-fonts-5.1.2.jar!/jasperreports_extension.properties 11:05:39,787 DEBUG DefaultExtensionsRegistry,main:208 - Instantiating registry of type net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.simple.font.families 11:05:39,787 DEBUG DefaultExtensionsRegistry,main:233 - Instantiating extensions registry for simple.font.families using factory class net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory </code></pre> </div>

weblogic启动报错<log4j:WARN Error during default initialization> ?

最开始weblogic能起成功,我接手的时候weblogic启动失败有报错,然后我重新导入oracle数据库,出现了日志中的错误,排查结果:weblogic单独启动没问题,weblogic部署中数据源测试也是成功的,jar包也一直没动过 最后日志如下 ``` <Sep 11, 2019 10:59:06 AM CST> <Notice> <Stdout> <BEA-000000> <Bundle依赖校验耗时(ms):2> <Sep 11, 2019 10:59:06 AM CST> <Notice> <Stdout> <BEA-000000> <没有不满足的依赖。> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <log4j:WARN Error during default initialization> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <java.lang.NoClassDefFoundError: org/w3c/dom/Node> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.Class.getDeclaredConstructors0(Native Method)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.Class.privateGetDeclaredConstructors(Class.java:2398)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.Class.getConstructor0(Class.java:2708)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.Class.newInstance0(Class.java:328)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.Class.newInstance(Class.java:310)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:330)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.log4j.Logger.getLogger(Logger.java:105)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:289)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:109)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.reflect.Constructor.newInstance(Constructor.java:513)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1116)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:914)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at com.ygsoft.ecp.service.osgi.starter.env.SystemConfigurator.<clinit>(SystemConfigurator.java:34)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at com.ygsoft.ecp.service.osgi.starter.Activator.start(Activator.java:51)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1015)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.security.AccessController.doPrivileged(Native Method)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1009)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:348)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:357)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1074)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:616)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:299)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:489)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:211)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:321)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <Caused by: java.lang.ClassNotFoundException: BundleLoader[org.apache.log4j_1.2.15.v201005080500].loadBundleClass(org.w3c.dom.Node)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:407)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.ClassLoader.loadClass(ClassLoader.java:247)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <... 36 more> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <Caused by: java.lang.ClassNotFoundException: org.w3c.dom.Node> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:491)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:404)> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <... 39 more> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <log4j:WARN No appenders could be found for logger (com.ygsoft.ecp.service.osgi.starter.env.SystemConfigurator).> <Sep 11, 2019 10:59:06 AM CST> <Notice> <StdErr> <BEA-000000> <log4j:WARN Please initialize the log4j system properly.> <Sep 11, 2019 10:59:06 AM CST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.> <Sep 11, 2019 10:59:06 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> <Sep 11, 2019 10:59:06 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> <Sep 11, 2019 10:59:06 AM CST> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1> <Sep 11, 2019 10:59:06 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 0:0:0:0:0:0:0:1:17001 for protocols iiop, t3, ldap, snmp, http.> <Sep 11, 2019 10:59:06 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:17001 for protocols iiop, t3, ldap, snmp, http.> <Sep 11, 2019 10:59:06 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on fe80:0:0:0:250:56ff:fe96:d83:17001 for protocols iiop, t3, ldap, snmp, http.> <Sep 11, 2019 10:59:06 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 172.16.2.174:17001 for protocols iiop, t3, ldap, snmp, http.> <Sep 11, 2019 10:59:06 AM CST> <Notice> <WebLogicServer> <BEA-000329> <Started WebLogic Admin Server "AdminServer" for domain "invoice_domain" running in Production Mode> <Sep 11, 2019 10:59:06 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> <Sep 11, 2019 10:59:06 AM CST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode> <Sep 11, 2019 10:59:07 AM CST> <Notice> <Stdout> <BEA-000000> <注销服务{org.springframework.beans.factory.xml.NamespaceHandlerResolver}={spring.osgi.core.bundle.id=422, spring.osgi.core.bundle.timestamp=1568170745417, service.id=22}> <Sep 11, 2019 10:59:07 AM CST> <Notice> <Stdout> <BEA-000000> <注销服务{org.xml.sax.EntityResolver}={spring.osgi.core.bundle.id=422, spring.osgi.core.bundle.timestamp=1568170745417, service.id=23}> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <Exception in thread "OSGiStartLog Timer" java.lang.ExceptionInInitializerError> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at com.ygsoft.ecp.service.osgi.starter.core.OSGiStartLogTimerTask.run(OSGiStartLogTimerTask.java:54)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.util.TimerThread.mainLoop(Timer.java:512)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.util.TimerThread.run(Timer.java:462)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.NoClassDefFoundError: sun/reflect/ConstructorAccessorImpl (Caused by java.lang.NoClassDefFoundError: sun/ref lect/ConstructorAccessorImpl)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:637)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at com.ygsoft.ecp.service.osgi.starter.util.WebLogicUtil.<clinit>(WebLogicUtil.java:27)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <... 3 more> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <Caused by: java.lang.NoClassDefFoundError: sun/reflect/ConstructorAccessorImpl> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.misc.Unsafe.defineClass(Native Method)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.security.AccessController.doPrivileged(Native Method)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:76)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:30)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.reflect.Constructor.newInstance(Constructor.java:513)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:608)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <... 7 more> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <Caused by: java.lang.ClassNotFoundException: BundleLoader[org.apache.commons.logging_1.1.1].loadBundleClass(sun.reflect.ConstructorAccessorImpl)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:407)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.lang.ClassLoader.loadClass(ClassLoader.java:247)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <... 17 more> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <Caused by: java.lang.ClassNotFoundException: sun.reflect.ConstructorAccessorImpl> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:491)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:404)> <Sep 11, 2019 11:04:06 AM CST> <Notice> <StdErr> <BEA-000000> <... 20 more> <Sep 11, 2019 11:09:06 AM CST> <Notice> <StdErr> <BEA-000000> <Exception in thread "OSGiStartLog Timer" java.lang.NoClassDefFoundError: Could not initialize class com.ygsoft.ecp.service.osgi.starter.util.WebLogicUtil> <Sep 11, 2019 11:09:06 AM CST> <Notice> <StdErr> <BEA-000000> <at com.ygsoft.ecp.service.osgi.starter.core.OSGiStartLogTimerTask.run(OSGiStartLogTimerTask.java:54)> <Sep 11, 2019 11:09:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.util.TimerThread.mainLoop(Timer.java:512)> <Sep 11, 2019 11:09:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.util.TimerThread.run(Timer.java:462)> <Sep 11, 2019 11:10:24 AM CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=JdbcDatasourcesJDBCDataSourceConfigTabPage&JdbcDatasourcesJDBCDataSourc eConfigPortlethandle=com.bea.console.handles.JMXHandle%28%22com.bea%3AName%3DJDBC+Data+Source-1%2CType%3Dweblogic.j2ee.descriptor.wl.JDBCDataSourceBean%2CParent%3D%5Binvoice_domain%5D%2FJDBCSystemResources%5BJDBC+Data+Source-1%5D%2CPath%3DJDBCRes ource%5BJDBC+Data+Source-1%5D%22%29.> <Sep 11, 2019 11:14:06 AM CST> <Notice> <StdErr> <BEA-000000> <Exception in thread "OSGiStartLog Timer" java.lang.NoClassDefFoundError: Could not initialize class com.ygsoft.ecp.service.osgi.starter.util.WebLogicUtil> <Sep 11, 2019 11:14:06 AM CST> <Notice> <StdErr> <BEA-000000> <at com.ygsoft.ecp.service.osgi.starter.core.OSGiStartLogTimerTask.run(OSGiStartLogTimerTask.java:54)> <Sep 11, 2019 11:14:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.util.TimerThread.mainLoop(Timer.java:512)> <Sep 11, 2019 11:14:06 AM CST> <Notice> <StdErr> <BEA-000000> <at java.util.TimerThread.run(Timer.java:462)> <Sep 11, 2019 2:21:40 PM CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=JdbcDatasourcesJDBCDataSourceConfigTabPage&JdbcDatasourcesJDBCDataSource ConfigPortlethandle=com.bea.console.handles.JMXHandle%28%22com.bea%3AName%3DJDBC+Data+Source-1%2CType%3Dweblogic.j2ee.descriptor.wl.JDBCDataSourceBean%2CParent%3D%5Binvoice_domain%5D%2FJDBCSystemResources%5BJDBC+Data+Source-1%5D%2CPath%3DJDBCReso urce%5BJDBC+Data+Source-1%5D%22%29.> <Sep 11, 2019 3:19:01 PM CST> <Error> <JDBC> <BEA-001112> <Test "SELECT 1 FROM DUAL" set up for pool "JDBC Data Source-1" failed with exception: "java.lang.NullPointerException".> <Sep 11, 2019 3:19:02 PM CST> <Notice> <Stdout> <BEA-000000> <tcp connect from (172.16.2.174:55154) to (172.16.7.3:18600) take 0 seconds for test ok, from nari―jdbc> <Sep 11, 2019 3:19:02 PM CST> <Notice> <Stdout> <BEA-000000> <tcp connect from (172.16.2.174:55155) to (172.16.7.3:18600) take 0 seconds for test ok, from nari―jdbc> ```

使用spring2.5@AspectJ进行AOP编程时遇到的配置问题

想在原来的正常运行的SSH系统上通过Aspectj增加AOP功能,在原来的包基础上加上了Aspectj的相关包,但只要我在applictationContext.xml上配置了:<aop:aspectj-autoproxy></aop:aspectj-autoproxy>,tomcat启动正常,但只要访问提交数据就会出现下面的错误,google上也没有找到想类似的解决方面,请知道的朋友指点一下, 谢谢! applictationContext.xml 文件 <?xml version="1.0" encoding="UTF-8"?> <beans default-autowire="byName" default-lazy-init="true" xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <!-- --> 注析掉下面一行就正常,当然AOP也没用了 <aop:aspectj-autoproxy></aop:aspectj-autoproxy> <!-- aopTest --> <bean id="msgAspect" class="com.ewf.util.aop.MsgAspect" ></bean> 包列表如下: antlr-2.7.6.jar aopalliance.jar asm.jar asm-util-2.2.3.jar asm-commons-2.2.3.jar aspectjrt.jar aspectjweaver.jar c3p0-0.9.1.2.jar cglib-nodep-2.1_3.jar common-dev.jar commons-beanutils-1.8.0.jar commons-collections-3.1.jar commons-digester-2.0.jar commons-fileupload-1.2.1.jar commons-io-1.3.2.jar commons-lang-2.3.jar commons-logging-1.1.1.jar dom4j-1.6.1.jar ehcache-1.6.0-beta5.jar ejb3-persistence-1.0.2GA.jar freemarker-2.3.13.jar hibernate-annotations-3.4.0GA.jar hibernate-commons-annotations-3.1.0GA.jar hibernate-core-3.3.0SP1.jar hibernate-ehcache-3.3.0.SP1.jar hibernate-entitymanager-3.4.0GA.jar hibernate-validator.jar javassist-3.4.jar jaxen-1.1-beta-7.jar jta.jar jtds-1.2.2.jar log4j-1.2.15.jar mysql-connector-java-5.1.6-bin.jar ognl-2.6.11.jar slf4j-api.jar slf4j-log4j12.jar spring-2.5.6.jar spring-security-core-2.0.4.jar struts2-core-2.1.2.jar struts2-spring-plugin-2.1.2.jar velocity-1.5.jar velocity-tools-1.4.jar velocity-tools-view-1.4.jar xwork-2.1.1.jar 错误提示如下:+++++++++++++ 2010-10-23 21:15:55,625 ERROR [com.ewf.util.ExceptionInterceptor] - java.lang.NullPointerException at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:208) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:246) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:124) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:170) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:170) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:208) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:137) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy13.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.ewf.util.webwork.ExceptionInterceptor.intercept(ExceptionInterceptor.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:477) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:467) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.ewf.util.filter.LoginFilter.doFilterInternal(LoginFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) 2010-10-23 21:15:55,750 ERROR [com.opensymphony.xwork2.DefaultActionInvocation] - There was an exception while instantiating the result of type org.apache.struts2.dispatcher.VelocityResult Caught OgnlException while setting property 'location' on type '$Proxy26'. - Class: ognl.ObjectPropertyAccessor File: ObjectPropertyAccessor.java Method: setProperty Line: 132 - ognl/ObjectPropertyAccessor.java:132:-1 at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:400) at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:87) at com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperties(OgnlReflectionProvider.java:55) at com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:215) at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:201) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:349) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:259) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:477) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:467) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.ewf.util.filter.LoginFilter.doFilterInternal(LoginFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: ognl.NoSuchPropertyException: $Proxy26.location at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132) at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656) at ognl.ASTProperty.setValueBody(ASTProperty.java:101) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:197) at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:393) ... 33 more

ant+junit组合出现ClassNotFoundException错误

一个简单的junit测试,在eclipse中,测试用例run as junit.正确,绿色的进度条。 后来结合自己最近刚学的,通过ant+junit来实现编译和测试。build.xml文件内容如下: [code="java"]<?xml version="1.0" encoding="UTF-8"?> <project name="build" default="junitTest"> <property name="src.dir" value="D:\workspace\examsystem\src"/> <property name="common.dir" value="D:\workspace\mycommon"/> <property name="dest.dir" value="D:\workspace\examsystem\WebContent\WEB-INF\classes"/> <path id="project.classpath"> <fileset dir="C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib"> <include name="**/*.jar"/> </fileset> <filelist id="file" dir="D:\My Documents\book spec helpdoc\help doc\junit4.5"> <file name="junit-4.5.jar"/> <file name="junit-dep-4.5.jar"/> </filelist> <filelist id="file2" dir="D:\My Documents\book spec helpdoc\help doc\dom4j-1.6.1"> <file name="dom4j-1.6.1.jar"/> </filelist> <filelist id="file3" dir="D:\My Documents\book spec helpdoc\help doc\apache-log4j-1.2.15"> <file name="log4j-1.2.15.jar"/> </filelist> <pathelement location="D:\My Documents\book spec helpdoc\help doc\commons-lang-2.3\commons-lang-2.3.jar"/> </path> <target name="junitTest" depends="compileAll"> <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" fork="yes"> <formatter type="plain" usefile="false"/> <test name="test.examsystem.common.AnotherTestPage"/> </junit> </target> <target name="compileAll"> <javac srcdir="${common.dir}" destdir="${dest.dir}"> <classpath refid="project.classpath"/> </javac> <javac srcdir="${src.dir}" destdir="${dest.dir}"> <classpath refid="project.classpath"/> </javac> </target> </project> [/code] 程序导入的jar,是因为在整个的copileAll过程中,有引用到。 通过命令窗口来运行时,却出现java.lang.ClassNotFoundException: test.examsystem.common.AnotherTestPage这个错误。 有查到javaeye中有个兄弟也提出过这个问题(http://www.iteye.com/problems/10228),但是是无满意答案回复。而且他自己解决的办法不适用我这个。所以,找大家帮个忙。 [b]问题补充:[/b] 应当没有这个问题,因为在compileAll任务中,是没有错误的。 自己通过增减构建文件内容,将<test name="test.examsystem.common.AnotherTestPage"/> 这句删掉是没有问题的。 刚开始的时候,我也是怀疑没有这个文件。将原来已经有的class文件全部删除后再运行一次,所有的class文件是都会出来的。 将class文件拖到eclipse中打开时,类的定义有: public class test.examsystem.common.AnotherTestPage extends junit.framework.TestCase{...}.应当是可以排队找不到类的问题。 问题可能在于类名那里,test.examsystem.common.AnotherTestPage .(jdk 1.5) [b]问题补充:[/b] 通过ant -debug,得到下面的结果。 [code="java"] Apache Ant version ${project.version} compiled on ${TODAY} Buildfile: build.xml Adding reference: ant.PropertyHelper Detected Java version: 1.5 in: C:\Program Files\Java\jdk1.5.0_16\jre Detected OS: Windows XP Adding reference: ant.ComponentHelper Setting ro project property: ant.file -> D:\workspace\examsystem\src\ant\build.x ml Adding reference: ant.projectHelper Adding reference: ant.parsing.context Adding reference: ant.targets parsing buildfile D:\workspace\examsystem\src\ant\build.xml with URI = file:/D:/ workspace/examsystem/src/ant/build.xml Setting ro project property: ant.project.name -> build Adding reference: build Setting ro project property: ant.file.build -> D:\workspace\examsystem\src\ant\b uild.xml Project base dir set to: D:\workspace\examsystem\src\ant +Target: +Target: junitTest +Target: compileAll [antlib:org.apache.tools.ant] Could not load definitions from resource org/apach e/tools/ant/antlib.xml. It could not be found. Setting project property: src.dir -> D:\workspace\examsystem\src Setting project property: common.dir -> D:\workspace\mycommon Setting project property: dest.dir -> D:\workspace\examsystem\WebContent\WEB-INF \classes Adding reference: project.classpath Adding reference: file Adding reference: file2 Adding reference: file3 Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor Adding reference: ant.executor Build sequence for target(s) `junitTest' is [junitTest] Complete build sequence is [junitTest, compileAll, ] junitTest: [junit] Found D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\li b\junit-4.5.jar [junit] Found D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\li b\ant-launcher.jar [junit] Found D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\li b\ant.jar [junit] Found D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\li b\ant-junit.jar [junit] Implicitly adding D:\My Documents\book spec helpdoc\help doc\apache- ant-1.7.1\lib\junit-4.5.jar;D:\My Documents\book spec helpdoc\help doc\apache-an t-1.7.1\lib\ant-launcher.jar;D:\My Documents\book spec helpdoc\help doc\apache-a nt-1.7.1\lib\ant.jar;D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1 \lib\ant-junit.jar to CLASSPATH [junit] Executing 'C:\Program Files\Java\jdk1.5.0_16\jre\bin\java.exe' with arguments: [junit] '-classpath' [junit] 'D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\lib\jun it-4.5.jar;D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\lib\ant-l auncher.jar;D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\lib\ant. jar;D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\lib\ant-junit.ja r' [junit] 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner' [junit] 'test.examsystem.common.AnotherTestPage' [junit] 'filtertrace=true' [junit] 'haltOnError=true' [junit] 'haltOnFailure=true' [junit] 'formatter=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnit ResultFormatter' [junit] 'showoutput=false' [junit] 'outputtoformatters=true' [junit] 'logtestlistenerevents=true' [junit] 'formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitRe sultFormatter' [junit] 'crashfile=D:\workspace\examsystem\src\ant\junitvmwatcher4124.proper ties' [junit] 'propsfile=D:\workspace\examsystem\src\ant\junit4125.properties' [junit] [junit] The ' characters around the executable and arguments are [junit] not part of the command. Execute:Java13CommandLauncher: Executing 'C:\Program Files\Java\jdk1.5.0_16\jre\ bin\java.exe' with arguments: '-classpath' 'D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\lib\junit-4.5.jar;D :\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\lib\ant-launcher.jar; D:\My Documents\book spec helpdoc\help doc\apache-ant-1.7.1\lib\ant.jar;D:\My Do cuments\book spec helpdoc\help doc\apache-ant-1.7.1\lib\ant-junit.jar' 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner' 'test.examsystem.common.AnotherTestPage' 'filtertrace=true' 'haltOnError=true' 'haltOnFailure=true' 'formatter=org.apache.tools.ant.taskdefs.optional.junit.SummaryJUnitResultFormat ter' 'showoutput=false' 'outputtoformatters=true' 'logtestlistenerevents=true' 'formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatte r' 'crashfile=D:\workspace\examsystem\src\ant\junitvmwatcher4124.properties' 'propsfile=D:\workspace\examsystem\src\ant\junit4125.properties' The ' characters around the executable and arguments are not part of the command. [junit] Running test.examsystem.common.AnotherTestPage [junit] Testsuite: test.examsystem.common.AnotherTestPage [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec [junit] [junit] Caused an ERROR [junit] test.examsystem.common.AnotherTestPage [junit] java.lang.ClassNotFoundException: test.examsystem.common.AnotherTest Page [junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [junit] at java.security.AccessController.doPrivileged(Native Method) [junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) [junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:251) [junit] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [junit] at java.lang.Class.forName0(Native Method) [junit] at java.lang.Class.forName(Class.java:164) [junit] BUILD FAILED D:\workspace\examsystem\src\ant\build.xml:24: Test test.examsystem.common.Anothe rTestPage failed at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.actOnTestResul t(JUnitTask.java:1840) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT ask.java:837) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue (JUnitTask.java:1785) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT ask.java:785) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav a:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe cutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.apache.tools.ant.Main.runBuild(Main.java:760) at org.apache.tools.ant.Main.startAnt(Main.java:219) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Total time: 3 seconds [/code] 目前,我自己正在试着去修改报错误的类。打印提示信息,暂时没有进展。 [b]问题补充:[/b] 多谢grandboy的解答,正是你说的这个问题导致我的ant+junit出错。 悠修改你的一个笔误: [code="java"] <pathelement refid="project.classpath"/> 要改成 <pathelement path="project.classpath"/> [/code] 运行正常,看到了这个结果: [code="java"] Buildfile: build.xml compileAll: junitTest: [junit] Running test.examsystem.common.AnotherTestPage [junit] Testsuite: test.examsystem.common.AnotherTestPage [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.031 sec [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.031 sec [junit] [junit] Testcase: testPage took 0.015 sec [junit] Testcase: testGetPageNavigateInt took 0 sec [junit] Testcase: testGetPageNavigate took 0 sec BUILD SUCCESSFUL Total time: 3 seconds [/code] 再次多谢!!!!!!!

关于zookeeper启动报虚拟机溢出问题

今天在启动zookeeper的时候突然报下面这个错误,不知道怎么解决了,有知道怎么解决的吗 ? # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000005fb52ec3, pid=1348, tid=4676 # # JRE version: (9.0+11) (build ) # Java VM: Java HotSpot(TM) 64-Bit Server VM (9.0.1+11, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) # Problematic frame: # V [jvm.dll+0x1b2ec3] # # No core dump will be written. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # --------------- S U M M A R Y ------------ Command Line: -Dzookeeper.log.dir=D:\zookeeper\bin\.. -Dzookeeper.root.logger=INFO,CONSOLE org.apache.zookeeper.server.quorum.QuorumPeerMain D:\zookeeper\bin\..\conf\zoo.cfg Host: Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz, 4 cores, 7G, Windows 8.1 , 64 bit Build 9600 (6.3.9600.17415) Time: Tue Nov 07 17:12:55 2017 ?D1ú±ê×?ê±?? elapsed time: 0 seconds (0d 0h 0m 0s) --------------- T H R E A D --------------- Current thread (0x0000002701f51800): JavaThread "Unknown thread" [_thread_in_vm, id=4676, stack(0x0000002703a20000,0x0000002703b20000)] Stack: [0x0000002703a20000,0x0000002703b20000], sp=0x0000002703b1f520, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000 Registers: RAX=0x0000000000000001, RBX=0x0000000000000000, RCX=0x0000000000000000, RDX=0x0000002701f3fb01 RSP=0x0000002703b1f520, RBP=0x0000000000000000, RSI=0x0000002703b1f958, RDI=0x0000002701f51800 R8 =0x0000000000000000, R9 =0x0000000000000007, R10=0x0000000000000006, R11=0x0000002703b1ee50 R12=0x000000005fedf800, R13=0x0000002701f2f0f0, R14=0x0000002701f39408, R15=0x0000000000000000 RIP=0x000000005fb52ec3, EFLAGS=0x0000000000010256 Top of Stack: (sp=0x0000002703b1f520) 0x0000002703b1f520: 0000002701f5cc00 000000005ff4d9c3 0x0000002703b1f530: 0000000000000038 000000005ff018cd 0x0000002703b1f540: 0000000060179708 0000000060117d60 0x0000002703b1f550: 0000000000000140 0000002703b1f5b0 0x0000002703b1f560: 0000002701f51800 000000005ff01c25 0x0000002703b1f570: 0000002701f50960 0000000000000000 0x0000002703b1f580: 0000000000000000 000000005ff01607 0x0000002703b1f590: 0000000000000000 000000005ff4d7b9 0x0000002703b1f5a0: 0000000e07618c6a 000000005f9a0000 0x0000002703b1f5b0: 0000002701f5cc00 0000000000000000 0x0000002703b1f5c0: 0000000000000004 0000a717b1e0ffbe 0x0000002703b1f5d0: 0000000000000000 000000005fb52a75 0x0000002703b1f5e0: 0000000000000004 0000000000000000 0x0000002703b1f5f0: 0000002701f2f0f0 0000002703b1f958 0x0000002703b1f600: 0000002703b1f640 000000005fb50e21 0x0000002703b1f610: 0000000000000000 0000002703b1f640 Instructions: (pc=0x000000005fb52ec3) 0x000000005fb52ea3: 48 33 c4 48 89 84 24 a8 00 00 00 0f b6 c2 88 54 0x000000005fb52eb3: 24 31 48 8b e9 49 83 c8 ff 0f 1f 40 00 49 ff c0 0x000000005fb52ec3: 41 80 3c 08 00 75 f6 33 f6 45 33 ed 88 44 24 30 0x000000005fb52ed3: 45 85 c0 0f 8e 78 02 00 00 8b 0d 62 01 7e 00 65 --------------- P R O C E S S --------------- Java Threads: ( => current thread ) Other Threads: [error occurred during error reporting (printing all threads), id 0xc0000005] VM state:not at safepoint (not fully initialized) VM Mutex/Monitor currently owned by a thread: None [error occurred during error reporting (printing compressed oops mode), id 0xc0000005] Deoptimization events (0 events): No events Classes redefined (0 events): No events Internal exceptions (0 events): No events Events (0 events): No events Dynamic libraries: 0x00007ff7ab210000 - 0x00007ff7ab24e000 C:\ProgramData\Oracle\Java\javapath\java.exe 0x00007ff85b840000 - 0x00007ff85b9ed000 C:\Windows\SYSTEM32\ntdll.dll 0x00007ff859bb0000 - 0x00007ff859cee000 C:\Windows\system32\KERNEL32.DLL 0x00007ff858b50000 - 0x00007ff858c65000 C:\Windows\system32\KERNELBASE.dll 0x00007ff859150000 - 0x00007ff8591fa000 C:\Windows\system32\ADVAPI32.dll 0x00007ff859810000 - 0x00007ff859987000 C:\Windows\system32\USER32.dll 0x00007ff8565b0000 - 0x00007ff85682b000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.18006_none_623f33d3ecbe86e8\COMCTL32.dll 0x00007ff857f10000 - 0x00007ff857f1a000 C:\Windows\SYSTEM32\VERSION.dll 0x00007ff859260000 - 0x00007ff85930a000 C:\Windows\system32\msvcrt.dll 0x00007ff858ed0000 - 0x00007ff858f29000 C:\Windows\SYSTEM32\sechost.dll 0x00007ff85b440000 - 0x00007ff85b580000 C:\Windows\system32\RPCRT4.dll 0x00007ff859000000 - 0x00007ff85914b000 C:\Windows\system32\GDI32.dll 0x00007ff858ea0000 - 0x00007ff858ece000 C:\Windows\system32\SspiCli.dll 0x00007ff859520000 - 0x00007ff859556000 C:\Windows\system32\IMM32.DLL 0x00007ff8596b0000 - 0x00007ff859801000 C:\Windows\system32\MSCTF.dll 0x00007ff842050000 - 0x00007ff84213f000 D:\Code\Java\jre\bin\msvcr120.dll 0x00007ff841ea0000 - 0x00007ff841f46000 D:\Code\Java\jre\bin\msvcp120.dll 0x000000005f9a0000 - 0x00000000603c4000 D:\Code\Java\jre\bin\server\jvm.dll 0x00007ff856840000 - 0x00007ff856849000 C:\Windows\SYSTEM32\WSOCK32.dll 0x00007ff852960000 - 0x00007ff852982000 C:\Windows\SYSTEM32\WINMM.dll 0x00007ff85b580000 - 0x00007ff85b587000 C:\Windows\system32\PSAPI.DLL 0x00007ff859320000 - 0x00007ff85937a000 C:\Windows\system32\WS2_32.dll 0x00007ff851c10000 - 0x00007ff851c3a000 C:\Windows\SYSTEM32\WINMMBASE.dll 0x00007ff859580000 - 0x00007ff859589000 C:\Windows\system32\NSI.dll 0x00007ff858c70000 - 0x00007ff858cbf000 C:\Windows\SYSTEM32\cfgmgr32.dll 0x00007ff8573d0000 - 0x00007ff8573f8000 C:\Windows\SYSTEM32\DEVOBJ.dll 0x00007ff8543e0000 - 0x00007ff8543ef000 D:\Code\Java\jre\bin\verify.dll 0x00007ff8442e0000 - 0x00007ff844307000 D:\Code\Java\jre\bin\java.dll 0x00007ff8488b0000 - 0x00007ff8488c6000 D:\Code\Java\jre\bin\zip.dll 0x00007ff854250000 - 0x00007ff85425a000 D:\Code\Java\jre\bin\jimage.dll 0x00007ff84e9e0000 - 0x00007ff84eb69000 C:\Windows\SYSTEM32\dbghelp.dll VM Arguments: jvm_args: -Dzookeeper.log.dir=D:\zookeeper\bin\.. -Dzookeeper.root.logger=INFO,CONSOLE java_command: org.apache.zookeeper.server.quorum.QuorumPeerMain D:\zookeeper\bin\..\conf\zoo.cfg java_class_path (initial): D:\zookeeper\bin\..\build\classes;D:\zookeeper\bin\..\build\lib\*;D:\zookeeper\bin\..\zookeeper-3.3.6.jar;D:\zookeeper\bin\..\lib\jline-0.9.94.jar;D:\zookeeper\bin\..\lib\log4j-1.2.15.jar;D:\zookeeper\bin\..\conf Launcher Type: SUN_STANDARD Logging: Log output configuration: #0: stdout all=warning uptime,level,tags #1: stderr all=off uptime,level,tags Environment Variables: JAVA_HOME=D:\Code\Java JRE_HOME=D:\Code\Java\jre CLASSPATH=D:\zookeeper\bin\..\build\classes;D:\zookeeper\bin\..\build\lib\*;D:\zookeeper\bin\..\*;D:\zookeeper\bin\..\lib\*;D:\zookeeper\bin\..\conf PATH=C:\ProgramData\Oracle\Java\javapath;D:\Code\Java\bin;D:\Code\Java\jre;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;;D:\Code\OracleClient\bin;C:\TDM-GCC-64\bin;D:\Code\MySQL\bin;D:\maven\apache-maven-3.3.9\bin;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;D:\Code\gradle-3.4\bin;;D:\zookeeper/bin; D:\zookeeper/conf;D:\Code\nodejs\;D:\Code\nodejs\;D:\Code\nodejs\node_global\node_modules\hexo\bin;D:\Code\Java\bin;D:\Code\Java\jre\bin;D:\Code\Python\Scripts\;D:\Code\Python\;C:\Users\tianlinpc\AppData\Local\atom\bin;D:\Program Files\mongodb\bin;D:\Code\Microsoft VS Code\bin;D:\Program Files\Git\bin;D:\Code\gradle-3.4\bin;;D:\zookeeper/bin; D:\zookeeper/conf;D:\Code\nodejs\;C:\Users\tianlinpc\AppData\Roaming\npm;D:\Code\nodejs\node_global\node_modules\hexo\bin;D:\Code\Java\bin;D:\Code\Java\jre\bin USERNAME=tianlinpc OS=Windows_NT PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel --------------- S Y S T E M --------------- OS: Windows 8.1 , 64 bit Build 9600 (6.3.9600.17415) CPU:total 4 (initial active 4) Memory: 4k page, physical 8281448k(5748736k free), swap 13000040k(7724396k free) vm_info: Java HotSpot(TM) 64-Bit Server VM (9.0.1+11) for windows-amd64 JRE (9.0.1+11), built on Sep 28 2017 04:54:03 by "mach5one" with MS VC++ 12.0 (VS2013) END.

spring4+hibernate5+struts2的maven项目启动报错

我的pom.xml ``` <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.plf.manage</groupId> <artifactId>StudentManage</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>StudentManage Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <!-- 日志的Jar包 --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.25</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j13</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.9.1</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.1</version> </dependency> <!-- Struts2的Jar包--> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.5.10</version> </dependency> <dependency> <groupId>org.apache.struts.xwork</groupId> <artifactId>xwork-core</artifactId> <version>2.3.34</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.5.10</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-json-plugin</artifactId> <version>2.5.10</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.40</version> </dependency> <dependency> <groupId>net.sf.ezmorph</groupId> <artifactId>ezmorph</artifactId> <version>1.0.6</version> </dependency> <!-- Java Transaction API--> <dependency> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <version>1.1</version> </dependency> <!-- MySQL驱动包 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.40</version> </dependency> <!-- Druid数据库连接池 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.5</version> </dependency> <!-- Hibernate的Jar包 --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.2.12.Final</version> </dependency> <!-- Spring4的Jar包 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>4.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>4.3.12.RELEASE</version> </dependency> <!-- Spring AOP 的Jar --> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.8.10</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.10</version> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>javax.enterprise</groupId> <artifactId>cdi-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <version>2.2</version> </dependency> </dependencies> <build> <finalName>StudentManage</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project> ``` ![图片说明](https://img-ask.csdn.net/upload/201711/21/1511274211_444567.png)

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

C++11:一些微小的变化(新的数据类型、template表达式内的空格、nullptr、std::nullptr_t)

本文介绍一些C++的两个新特性,它们虽然微小,但对你的编程十分重要 一、Template表达式内的空格 C++11标准之前建议在“在两个template表达式的闭符之间放一个空格”的要求已经过时了 例如: vector&lt;list&lt;int&gt; &gt;; //C++11之前 vector&lt;list&lt;int&gt;&gt;; //C++11 二、nullptr ...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

深入剖析Springboot启动原理的底层源码,再也不怕面试官问了!

大家现在应该都对Springboot很熟悉,但是你对他的启动原理了解吗?

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

【阿里P6面经】二本,curd两年,疯狂复习,拿下阿里offer

二本的读者,在老东家不断学习,最后逆袭

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

微软为一人收购一公司?破解索尼程序、写黑客小说,看他彪悍的程序人生!...

作者 | 伍杏玲出品 | CSDN(ID:CSDNnews)格子衬衫、常掉发、双肩包、修电脑、加班多……这些似乎成了大众给程序员的固定标签。近几年流行的“跨界风”开始刷新人们对程序员的...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

我说我懂多线程,面试官立马给我发了offer

不小心拿了几个offer,有点烦

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

2020春招面试了10多家大厂,我把问烂了的数据库事务知识点总结了一下

2020年截止目前,我面试了阿里巴巴、腾讯、美团、拼多多、京东、快手等互联网大厂。我发现数据库事务在面试中出现的次数非常多。

程序员如何与产品经理优雅的干架

早前,平安产险科技一名外包程序员和一名外包产品经理干架的视频几乎在互联网圈都传遍了,因为产品提了一个需求:要求用户App的主题颜色能根据手机壳自动调整。 首先说这个需求对于应用开发工程师来说,确实是有点奇葩,当然并非不能实现。这块涉及图形图像处理,用机器学习和人工智能来提取图像颜色,这是基本图像识别过程,对于采集图像,可以提示对着镜子自拍一张,上传图片,通过大量的训练数据,来识别手机体颜色。当然并...

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

在拼多多上班,是一种什么样的体验?我心态崩了呀!

之前有很多读者咨询我:武哥,在拼多多上班是一种什么样的体验?由于一直很忙,没抽出时间来和大家分享。上周末特地花点时间来写了一篇文章,跟大家分享一下拼多多的日常。 1. 倒时差的作息 可能很多小伙伴都听说了,拼多多加班很严重。这怎么说呢?作息上确实和其他公司有点区别,大家知道 996,那么自然也就能理解拼多多的“11 11 6”了。 所以当很多小伙伴早上出门时,他们是这样的: 我们是这样的: 当...

应聘3万的职位,有必要这么刁难我么。。。沙雕。。。

又一次被面试官带到坑里面了。面试官:springmvc用过么?我:用过啊,经常用呢面试官:springmvc中为什么需要用父子容器?我:嗯。。。没听明白你说的什么。面试官:就是contr...

太狠了,疫情期间面试,一个问题砍了我5000!

疫情期间找工作确实有点难度,想拿到满意的薪资,确实要点实力啊!面试官:Spring中的@Value用过么,介绍一下我:@Value可以标注在字段上面,可以将外部配置文件中的数据,比如可以...

立即提问
相关内容推荐