I am not able to start Tomcat v6.0 from Eclipse Helios.
I have my Java bin path set properly.
Moreover, I can start the server from outside of Eclipse manually. I could start it from Windows Services as well as using tomcat6.exe and see that it works correctly in my browser by typing localhost:8080 in the URL, but when I start from Eclipse a window appears saying that it encountered a problem while starting tomcat.
And my Console shows the following error:-
java.lang.reflect.InvocationTargetException
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.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1094)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
... 6 more
I also tried a solution here, but the problem still persists. However, the problem there is different from what I get.
How do I solve this?
Seems that you're building some web-app with spring support.
You have to export dependencies into tomcat.
project_properties -> Java build path -> Order and Export tab.
On this tab check all checkboxes which are relevant (you have to check spring at least).
Push OK.
Redeploy
Related
I'm trying to create a web application in NetBeans 8.2, for this I try to use Apache Tomcat 8.0.27 which is integrated into this version. Previously I worked with Tomcat and Netbeans without any problem but in one occasion it failed.
I tried to modify environment variables in addition to reinstalling NetBeans with all its components but it did not work. I looked for information in other questions but I didn't find anything useful, possibly some file is corrupted but if it were the case, I would like to know how to solve it with a simple and understandable explanation, in some forums I read about how to find corrupted files and solve some things but they are not so clear to me.
Specs:
- Windows
- Netbeans 8.2
- Tomcat 8.0.27
- JDK & JDR 1.8.0.191
**Exception in thread "main" java.lang.InternalError:** java.util.zip.ZipException: error in opening zip file
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1052)
at sun.misc.URLClassPath.getResource(URLClassPath.java:249)
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.util.ResourceBundle$RBClassLoader.loadClass(ResourceBundle.java:512)
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2649)
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1510)
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1474)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1370)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:782)
at sun.security.provider.AuthPolicyFile$1.run(AuthPolicyFile.java:74)
at sun.security.provider.AuthPolicyFile$1.run(AuthPolicyFile.java:71)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.provider.AuthPolicyFile.<clinit>(AuthPolicyFile.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at javax.security.auth.Policy$2.run(Policy.java:236)
at javax.security.auth.Policy$2.run(Policy.java:228)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Policy.getPolicyNoCheck(Policy.java:227)
at javax.security.auth.Policy.getPolicy(Policy.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
at org.apache.catalina.startup.Catalina.load(Catalina.java:576)
at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
**Caused by: java.util.zip.ZipException: error in opening zip file**
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)
at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:940)
at sun.misc.URLClassPath$JarLoader.access$800(URLClassPath.java:801)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:886)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:879)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:878)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1050)
... 44 more
I would expect Tomcat to deploy without any problem but instead it is simply not deployed, sending the error every time.
Update: I installed the same NetBeans but in other computer AND it worked. I copyied the files of Tomcat and NetBeans but the error still (So, theres no a problem related to corrupted .jars i think). The project that im using to test it's a basic HTML page... A default Java web project.
This problem in most part of times is a Exception of corrupted jars.
Are you trying to connect to any database? If yes, try to remove .jar file from lib folder on WebContent and copy the file from your computer directory to your folder on IDE and try again. If no, try to do this procedure to all of .jars that you're using on your project and replace them all again.
I tried to deploy a report to my jasper server. I followed this tutorial: http://randomallsorts.blogspot.de/2009/12/jasper-reports-how-to-deploy-report-to.html. But in the end of the day, when I tried to have a look at my report in the admin interface I just received a pretty long error which I don't understand.
The server has encountered an error. Please excuse the inconvenience.
Error Message
com.mysql.jdbc.Driver Error Trace
com.jaspersoft.jasperserver.api.JSExceptionWrapper:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.loadDriverFromExistingClassLoaders(JdbcDriverServiceImpl.java:535)
at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.register(JdbcDriverServiceImpl.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:318)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy35.register(Unknown Source) at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.registerDriver(DbcpDataSourceFactory.java:58)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.createPooledDataSource(DbcpDataSourceFactory.java:50)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.getPoolDataSource(JdbcReportDataSourceServiceFactory.java:145)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.createService(JdbcReportDataSourceServiceFactory.java:128)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.createDataSourceService(EngineServiceImpl.java:1763)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1651)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1022)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:897)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619) Error Message
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Error Trace
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.loadDriverFromExistingClassLoaders(JdbcDriverServiceImpl.java:535)
at
com.jaspersoft.jasperserver.api.common.service.impl.JdbcDriverServiceImpl.register(JdbcDriverServiceImpl.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:318)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy35.register(Unknown Source) at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.registerDriver(DbcpDataSourceFactory.java:58)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DbcpDataSourceFactory.createPooledDataSource(DbcpDataSourceFactory.java:50)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.getPoolDataSource(JdbcReportDataSourceServiceFactory.java:145)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcReportDataSourceServiceFactory.createService(JdbcReportDataSourceServiceFactory.java:128)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.createDataSourceService(EngineServiceImpl.java:1763)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1651)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1022)
at
com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:897)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Does anybody have a clue what could be wrong there ? I am sorry but I am really a ireport amateur.
First you should install the driver on your Jasper Server.
Go to the web interface with a user in the role ROLE_ADMINISTRATOR
On the tree view, you can create a folder to hold your datasource
In that folder, right click and add a data source
Give it a meaningful name for you and upload the com.mysql.jdbc.Driver (if not already present).
Note: if you did a manual WAR installation, you probably installed the driver already.
Download the driver here http://dev.mysql.com/downloads/connector/j/
Check the jdbc url. Should be something like jdbc:mysql://your_host/your_database
Small hack is to check your max allow packet setting in your MYSQL server and set it accordingly in your jdbc url. On MYSQL driver, check it using this command:
SHOW VARIABLES LIKE 'max_allowed_packet';
Then set the url to: jdbc:mysql://your_host/your_database?maxAllowedPacket=WHATEVER_SIZE_YOU_GOT
Check the username, password and timezone and test the connection.
Edit the report on the web interface and set the datasource as being this one.
When you upload a new report, either via web interface or iReport Designer, assign this data source.
Good luck, hope it solves your problem :)
try using this guide..
Seems like it cannot find the mysql driver to connect.
http://jasperserver.sourceforge.net/docs/3-5-0/JasperServer-User-Guide.pdf
I use JBoss 5.0.1.
I try to deploy some EJB 3.0 beans.
This is my log during JBoss start:
23:19:15,955 ERROR [AbstractKernelController] Error installing to Create: name=jboss.j2ee:jndiName=MyServiceFacadeBean/remote,service=EJB state=Configured mode=Manual requiredState=Create
java.lang.NoSuchMethodException: org.jboss.ejb.StatelessSessionContainer.initHome()
at java.lang.Class.getMethod(Class.java:1605)
at org.jboss.ejb.StatelessSessionContainer.setupHomeMapping(StatelessSessionContainer.java:132)
at org.jboss.ejb.SessionContainer.createService(SessionContainer.java:168)
at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:344)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:320)
at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)
at $Proxy36.create(Unknown Source)
It seems Jboss has incorrect version of required Class or I use some old/new code for EJB deploy.
Please do not tell to use different JBoss version or change my ejb-jar.xml I just want to understand where can this class be found?
The problem is that you are not using one version of JBoss. If you were this would not happen. The problem is you are using two different and incompatible JBoss libraries and when one calls the other you get this error.
Just make sure you have one version of JBoss.
I trying to deploy Java EE web application on Geronimo container with Jetty web server. Unfortunately I have some troubles, I'm getting NoSuchMethod error. I saw that somebody had similar problem, and the solution was to remove redundant spring-framework library from classpath. But it doesn't work for me, my classpath is correctly constructed. Here's contents of WEB-INF/lib directory:
aopalliance-1.0.jar
commons-collections-3.2.1.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar
h2-1.3.164.jar
hibernate-commons-annotations-3.2.0.Final.jar
hibernate-core-3.6.9.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
javassist-3.12.1.GA.jar
log4j-1.2.16.jar
slf4j-api-1.6.4.jar
slf4j-log4j12-1.6.4.jar
spring-aop-3.1.1.RELEASE.jar
spring-asm-3.1.1.RELEASE.jar
spring-beans-3.1.1.RELEASE.jar
spring-context-3.1.1.RELEASE.jar
spring-core-3.1.1.RELEASE.jar
spring-expression-3.1.1.RELEASE.jar
spring-hibernate3-2.0.8.jar
spring-jdbc-3.1.1.RELEASE.jar
spring-orm-3.1.1.RELEASE.jar
spring-tx-3.1.1.RELEASE.jar
spring-web-3.1.1.RELEASE.jar
spring-webmvc-3.1.1.RELEASE.jar
spring-webmvc-3.1.1.RELEASE-sources.jar
Referencing to redundant libraries trouble, is that possible that web container loads own version of spring-framework different than given in WEB-INF/lib? I thought that WEB-INF/lib directory has better priority... It's my first project under Geronimo, but I saw that project can contain geronimo-web.xml file, maybe I should place there something referenced with library loading/dependencies?
Here's the stacktrace:
Geronimo Application Server started
2012-02-24 20:19:17,463 WARN [JettyModuleBuilder] Web application . does not contain a WEB-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depending on whether you have things like resource references that need to be resolved. You can also give the deployer a separate deployment plan file on the command line.
2012-02-24 20:19:22,122 ERROR [log] failed dispatcher
org.apache.xbean.recipe.ConstructionException: Error invoking constructor: public org.springframework.web.servlet.DispatcherServlet()
at org.apache.xbean.recipe.ReflectionUtil$ConstructorFactory.create(ReflectionUtil.java:962)
at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
at org.apache.geronimo.j2ee.annotation.Holder.newInstance(Holder.java:173)
at org.apache.geronimo.jetty6.JettyWebAppContext.newInstance(JettyWebAppContext.java:317)
at org.apache.geronimo.jetty6.InternalJettyServletHolder.newInstance(InternalJettyServletHolder.java:81)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:253)
at org.apache.geronimo.jetty6.InternalJettyServletHolder.internalDoStart(InternalJettyServletHolder.java:120)
at org.apache.geronimo.jetty6.InternalJettyServletHolder.access$000(InternalJettyServletHolder.java:38)
at org.apache.geronimo.jetty6.InternalJettyServletHolder$StartCommand.lifecycleMethod(InternalJettyServletHolder.java:131)
at org.apache.geronimo.jetty6.handler.AbstractImmutableHandler.lifecycleCommand(AbstractImmutableHandler.java:62)
at org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler.lifecycleCommand(ThreadClassloaderHandler.java:57)
at org.apache.geronimo.jetty6.handler.AbstractImmutableHandler.lifecycleCommand(AbstractImmutableHandler.java:60)
at org.apache.geronimo.jetty6.handler.InstanceContextHandler.lifecycleCommand(InstanceContextHandler.java:81)
at org.apache.geronimo.jetty6.handler.AbstractImmutableHandler.lifecycleCommand(AbstractImmutableHandler.java:60)
at org.apache.geronimo.jetty6.handler.UserTransactionHandler.lifecycleCommand(UserTransactionHandler.java:63)
at org.apache.geronimo.jetty6.handler.AbstractImmutableHandler.lifecycleCommand(AbstractImmutableHandler.java:60)
at org.apache.geronimo.jetty6.handler.ComponentContextHandler.lifecycleCommand(ComponentContextHandler.java:57)
at org.apache.geronimo.jetty6.InternalJettyServletHolder.doStart(InternalJettyServletHolder.java:107)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:612)
at org.mortbay.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:980)
at org.mortbay.jetty.servlet.ServletHandler.setServletMappings(ServletHandler.java:1037)
at org.mortbay.jetty.servlet.ServletHandler.addServletMapping(ServletHandler.java:736)
at org.apache.geronimo.jetty6.JettyWebAppContext.registerServletHolder(JettyWebAppContext.java:497)
at org.apache.geronimo.jetty6.JettyServletHolder.<init>(JettyServletHolder.java:80)
at sun.reflect.GeneratedConstructorAccessor62.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:948)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:541)
at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:176)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:254)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:294)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:541)
at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:176)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:254)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:294)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)
at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555)
at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456)
at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:188)
at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:563)
at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:544)
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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:342)
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.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
at org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:275)
at org.springframework.core.convert.support.GenericConversionService.addConverter(GenericConversionService.java:93)
at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:61)
at org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:53)
at org.springframework.core.convert.support.DefaultConversionService.<init>(DefaultConversionService.java:42)
at org.springframework.core.env.AbstractPropertyResolver.<init>(AbstractPropertyResolver.java:44)
at org.springframework.core.env.PropertySourcesPropertyResolver.<init>(PropertySourcesPropertyResolver.java:42)
at org.springframework.core.env.AbstractEnvironment.<init>(AbstractEnvironment.java:101)
at org.springframework.core.env.StandardEnvironment.<init>(StandardEnvironment.java:54)
at org.springframework.web.context.support.StandardServletEnvironment.<init>(StandardServletEnvironment.java:43)
at org.springframework.web.servlet.HttpServletBean.<init>(HttpServletBean.java:90)
at org.springframework.web.servlet.FrameworkServlet.<init>(FrameworkServlet.java:211)
at org.springframework.web.servlet.DispatcherServlet.<init>(DispatcherServlet.java:323)
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.xbean.recipe.ReflectionUtil$ConstructorFactory.create(ReflectionUtil.java:952)
... 96 more
Finally I found two possible solutions. One, more obvious, is to use Geronimo dedicated Spring library, for example Geronimo v2.1 used Spring 2.5.6. The other, more rational, is to create/edit geronimo-web.xml. For me I had to overwrite loading order, it means, WEB-INF/lib libraries have better priority to be loaded.
<sys:environment>
<sys:hidden-classes>
<sys:filter>org.springframework</sys:filter>
<sys:filter>org.hibernate</sys:filter>
<sys:filter>javax.persistence</sys:filter>
<sys:filter>org.apache.log4j</sys:filter>
<sys:filter>org.slf4j</sys:filter>
<sys:filter>org.apache.tiles</sys:filter>
<sys:filter>javassist</sys:filter>
<sys:filter>org.h2</sys:filter>
<sys:filter>org.dom4j</sys:filter>
<sys:filter>org.apache.commons</sys:filter>
<sys:filter>org.aopalliance</sys:filter>
</sys:hidden-classes>
</sys:environment>
This is the problem:
NoSuchMethodError: org.springframework.core.GenericTypeResolver.
resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
This method was introduced in Spring 3.0.0.RELEASE (compare with 3.0.0.M4). Also it is part of 3.1.1.RELEASE - which you believe you are using.
Double check you don't have any duplicated JARs, especially the spring-core*.jar.
I'm trying to create a web service and deply it on Tomcat. I'm following this tutorial.
I'm using Eclipse Europa.
But when I try to start the server it returns this error:
java.lang.ClassNotFoundException: org.apache.catalina.core.ThreadLocalLeakPreventionListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1356)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1320)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:741)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
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:616)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:430)
The ThreadLocalLeakPreventionListener was added recently to tomcat. It is available in tomcat 7 as well as the latest version(s) of tomcat 6. Make sure you have the latest tomcat 6, with a clean installation (your installation might have the server.xml from the new version and the jars from the older one)
even i faced the same issue.What you need to do is, go to servers tab and left click on Apache server and click on properties. There you can see Location pointing to [workspace metadata]. Click on switch Location. It will switch to Apache location /Servers/Tomcat xxx.Apply the changes and save.
If you are using the class in server.xml you need to remove it to get rid of the error/Exception.
<Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
Your web.xml contains entry for a listener whose code was added in Tomcat 7.0.6 and onwards, but your tomcat is older than that -
org.apache.catalina.core.ThreadLocalLeakPreventionListener