[jboss-jira] [JBoss JIRA] Commented: (AS7-836) non JPA (native Hibernate) app using hibernate doesn't cause org.hibernate classes to be loaded

jaikiran pai (JIRA) jira-events at lists.jboss.org
Thu May 19 11:38:01 EDT 2011


    [ https://issues.jboss.org/browse/AS7-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603231#comment-12603231 ] 

jaikiran pai commented on AS7-836:
----------------------------------

Darrin, 

Me, Scott and David had a discussion about this on IRC. Basically all the jars in the .war/WEB-INF/lib of the deployment should be available in the classpath of the application. Are you hibernate jars located in that place? If yes, and if you still see this exception then it looks like a bug. 

(IRC discussion for reference):

{quote}

(08:52:00  IST) Jaikiran: dmlloyd: got a minute for a module CL and web app deployment related discussion?
(08:52:03  IST) bstansberry: this is related to similar requests people have for deploying datasources, deploying JMX resources
(08:52:36  IST) dmlloyd: Jaikiran: sure
(08:52:45  IST) dmlloyd: I'll be around for about another hour
(08:52:49  IST) dmlloyd: then I"ll be gone for a bit
(08:52:55  IST) alexsmirnov [~alexsmirn at 206-169-37-210.static.twtelecom.net] entered the room.
(08:52:58  IST) Jaikiran: dmlloyd: me and smarlow were discussing about AS7-836
(08:53:00  IST) jbossbot: jira [AS7-836] non JPA (native Hibernate) app using hibernate doesn't cause org.hibernate classes to be loaded [Open (Unresolved) Bug, Major, Scott Marlow] https://issues.jboss.org/browse/AS7-836
(08:53:24  IST) Jaikiran: typically, in a EE deployment (for example .war) all the jars in the .war/WEB-INF/lib are expected to be in the CP of the application
(08:53:34  IST) Jaikiran: and users can use those classes in their code
(08:54:11  IST) Jaikiran: but it looks like in the current way, they will have to explicitly add a Dependencies to those libraries (and also first create them as modules)?
(08:54:44  IST) Jaikiran: so for example, someone has a blah.jar in .war/WEB-INF/lib and has a Foo.class in it
(08:55:06  IST) Jaikiran: if they want to access that Foo.class from some servlet in the .war, they will have to create blah as a module and a dep on that?
(08:59:46  IST) dmlloyd: Jaikiran: stuartdouglas is working on AS7-388
(08:59:47  IST) jbossbot: jira [AS7-388] Detect, filter, and act upon system APIs found in deployments [Open (Unresolved) Task, Major, Stuart Douglas] https://issues.jboss.org/browse/AS7-388
(09:00:06  IST) dmlloyd: the idea is if they have hibernate in their deployment it'd automatically filter it and add a dep on org.hibernate
(09:00:12  IST) dmlloyd: unless they specify otherwise
(09:00:38  IST) Jaikiran: yeah, that would take care of well known libraries
(09:00:50  IST) Jaikiran: but what about app specific libraries which belong to the app themselves
(09:00:59  IST) Jaikiran: or some not so well known libraries
(09:01:16  IST) Jaikiran: wouldn't it violate the spec that those classes won't be found in the app CP?
(09:01:37  IST) Jaikiran: (unless they explicitly add the Dependencies in MANIFEST.MF and yeah create a module out of it)
(09:02:39  IST) dmlloyd: oh, those should be found
(09:02:55  IST) dmlloyd: WEB-INF/lib should be on there
(09:02:57  IST) dmlloyd: that did work at one time
(09:03:03  IST) dmlloyd: so if it quit working it's a regression
{quote}


> non JPA (native Hibernate) app using hibernate doesn't cause org.hibernate classes to be loaded
> -----------------------------------------------------------------------------------------------
>
>                 Key: AS7-836
>                 URL: https://issues.jboss.org/browse/AS7-836
>             Project: Application Server 7
>          Issue Type: Bug
>    Affects Versions: 7.0.0.Beta3
>            Reporter: Darrin Mison
>            Assignee: Scott Marlow
>
> I'm using hibernate but not not using @PersistenceContext or @PersistenceUnit and so my deployment is not being marked as a JPA deployment, and therefore the hibernate jars are not available.
> I've worked around it by adding a Dependencies: org.hibernate to my manifest.mf file
> {quote}
> 16:46:34,843 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "TopicSearch.war"
> 16:46:36,090 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/TopicSearch]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.RuntimeException: Failed to construct public com.redhat.ecs.topic.webservice.MyRESTApplication()
> 	at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:144) [resteasy-jaxrs-2.1.0.GA.jar:]
> 	at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:249) [resteasy-jaxrs-2.1.0.GA.jar:]
> 	at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:192) [resteasy-jaxrs-2.1.0.GA.jar:]
> 	at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28) [resteasy-jaxrs-2.1.0.GA.jar:]
> 	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.0.Beta11.jar:7.0.0.Beta3]
> 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3817) [jbossweb-7.0.0.Beta11.jar:7.0.0.Beta3]
> 	at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:61) [jboss-as-web-7.0.0.Beta3.jar:7.0.0.Beta3]
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1675)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
> 	at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]
> Caused by: java.lang.NoClassDefFoundError: org/hibernate/Session
> 	at com.redhat.ecs.topic.webservice.MyRESTApplication.<init>(MyRESTApplication.java:12) [classes:]
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_24]
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_24]
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_24]
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_24]
> 	at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:132) [resteasy-jaxrs-2.1.0.GA.jar:]
> 	... 10 more
> Caused by: java.lang.ClassNotFoundException: org.hibernate.Session from [Module "deployment.TopicSearch.war:main" from Service Module Loader]
> 	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:184) [:1.0.0.Beta17]
> 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:357) [:1.0.0.Beta17]
> 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:329) [:1.0.0.Beta17]
> 	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:306) [:1.0.0.Beta17]
> 	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:100) [:1.0.0.Beta17]
> 	... 16 more
> 16:46:36,100 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
> 16:46:36,100 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/TopicSearch] startup failed due to previous errors
> 16:46:36,120 INFO  [org.jboss.web] (MSC service thread 1-2) registering web context: /TopicSearch
> {quote}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list