-
1. Re: ClassCastException accessing a DataSource
jaikiran Apr 18, 2008 4:53 AM (in response to riflevolunteer)Please post the entire exception stacktrace. Also, let us know the Java vendor/version that you are using on the client as well as the server. Finally, post the contents of the jndi tree as mentioned at http://wiki.jboss.org/wiki/DisplayTheJDNITreeWithTheJMXConsole
While posting the logs or code or xml content, remember to wrap it in a code block using the Code button in the message editor window and please hit the Preview button to make sure your post is correctly formatted -
2. Re: ClassCastException accessing a DataSource
riflevolunteer Apr 21, 2008 3:41 AM (in response to riflevolunteer)Hi
Thanks for the reply, that is the entire exception stacktrace. The version of java for both the server and client is Sun 1.5.0_15.
The JNDI tree I cannot find I can find the JMXConsole but nowhere is there anything called jndiview as described in the wiki. Please advise.
Thanks -
3. Re: ClassCastException accessing a DataSource
jaikiran Apr 21, 2008 3:54 AM (in response to riflevolunteer)"riflevolunteer" wrote:
Hi
The JNDI tree I cannot find I can find the JMXConsole but nowhere is there anything called jndiview as described in the wiki. Please advise.
Did you install JBoss, using the JEMS installer? Just this past week, we had a discussion about this where it turned out that JEMS installer does not configure the JNDIView ( http://www.jboss.com/index.html?module=bb&op=viewtopic&t=133889).
For JNDIView to be available, you will have to download the JBoss zip archive. Unzip it to some location (which does not contain a space in its folder name Ex: D:\JBoss), set JAVA_HOME and start the server.
My intention of asking you to post the contents of the jndi tree was to see what the datasource is being bound to. If re-installing JBoss, is not an option for you, can you try out the following piece of code from the client and post the output?
public static void main(String[] args) { try { InitialContext ic; Object ds = ic.lookup("MySqlDS"); Class[] interfaces = ds.getClass().getInterfaces(); System.out.println("Implemented interfaces: "); for (int i = 0; i < interfaces.length; i++) { System.out.println("*** " + interfaces); } }...... //other stuff }
Let's see if this output gives us some clue. -
4. Re: ClassCastException accessing a DataSource
riflevolunteer Apr 21, 2008 8:30 AM (in response to riflevolunteer)Hi
Thanks for your quick reply. Have just run your code and get the followingImplemented interfaces: *** [Ljava.lang.Class;@110b053
And yes I did run the Jems installer, will reinstall another time for sure.
Thanks Again -
5. Re: ClassCastException accessing a DataSource
riflevolunteer Apr 22, 2008 2:59 PM (in response to riflevolunteer)Hi Again
Have you any idea what could be wrong with my set up.
Thanks -
6. Re: ClassCastException accessing a DataSource
jaikiran Apr 23, 2008 5:32 AM (in response to riflevolunteer)"riflevolunteer" wrote:
Hi Again
Have you any idea what could be wrong with my set up.
Thanks
Sorry, i don't exactly know what the problem is, based on what has been posted so far. Can you try looking up the datasource from a servlet and see if that works? Also, is re-installing the JBoss server (using the binary instead of JEMS installer) an option for you? That will atleast show us the JNDIView contents.