Brice Laurencin

Greenhorn
+ Follow
since Feb 23, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brice Laurencin

Ok, I found a way out off this mess.

Our applications are deployed to prod with a 'Parent_LAST' ClassLoader configuration. I moved the JCA connector from the server's root to the EAR.
So now libraries are loaded correctly. It still stinks, but it works.

sweet :-/
thanks a lot, I wasn't aware of all the subtilities of web servers' class loading issues. The article was really helpful.
[ January 03, 2007: Message edited by: Brice Laurencin ]
A contractor delivered us a JCA adaptor, configured against some environment variables. I hate that, so we refactored a bit of code to use a prety XML file instead. The file is parsed using Digester. So Digester and all its requiered libraries are packed in the connector's RAR file.

Problem: on our WAS, other applications are using Digester (because they are Struts based), but in an other version. And Bang! the version in the RAR is used, and not the one packed in the EAR of the application. Therefore: exceptions (NoClassDefFound). The libraries are availiable as they if were in the lib/ext folder.

I'm guessing that configuring the application's ClassPath in 'Parent Last', it might work, but I do not want to configure each and every app that way, there are too many.

I tried to find if this is a recommendation in the J2EE spec, but I couldn't find what I want.

Does anybody have a slightest idea ?
Sorry to punch that topic back up so long after the last message, but I have kind of the same concern, and google was not really helping me...

Here is the context : I need a thread to scan a folder for new files, and then do things with them. As that scanner will be in a J2EE context, I was thinking of using a singleton to access that thread (and so having only one instance of the thread), to be able to start and stop it. I tried to start the Thread at server startup, using really small a struts plugin.

Here is my thread :

When I try to check thread health ( FolderScan.getInstance().isAlive() ), it works, but starting is kills my J2EE server. I tested JOnAS 4.6.6 and WAS6.

Thanks for any help !!
[ May 09, 2006: Message edited by: Brice Laurencin ]
Ok....

From the hibernate forum, I had a "it is a JDBC driver problem", and I said "no, it's not".

But in fact, it is....

With DB2v7,there are two version of the driver: JDBCv1, and v2. The v2 works like a charm :-/

does anybody has a cliff I could jump off ?
Mapping documents:

<hibernate-mapping>
<class name="cat.eur.fq.bnrrnb.model.Transaction" table="ZT_REC_INTERPLNT" schema="AN0FQ002">

<id name="ident" column="IDENT" type="java.lang.Long" length="11" />

<property (...) />

<filter name="instance" condition=" RCV_FAC_CD = :instanceFacility "/>

</class>

<filter-def name="instance">
<filter-param name="instanceFacility" type="string"/>
</filter-def>

</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():


.enableFilter("instance")
.setParameter("instanceFacility", "37")



Full stack trace of any exception that occurs:

[2005-09-26 14:00:33.022] -1 INFORMATIONAL DBStatement logDebugSQLString select distinct abstractmo0_.SHP_FAC_CD as col_0_0_ from AN0FQ002.ZT_REC_INTERPLNT abstractmo0_ where abstractmo0_.RCV_FAC_CD = '37' and abstractmo0_.MVNT='RCVG'
[2005-09-26 14:00:33.173] 0 FATAL org.hibernate.util.JDBCExceptionReporter java [IBM][JDBC Driver] CLI0612E Invalid parameter number. SQLSTATE=S1093
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1502)
at org.hibernate.loader.Loader.list(Loader.java:1482)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:365)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:268)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:782)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at cat.eur.fq.bnrrnb.dao.BnrRnbDAOImp.getFacilitiesForMovement(BnrRnbDAOImp.java:63)
at cat.eur.fq.bnrrnb.tests.dao.BnrRnbDAOImpTest.testGetFacilitiesForMovement(BnrRnbDAOImpTest.java:27)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:154)
at cat.euro.test.TUFHbmAbstractTestCase.runTest(TUFHbmAbstractTestCase.java:127)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0612E Invalid parameter number. SQLSTATE=S1093
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throwParamIndexError(SQLExceptionGenerator.java:626)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.setString(DB2PreparedStatement.java:2748)
at cat.cis.tuf.server.connector.jdbc.v1.JDBCv1DBStatement.setString(JDBCv1DBStatement.java:1113)
at org.hibernate.type.StringType.set(StringType.java:24)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44)
at org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader.java:232)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1101)
at org.hibernate.loader.Loader.doQuery(Loader.java:362)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203)
at org.hibernate.loader.Loader.doList(Loader.java:1499)
... 20 more


Name and version of the database you are using:
DB2V7

The generated SQL (show_sql=true):
select distinct abstractmo0_.SHP_FAC_CD as col_0_0_ from AN0FQ002.ZT_REC_INTERPLNT abstractmo0_ where abstractmo0_.RCV_FAC_CD = '37' and abstractmo0_.MVNT='RCVG'



SO! after all taht, here is my problem:

I try to use the filter at session creation. So I set it.
But, with it set, I get a JDBC error althought the sql statement is ok.
I get a "[IBM][JDBC Driver] CLI0612E Invalid parameter number. SQLSTATE=S1093"...

If I disable the filter, it works fine.

Thanks in advance for any help.

Originally posted by pascal betz:
my 2 cents:

NOTE: Does not work with collections (at least in Hibernate 2, i do not know if Hibernate 3 can handle them).



You can use [url=http://"http://www.hibernate.org/hib_docs/api/net/sf/hibernate/Criteria.html"]setFetchMode()[/url] , eager fetching in HQL, outer join settings to control the way collections are loaded.



pascal



I have a few little questions about the "select new" : How does it work ?!
does the object we want to instanciate have to be declared in an hbm.xml file ?
is it possible to do a "select distinct new ... " ?
Help... I don't find any info, even in Hibernate in Action...

Brice.
thank you very very very much !!

At last, I understand something about SWT thank to you !

thank you, again !
19 years ago