I am having an issue setting up an external JNDI context in my local
filesystem. I have followed the instructions in chapter 3 of the JBoss 4
documentation. I am currently using JBoss 4.0.2.
My MBean definition looks like this:
| <mbean code="org.jboss.naming.ExternalContext"
name="jboss.jndi:service=ExternalContext,jndiName=external/fs/ctx">
| <attribute name="JndiName">external/fs/ctx</attribute>
| <attribute name="Properties">
| java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
| java.naming.provider.url=file:///jboss-4.0.2/ctx
| </attribute>
| <attribute name="InitialContext">javax.naming.InitialContext</attribute>
| </mbean>
As it stands, I am fairly sure that JBoss if finding the context appropriately.
The hierarchy of the JNDI context (in the jmx-console) looks like this:
+- external
| | +- fs
| | | +- ctx (proxy: $Proxy50 implements interface javax.naming.Context)
| | | | +- .bindings
| | | | +- DummyTopic
| | | | +- JBossPocTCF
| | | | +- JBossPocQCF
Notice that the ctx level is marked as a proxy.
Now... on my client side code, I do the following:
InitialContext iniCtx = new InitialContext();
| Context ctx = (Context) iniCtx.lookup("external/fs/ctx");
When I run this code, I get a ClassCastException. If I print out the type that
is being returned, I get a javax.naming.Reference object. Obviously, I cannot
lookup other references below this level if I am not getting a Context back
when i do this lookup.
I have seen other posts on the forum regarding similar situations, but I have
not encoutered a valid solution. I was hoping this would be easier, as I would
imagine it is fairly common to federate an external JNDI. Am I missing a
specific attribute or property in my MBean definition?
My client side code currently has these dependencies (among others):
jboss-common-client.jar
| jbossall-client.jar
| jnp-client.jar
| jboss-j2ee.jar
| jbosssx-client.jar
| jboss-transaction-client.jar
|
| How can I resolve the class type on my client side? Any pointers in the
right direction or any solutions would greatly be appreciated.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3880671#3880671
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3880671
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user