-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate3.2 in J2EE1.4 works but not in JavaEE6
PostPosted: Thu Jan 24, 2013 11:44 am 
Newbie

Joined: Thu Jan 24, 2013 11:37 am
Posts: 4
Hello,

I am migrating our application from websphere 7 to weblogic 12c. Our application was originally jdk6+j2ee1.4+hibernate3.2+websphere7. In order to move to weblogic 12c, I upgraded our application to jdk6+javaee6+hibernate3.2. This results in the following error:
Code:
01.Initial SessionFactory creation failed:Errors in named queries: TestOutcome.getCryptoTestDescriptions 
02.    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:365) 
03.    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)

I am concerned that javaee6 could have caused a hibernate error.

The Named query works well in J2EE1.4+Websphere7 for the same Hibernate version, although the query looked strange.

The query is
Code:
    <query name="TestOutcome.getCryptoTestDescriptions">
        select 'Crypto Test for ' ||
            rp.cardGroupSupportedTypes.cardGroup.name || ' ' ||
            rp.responseProfileType.longDesc || ' for ' ||
            rp.cardGroupSupportedTypes.cardType.name || ' cards'
            from ResponseProfile rp
        where rp.cryptoCheckTestOutcome = :OUTCOME_ID
    </query>


Note: I experimented upversioning to hibernate3.6. The same error was more verbose and it was that the named query alias in not recognisable. I can solve the named query, but there will not be an end to the subsequent error. Because we have to know the root cause of this error. I believe it has to do with versions.

Thanks for reading this post.


Top
 Profile  
 
 Post subject: Re: Hibernate3.2 in J2EE1.4 works but not in JavaEE6
PostPosted: Fri Jan 25, 2013 10:00 am 
Newbie

Joined: Thu Jan 24, 2013 11:37 am
Posts: 4
Hello,

With no answers, I assume the answer should be trivial.
I have a thought that the problem could be to do with confusion of dependency jars of Hibernate and those present in weblogic. Most of us would have used hibernate in weblogic. Did you do anything special to get this work?

Regards,
Raj


Top
 Profile  
 
 Post subject: Re: Hibernate3.2 in J2EE1.4 works but not in JavaEE6
PostPosted: Fri Jan 25, 2013 10:42 am 
Newbie

Joined: Thu Jan 24, 2013 11:37 am
Posts: 4
Hello,

Can anyone find if there is a syntax error in the query I have posted above.

If I update the hibernate version from 3.2.5.ga to 3.6.7.Final, an exception much verbose is exposed.

Code:
org.hibernate.QueryException: undefined alias: 'Crypto Test for ' [
        select 'Crypto Test for ' ||
            rp.cardGroupSupportedTypes.cardGroup.name || ' ' ||
            rp.responseProfileType.longDesc || ' for ' ||
            rp.cardGroupSupportedTypes.cardType.name || ' cards'
            from com.anitesolutions.trxe.configuration.ResponseProfile rp
        where rp.cryptoCheckTestOutcome = :OUTCOME_ID
    ]

This syntax of HQL is not familiar to me. But works fine in Websphere and j2ee 1.4. It gives the exception for Weblogic and javaee6. Strange.

Thanks


Top
 Profile  
 
 Post subject: Re: Hibernate3.2 in J2EE1.4 works but not in JavaEE6
PostPosted: Thu Jan 31, 2013 5:37 am 
Newbie

Joined: Thu Jan 24, 2013 11:37 am
Posts: 4
Hello,
I am not sure why there were no answers. I have avoided the problem and thought will share.
This query works well in jdk6+j2ee1.4+hibernate3.2+websphere but does not work with jdk6+javaee6+ hibernate3.2+weblogic. There are some classloading problems of hibernate in weblogic caused by a dependency antlr.jar. antlr is used by hibernate as the language recognizer in the hbm files. In spite of my efforts to solve the classloading, this strange query could not be executed. I don't know the reason. When I commented just this query, all were fine. I have decided to rewrite this complex query in simple terms.
Wish you all the best.
Raj


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.