You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by alex zaim <ic...@yahoo.com> on 2011/04/26 16:48:06 UTC
SEVERE: Exception starting filter
Hello. I'm trying to make a simple hibernate+struts2 setup, but i encounter an error when i start the server (Tomcat 7.0.8).
Apr 26, 2011 3:20:18 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.NoClassDefFoundError: org/hibernate/Session
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getConstructor(Class.java:1657)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:414)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:365)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:479)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4461)
at
org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5133)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5128)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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.ClassNotFoundException: org.hibernate.Session
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
... 27 more
Apr 26, 2011
3:20:18 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
Apr 26, 2011 3:20:18 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Translators] startup failed due to previous errors
Now
i know that this looks way to easy to spot. It's obvious that i am
missing a class. But the problem is that the class is right there where
it should be. I mean, Ant sees the class and gives no compilation errors, also my IDE (Eclipse) sees the class (from the build path), but when i start the server, it gives my that error.
The guys from struts mailing list say that the error is server specific, so i decided to report it here.
Another
interesting thing is that if i remove the jar (which contains the
specific class) from the project's build path, the server will launch
with no erros, but will fail when an action is triggered that uses that
class.
Re: SEVERE: Exception starting filter
Posted by chris derham <ch...@derham.me.uk>.
>
>
>> Yes, i do have such a jar file. And i extracted its contents and verified
>> that the class exists.
>> I have extracted war's contents and this is what i got in a folder names
>> Hibernate (as expected) http://dl.dropbox.com/u/13391208/Screenshot.png
>>
>> Can you please run the following command to list the contents of the war
> file under the WEB-INF/lib directory - the screenshot doesn't show the
> details required. Then post the output.
>
> jar -tf application.war WEB-INF/lib
>
>
>> I added the specific jar to server's installation directory and the
>> error doesn't appear anymore, but i change i get a lot more strange,
>> struts-specific errors like
>>
>
> If you do this, you will get different exceptions. You should remove the
> hibernate.jar from tomcat home's lib folder
>
> Chris
>
Re: SEVERE: Exception starting filter
Posted by alex zaim <ic...@yahoo.com>.
Yes, i do have such a jar file. And i extracted its contents and verified that the class exists.
I have extracted war's contents and this is what i got in a folder names Hibernate (as expected) http://dl.dropbox.com/u/13391208/Screenshot.png
I added the specific jar to server's installation directory and the error doesn't appear anymore, but i change i get a lot more strange, struts-specific errors like
WARNING: Error setting expression 'user.firstname' with value '[Ljava.lang.String;@155035a'
ognl.OgnlException: firstname [java.lang.IllegalArgumentException: argument type mismatch]
at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:103)
at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27)
but Struts worked before perfectly and i haven't made any changes to it since.
Anyhow, i do not wish to keep those hibernate libs in the server's lib dir. So i'm not going to keep them forever. I'd appreciate a more elegant solution for the error, if possible. Thank you!
--- On Tue, 4/26/11, chris derham <ch...@derham.me.uk> wrote:
From: chris derham <ch...@derham.me.uk>
Subject: Re: SEVERE: Exception starting filter
To: "Tomcat Users List" <us...@tomcat.apache.org>
Date: Tuesday, April 26, 2011, 11:03 AM
>
> Now
> i know that this looks way to easy to spot. It's obvious that i am
> missing a class. But the problem is that the class is right there where
> it should be. I mean, Ant sees the class and gives no compilation errors,
> also my IDE (Eclipse) sees the class (from the build path), but when i start
> the server, it gives my that error.
>
> order.hibernate.Session should reside in hibernate-x.y.z.jar - x.y.z vary
depending on the version you are using. Do you have such jar in your war
file? Can you reply with a list of the jar files in your war file?
Chris
Re: SEVERE: Exception starting filter
Posted by chris derham <ch...@derham.me.uk>.
>
> Now
> i know that this looks way to easy to spot. It's obvious that i am
> missing a class. But the problem is that the class is right there where
> it should be. I mean, Ant sees the class and gives no compilation errors,
> also my IDE (Eclipse) sees the class (from the build path), but when i start
> the server, it gives my that error.
>
> order.hibernate.Session should reside in hibernate-x.y.z.jar - x.y.z vary
depending on the version you are using. Do you have such jar in your war
file? Can you reply with a list of the jar files in your war file?
Chris