-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 
Author Message
 Post subject: Hibernate 3.1 and jdk1.3
PostPosted: Wed Dec 14, 2005 7:51 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
Hibernate version: 3.1

Hi all,

Simple question: can hibernate3.1 still be used in 1.3 jdk environments like Websphere 5.0?

I am trying to compile hibernate 3.1 (final) with jdk 1.3.1_09 (SUN) and see that there are 1.4 dependencies in the code (AbstractEntityPersister.java, line 3405, AssertionError). Furthermore some of the required libraries seem to be 1.4 dependent too:



Stack trace
D:\Data\java\hibernate-3.1\hibernate-3.1>build

D:\Data\java\hibernate-3.1\hibernate-3.1>java -cp "lib/ant-launcher-1.6.5.jar" org.apache.tools.ant.launch.Launcher -lib lib
Buildfile: build.xml
[taskdef] Could not load definitions from resource checkstyletask.properties. It could not be found.
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

splash:

init:
[echo] Build Hibernate-3.1 (2005-12-14 12:35:43)
[mkdir] Created dir: D:\Data\java\hibernate-3.1\hibernate-3.1\build\classes
[copy] Copying 2 files to D:\Data\java\hibernate-3.1\hibernate-3.1\build\classes
[echo] JDK version: 1.3

init.antlr:

antlr:
[mkdir] Created dir: D:\Data\java\hibernate-3.1\hibernate-3.1\build\gensrc\org\hibernate\hql\antlr
[antlrtask] ANTLR Parser Generator Version 2.7.6 (20051207) 1989-2005
[antlrtask] ANTLR Parser Generator Version 2.7.6 (20051207) 1989-2005
[antlrtask] ANTLR Parser Generator Version 2.7.6 (20051207) 1989-2005
[touch] Creating D:\Data\java\hibernate-3.1\hibernate-3.1\build\gensrc\org\hibernate\hql\antlr\.antlr_run

compile:
[javac] Compiling 921 source files to D:\Data\java\hibernate-3.1\hibernate-3.1\build\classes
[javac] D:\Data\java\hibernate-3.1\hibernate-3.1\src\org\hibernate\secure\JACCConfiguration.java:6: cannot access javax.security.jacc.EJBMethodPermission
[javac] bad class file: D:\Data\java\hibernate-3.1\hibernate-3.1\lib\jacc-1_0-fr.jar(javax/security/jacc/EJBMethodPermission.class)
[javac] class file has wrong version 48.0, should be 47.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] import javax.security.jacc.EJBMethodPermission;
[javac] ^
[javac] 1 error

BUILD FAILED
D:\Data\java\hibernate-3.1\hibernate-3.1\build.xml:216: Compile failed; see the compiler error output for details.

Total time: 11 seconds


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 7:57 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Yes, you will have to take care of dependencies. This is also mentioned on the "Compiling Hibernate" page you have missed.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 8:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I have removed the AssertionException and used the more proper MappingException.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 8:13 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
Ok. Thanks.

On the compiling page it is mentioned that jdk1.4 is required to compile hibernate3.x. I can use this jdk and set the target and source to 1.3. Is this the correct way?

Thanks
Jürg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 8:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 8:41 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
I have recompiled hibernate and used it in one of my EJBs. The funny thing is that I had to change org.hibernate.impl.CriteriaImpl the following way:

org.hibernate.impl.CriteriaImpl.java, line:56

from:
private ResultTransformer resultTransformer = Criteria.ROOT_ENTITY;

to:

private ResultTransformer resultTransformer = CriteriaSpecification.ROOT_ENTITY;

If I don't do so, I get the exception below. Even more strange, in my code I can refer to Criteria.ROOT_ENTITY in a normal way like ResultTransformer s = Criteria.ROOT_ENTITY; without getting this exception.

Do you have any ideas?
Thanks
Jürg


Stack Trace
[12/14/05 13:36:55:469 CET] 4f5942d0 ExceptionUtil E CNTR0020E: Non-application exception occurred while processing method "startup" on bean "BeanId(clms-architecture-ear#clms-architecture-ejb.jar#Startup, null)". Exception data: java.lang.NoSuchFieldError: org.hibernate.Criteria: field ROOT_ENTITY not found
at org.hibernate.impl.CriteriaImpl.<init>(CriteriaImpl.java:55)
at org.hibernate.impl.CriteriaImpl.<init>(CriteriaImpl.java:285)
at org.hibernate.impl.SessionImpl.createCriteria(SessionImpl.java:1437)
at com.swissre.clms.hibernate.SchemaPopulator.queryTransactions(SchemaPopulator.java:124)
at com.swissre.clms.hibernate.SchemaPopulator.initialize(SchemaPopulator.java:65)
at com.swissre.clms.hibernate.SessionFactories.initialize(SessionFactories.java:31)
at com.swissre.clms.ejb.startup.StartupBean.startup(StartupBean.java:35)
at com.swissre.clms.ejb.startup.EJSLocalStatelessStartup_e2b51c66.startup(EJSLocalStatelessStartup_e2b51c66.java:51)
at com.swissre.clms.web.startup.StartupServlet.init(StartupServlet.java:54)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:876)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1370)
at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:286)
at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:417)
at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:219)
at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:1030)
at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:417)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:808)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:351)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:578)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:270)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:248)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:134)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:543)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:418)
at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 9:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you proably need to recompile your h3 dependent code too since this final field apparently has changed.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 10:42 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
I have recompiled everything, and I do not get the error in my code, it is within the hibernate library itself.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 10:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
why can you compile it then ?

did jdk 1.3 possibly have a bug in fields handling ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 1:17 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
static final strings are copied in the client classes. This is expected.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 1:29 pm 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
It is a runtime problem not a compile time and the public final static fields are not strings, they are ResultTransformers. I did not have this problem with hibernate 3.0.5 (which I compiled myself too). I vagly remember having once a problem with the size of a class in jdk 1.3, I think there is a 64kb limit or so, but I don't believe this is the problem. It is probably the ibm jdk used by WSAD/WAS5 which is causing problems?

Thanks
Jürg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 2:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you didnt have the problem before because at that point the descriptor class did not exist....i think it could definitly be a ibmn jdk 1.3 problem.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 7:50 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
Just checked the 3.0.5 source. The CriteriaSpecification class did exist and declared the static final ResultTransformers. In CriteriaImpl.java the Criteria.ROOT_ENTITY is referenced the same way as in 3.1. So this can't be it.

Thanks
Jürg


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 30, 2005 9:43 am 
Newbie

Joined: Sun Feb 15, 2004 11:02 am
Posts: 1
I faced the same issue while attempting to upgrade an application running previously with Hibernate 3.0.5 on WebSphere 4. I had to change the classes CriteriaImpl and CriteriaQueryTranslator to call the static members of the CriteriaSpecification interface instead of the ones from Criteria. With theses changes the application runs fine.

I doubt IBM will fix WebSphere 4, if the Hibernate code is not changed that would be worth mentioning the loss of compatibility in the upgrade guide.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.