-
1. Re: Static variable in servlet gets shared between 2 applica
jaikiran May 21, 2009 7:03 AM (in response to sada1977)After adding above, applications are not getting deployed. It throws exception like,
java.lang.NoClassDefFoundError: java/lang/Object
NoClassDefFoundError for java.lang.Object?If I add above jboss-app.xml for test applications having only servlet(common to both) then it works fine (static var is not getting shared). But it doesn't work for my turbine application where there are too many jars ejbs etc.
What are the list of jars contained in this turbine application? Are you by any chance including jar(s) containing java.lang.* classes? Post the list of jars in that application.
While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted. -
2. Re: Static variable in servlet gets shared between 2 applica
alesj May 21, 2009 7:06 AM (in response to sada1977)This is what Seam uses in its DVD example app and it definitely works - as Seam is required to be scoped if you want to run more than one Seam instance.
<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd"> <jboss-app> <loader-repository> seam.jboss.org:loader=seam-dvd </loader-repository> </jboss-app>
-
3. Re: Static variable in servlet gets shared between 2 applica
sada1977 May 21, 2009 7:47 AM (in response to sada1977)I tried this one also but still it is not working.
List of dependency jar is
turbine.jar
velocity.jar
commons-logging.jar
commons-fileupload.jar etc.
There is no single jar which contains java.lang.* classes.
If I remove jboss-app.xml from meta-inf then it doen't give java.lang.NoClassDefFoundError: java/lang/Object
but static variable of turbine servlet gets shared between 2 applications.
Please suggest if anybody has any solution.
Thanks in advance -
4. Re: Static variable in servlet gets shared between 2 applica
jaikiran May 21, 2009 7:53 AM (in response to sada1977)Which exact version of JBoss AS 5 do you use?
-
5. Re: Static variable in servlet gets shared between 2 applica
jaikiran May 21, 2009 7:55 AM (in response to sada1977)And please post the entire exception stacktrace and the logs that you see on the console (not the server.log)
While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted. -
6. Re: Static variable in servlet gets shared between 2 applica
sada1977 May 22, 2009 1:23 AM (in response to sada1977)I am using JBoss 4.0.4GA not JBoss5
Thanks, -
7. Re: Static variable in servlet gets shared between 2 applica
jaikiran May 22, 2009 1:47 AM (in response to sada1977)"sada1977" wrote:
I am using JBoss 4.0.4GA not JBoss5
Thanks,
Then, this is a wrong forum for this question :) This forum is for JBoss AS5 questions. Please create a new thread in the Installation & Deployment forum here http://www.jboss.org/index.html?module=bb&op=viewforum&f=61 and provide the details that we asked for. -
8. Re: Static variable in servlet gets shared between 2 applica
sada1977 May 22, 2009 1:47 AM (in response to sada1977)Stacktrace is like this,
java.lang.NoClassDefFoundError: java/lang/Object
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:517)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:517)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) -
9. Re: Static variable in servlet gets shared between 2 application
azoor Nov 10, 2016 1:57 AM (in response to sada1977)set true of following in ear-deployer.xml in deployment folder
<attribute name="Isolated">true</attribute>
<attribute name="CallByValue">true</attribute>
it should resolve your problem.