Trying to load an external library kills JRE - java

I'm trying to restart an old project that I had to go back into when my server died. This project goes out and reads a couple of hardware sensors through a USB hardware interface and it DID work, the last time I compiled and ran it. That was over a year ago, though, against an old JDK (probably 1.6) and an old version of Tomcat (probably 6). This time, using Java 8 and Tomcat 8, I get a truly horrendous error when my new Tomcat install tries to start up:
CRIT: Couldn't get method ID <init> from tagLossEvent_class
Exception in thread "localhost-startStop-1" java.lang.NoSuchMethodError: <init>
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.phidgets.Phidget.<clinit>(Phidget.java:26)
at com.electricgearbox.temperature.PhidgetSensor.<init>(PhidgetSensor.java:33)
at com.electricgearbox.temperature.PhidgetSensor.getInstance(PhidgetSensor.java:45)
at com.electricgearbox.temperature.TempServletListener.contextInitialized(TempServletListener.java:21)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4811)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5251)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
It causes the whole JDK to shut down. Has anyone seen anything like this, and do you know how I could fix this problem?

This usually happens when external library jar is not compatible with the upgraded java version, please check version of phidget.jar and upgrade it to latest.
Hope this helps.

Related

Manage TomEE libs loading order

I have an EJB application that is currently deployed on TomEE 1.7.4 with OpenJDK 7 inside a docker container (openjdk 7, TomEE, and my war).
Note: The Jar files that I added within TomEE lib folder are reconized by the application, because I had some errors that has been solved after adding those Jar files.
The error log
INFO: PersistenceUnit(name=manager1, provider=org.hibernate.jpa.HibernatePersistenceProvider) - provider time 2214ms
Apr 25, 2018 5:35:21 PM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeploying app: /usr/local/tomee/webapps/myapp
Apr 25, 2018 5:35:21 PM org.apache.catalina.core.ContainerBase removeChild
SEVERE: ContainerBase.removeChild: destroy:
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]] in state [STARTING_PREP]
at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:291)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1038)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1537)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1518)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:762)
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1982)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:839)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
at java.lang.Thread.run(Thread.java:748)
Apr 25, 2018 5:35:21 PM org.apache.tomee.catalina.TomcatWebAppBuilder startInternal
SEVERE: Unable to deploy collapsed ear in war StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]
org.apache.openejb.OpenEJBException: Creating application failed: /usr/local/tomee/webapps/myapp: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:843)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:973)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:824)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3845)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3799)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1412)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:64)
at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:116)
at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:102)
at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:154)
at org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(Assembler.java:982)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:741)
List of Jar added to TomEE lib folder:
mysql:mysql-connector-java:5.1.22
org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
org.hibernate:hibernate-entitymanager:4.3.9.Final
org.hibernate:hibernate-core:4.3.9.Final
org.hibernate.common:hibernate-commons-annotations:4.0.5.Final
org.jboss:jandex:1.1.0.Final
org.jboss.logging:jboss-logging:3.1.3.GA
org.javassist:javassist:3.18.1-GA
antlr:antlr:2.7.7
dom4j:dom4j:1.6.1
Although, I tried to deploy other apps within this docker image and every think works as expected.
TLDR; your TomEE version does not support the apis you seem to be using.
I would go with upgrading TomEE, so you would get proper support for the apis you want to use. Other solutions are just workarounds that might break in numerous ways as they are not supported.
A bit longer answer:
This looks java app dependency problem/version conflict for me: see this thread for similar error message and its cause. The dependencies you've added depend on javax.persistence spec 2.1, but based on the stack trace your app seems to be using older apis.
You seem to want to use Java Persistence API 2.1, that comes with Java EE 7. Java EE 6 contains Java Persistence API 2.0.
Version of TomEE you're using, Apache TomEE 1.7.4, supports only Java EE 6 and thus Persistence API 2.0, and it was last version not supporting Java EE 7:
From this point on the TomEE community will be focusing most of it's efforts on TomEE 7.0.0, which will be the first TomEE Java EE 7 driven version running on Apache Tomcat 8.x.
So an upgrade of TomEE would be in order.
TomEE comes with OpenJPA as persistence engine.
You can change to Hibernate but you have to follow this guide
Extending the ClassPath is a bad solution although it does the job.
I fugured it out, the solution is to create a "setenv.sh" file in TomEE bin directory with the CLASSPATH of the "jpa 2.1" jar file.
setenv.sh
#!/bin/sh
CLASSPATH=/usr/local/tomee/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar

java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger in Tomcat

I using Tomcat 8.0.26 and during the deploy (after executing ./startup) I am getting the following exception:
28-Mar-2018 15:07:58.926 SEVERE [localhost-startStop-2]
org.apache.catalina.core.StandardContext.listenerStart Exception
sending context initialized event to listener instance of class
ie.company.web.AppContextListener java.lang.NoSuchMethodError:
org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
at org.hibernate.ejb.Ejb3Configuration.(Ejb3Configuration.java:142)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at ie.company.persistence.PersistenceUtil.resetFactory(PersistenceUtil.java:44)
at ie.company.persistence.PersistenceUtil.createEntityManager(PersistenceUtil.java:37)
at ie.company.persistence.repository.impl.MerchantCategoryRepositoryImpl.findAllMerchantCategories(MerchantCategoryRepositoryImpl.java:38)
at ie.company.persistence.repository.impl.RepositoryImpl.findAllMerchantCategories(RepositoryImpl.java:1204)
at ie.company.web.AppContextListener.initStrutsApplicationContext(AppContextListener.java:113)
at ie.company.web.AppContextListener.contextInitialized(AppContextListener.java:86)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
I've seen dozens of posts about this exception:
java.lang.NoSuchMethodError:
org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Objec
But no one does make sense to me, since I have the same “.war” file running on different servers (I don't have any problems running the application on my local system in Eclipse as well). Currently the application is running on Linux Opensuse and I am migrating it to Linux Ubuntu 16.04. I don't think that I am missing any library because I copied and pasted the exactly Tomcat installation from the old server on which the applications is currently running. Any clue? Please help me.

Could not load net.sf.ehcache.store.compound.CompoundStore$KeySet. when deploying Grails 2.5 on Tomcat 7.0.42 App

I'm finding the following problem when deploying an application grails 2.5.0 on tomcat 7.0.42.
INFO: Illegal access: this web application instance has been stopped already. Could not load net.sf.ehcache.store.compound.CompoundStore$KeySet. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1600)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at net.sf.ehcache.store.compound.CompoundStore.keySet(CompoundStore.java:216)
at net.sf.ehcache.store.compound.factories.DiskStorageFactory$DiskExpiryTask.run(DiskStorageFactory.java:670)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Running the application via run-app grails application works normally! I realized that there is a difference between versions of Tomcat, the embedded version is in build ": tomcat: 7.0.54" and the environment is with Apache Tomcat / 7.0.42
The closest I found the problem in the link suggested a 'downgrade' version, which is not a viable solution at the moment! which may be the cause of this problem? A bug in the version of tomcat or application?

Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies

My app is quit big and using many jars and tools.
Platform - windows 2008 server, Spring , hibernate, Quarts, mysql, tomcat-7.35
When I deploy and start the server first time working perfectly,
but If I restart I am getting the below err
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/TestProject]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/TestProject]. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2109)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1947)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1932)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1326)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Caused by: java.lang.StackOverflowError
at java.util.HashSet.<init>(HashSet.java:103)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2252)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
Feb 16, 2013 12:16:10 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory C:\apache-tomcat-7.0.35\webapps\TestProject
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[TestProject]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
The stack trace says that tomcat is running out of stack space on the thread that is scanning your application looking for java based servlet configurations. There are three ways you can solve this problem.
Increase the stack size -Xss4m
Tell Tomcat not to scan your application if you are not using any java based Servlet configuration add metadata-complete="true" to your web-app in web.xml
Restrict what jar files tomcat scans. see http://tomcat.apache.org/tomcat-7.0-doc/config/jar-scanner.html
Update 1
you need to pass -Xss4m to your jvm to set the stack size, -Xss10m would set it to 10mb.
I am using Hibernate and Spring in my application too with annotations, the scanning that tomcat does is to look for Servlet 3.0 annotations so you can still restrict things while using hibernate and spring annotations, since hibernate and spring annoations are scanned for by spring and hibernate.
If you are running tomcat as a windows service you will need, to pass the arguments via procrun since that is the executable that is launching the jvm. The docs for procrun are at http://commons.apache.org/daemon/procrun.html. tomcat7.exe is really procrun.exe renamed, which means that all your jvm options are written to the registery under
The basic Service definitions are maintained under the registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Additional parameters are stored in the registry at:
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\ProcRun
2.0\\Parameters
On 64-bit Windows procrun always uses 32-bit registry view for storing
the configuration. This means that parameters will be stored inside:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software
Foundation\ProcRun 2.0\
Update 2
Tomcat has been tweaking how the scanner works between point releases. try rolling forward through the versions 7.25,7.26 ... etc to find the version at which it breaks, the go through the release notes for that version to see if they changed how the scanner works.
Another thing you can try doing, is to create another war file which has all the third party jars in your WEB-INF\lib but not your code. See if you get that error if you start up, and if you do then should file a bug report with tomcat and make available to them your sample project that replicates the problem, on github or some other free code hosting system. I am sure if there is a bug they will fix it.
To fix this for TC Server 2.9, running Tomcat 7.0.39 I restricted the jars to skip during startup for the context config using:
org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar
in catalina.properties.
In My case iTextpdf JAR(5.06 version) causing problem as it had dependancy on org.bouncyCastle.*.jar and it was creating cyclic dependancy.
After updating it to 5.5.6 version, worked perfectly.
If you are adding maven dependancy , clean and update maven project.
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.6</version>
</dependency>
I'm not running Tomcat as a Windows service, so to pass -Xss10m through, I edited catalina.bat, towards the bottom:
:doJpda
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Xss10m -classpath "%CLASSPATH%" -
Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
goto end

Java3D classes not found

I'm trying to run a Java application and I get the following error message. The application itself loads correctly, it just appears to be certain parts of it that fail.
Nov 13, 2012 2:43:53 PM org.jdesktop.application.Task failed
SEVERE: My.Application$9#7c4f8358 failed: java.lang.NoClassDefFoundError: javax/media/opengl/GLCapabilitiesChooser
java.lang.NoClassDefFoundError: javax/media/opengl/GLCapabilitiesChooser
at jpl.mipl.jade.jadis.agile2d.swing.JOGLPluggableRenderer.notifyBeforeSetRootPane(JOGLPluggableRenderer.java:105)
at jpl.mipl.jade.jadis.StereoJFrame.setRootPane(StereoJFrame.java:264)
at javax.swing.JFrame.frameInit(JFrame.java:236)
at javax.swing.JFrame.<init>(JFrame.java:159)
at jpl.mipl.jade.jadis.StereoJFrame.<init>(StereoJFrame.java:172)
at StereoWS.DSStereoFrame.<init>(DSStereoFrame.java:70)
at StereoWS.StereoWSView$9.doInBackground(StereoWSView.java:1067)
at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
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:680)
Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLCapabilitiesChooser
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 14 more
I'm running OS X 10.8 fully updated, I've installed JDK 7 and, in frustration, Apple's Java development tools. The program relies on a number of external libraries, but these are supplied with the jar and I trust that the program does actually look for them in the distribution directory when it runs (the errors aren't due to those packages though, I believe). As far as I can tell everything that I need to run the application is either already installed or somewhere where the jar can find it
I don't know if there's anything else I need to do to set up the environment that I haven't done yet, so if anyone can suggest something, I'm all ears! I will provide any extra information needed, but I don't know what would help - I'm not a Java guru by any means.
I believe you are using Java3D jars from the old Oracle site in combination with the latest JogAmp JOGLv2, this will not work of two reasons A) the jogl.jar is now renamed jogl-all.jar B) internal namespace changes, all com.sun.* classes is now found under com.jogamp.* and this will confuse the old Java3D code that expects the com.sun.* namespace.
Both JOGL and Java3D is now maintained by members of the JogAmp community:
Background of the move: http://labb.zafena.se/?p=656
The only supported way to use Java3D today is by using the community maintained Java3D in combination with the latest JogAmp JOGL v2.
Tutorial on how to setup the latest community maintained Java3D in combination with JOGLv2.
Julien Gouesse: Java 3D est de retour [Java 3D is back]
http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/

Categories

Resources