[JBoss-user] [JCA/JBoss] - Re: ClassCastException retrieving DataSource on JNDI lookup

2004-07-13 Thread [EMAIL PROTECTED]
Moderated: HIJACK - start a new thread. My answer solves the stated problem.

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3841955#3841955

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3841955


---
This SF.Net email sponsored by Black Hat Briefings  Training.
Attend Black Hat Briefings  Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JCA/JBoss] - Re: ClassCastException retrieving DataSource on JNDI lookup

2004-06-16 Thread gouvea2
I need javax.sql.DataSource in my deployment in order to assembly a list of Value 
Objects
via JDBC instead of query the database through EJB-QL.

I also need certain degree of isolation because our deployment lives with legacy 
releases
of our application in the same container.

We never had problem in JBoss 3.0.3, but we have in JBoss 3.2.3.

I don't want any javax.* inside my EAR, neither does my system administrator because
of extra replicated megabytes of infrastruture stuff.

Don't you think would be better practice to share common infrastructure resources 
through 
ClassLoaders?


Thanks,
Eduardo Gouvea.


View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3839003#3839003

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3839003


---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JCA/JBoss] - Re: ClassCastException retrieving DataSource on JNDI lookup

2004-06-03 Thread gouvea
We use jboss-app.xml in META-INF folder of EAR file to
restrict classes to be loaded only by the application's 
ClassLoader.

Like this:

jboss-app
  | loader-repositorymypackage:loader=myapp.ear/loader-repository
  | /jboss-app

It works fine in Jboss 3.0.x. But we had a ClassCastException problem on 
looking up the configured DataSource from JNDI context.

We had the problem when trying to cast the reference within a Delegate's method
placed in a JAR on WEB-INF/lib directory of the web application and also
within a Session Bean in the EJB container.


After a few debugging tests, we came up with the fact that ClassLoaders
for javax.sql.DataSource.class were different for the reference coming from 
JNDI context and that which was collocated to the Delegate or Session Bean. 


Debugging output looked like this:

javax.sql.DataSource.class.getClassLoader(): 
[EMAIL PROTECTED] 
url=file:/C:/jboss3.2.3/server/default/tmp/deploy/tmp40857myapp.ear 
,addedOrder=37}

ds.getClass().getClassLoader(): 
[EMAIL PROTECTED] 

url=file:/C:/jboss3.2.3/server/default/tmp/deploy/tmp40781jboss-service.xml 
,addedOrder=2}


We deleted loader-repository element from META-INF/jboss-app.xml so the lookup and 
casting both
succeeded.

But we need the jboss-app.xml configuration in order to isolate legacy applications
we developed and deployed on the same app server with different versions of the
same class.


Is there anything we can do? Is it a bug or an expected behaviour of JBoss ClassLoader
architeture?


Thanks,
Eduardo Gouvea.

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3837410#3837410

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3837410


---
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JCA/JBoss] - Re: ClassCastException retrieving DataSource on JNDI lookup

2004-06-03 Thread [EMAIL PROTECTED]
It is expected, why do you need javax.sql in your deployment?

If you really do want isolation, you would have to copy the entire infrastructure
(jboss rar, jdbc driver) into the ear, otherwise you will get all sorts of class 
confusion.

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3837411#3837411

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3837411


---
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JCA/JBoss] - Re: ClassCastException retrieving DataSource on JNDI lookup

2004-04-23 Thread [EMAIL PROTECTED]
Run this small program

  | System.out.println(DataSource from  + DataSource.class.getClassLoader());
  | 
  | Class[] interfaces = WrapperDataSource.class.getInterfaces();
  | for (int i = 0; i  interfaces.length; ++i)
  |System.out.println(interfaces +  from  + interfaces.getClassLoader();
  | 

then remove the duplicate class(es).

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3832121#3832121

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3832121


---
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JCA/JBoss] - Re: ClassCastException retrieving DataSource on JNDI lookup

2004-04-23 Thread natebowler
OK. I only had it in 2 other places..:)

Thanks,

Nate

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=3832170#3832170

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3832170


---
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user