[jboss-user] [JNDI/Naming/Network] - InitialContext error in JBoss 5.x.x
leeroy
do-not-reply at jboss.com
Thu Apr 2 05:38:06 EDT 2009
Hi,
I have a strange error when I try to use a DatatSource with JNDI in JBoss 5.0.0.GA, 5.0.1.GA or 5.1.0.Beta1 but not with JBoss 4.2.2
with JRE 1.6
...
| 11:29:19,223 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
| 11:29:19,317 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/MyDatasource' to JNDI name 'java:jdbc/MyDatasource'
| ...
| javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is
| java.lang.ClassCastException: org.jnp.interfaces.NamingContextFactory cannot be cast to javax.naming.spi.InitialContextFactory
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
| at javax.naming.InitialContext.init(InitialContext.java:226)
| at javax.naming.InitialContext.<init>(InitialContext.java:182)
| at com.MyPackage.MyClass.MyFunction(MyClass.java:xxx) and it's nearly with JDK 1.5
...
| 11:29:19,223 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
| 11:29:19,317 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/MyDatasource' to JNDI name 'java:jdbc/MyDatasource'
| ...
| javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is
| java.lang.ClassCastException: org.jnp.interfaces.NamingContextFactory
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
| at javax.naming.InitialContext.init(InitialContext.java:226)
| at javax.naming.InitialContext.<init>(InitialContext.java:182)
| at com.MyPackage.MyClass.MyFunction(MyClass.java:xxx)
In MyFunction, the error appear on Context initCtx = new InitialContext();
I use de default serveur and I have copyed then edited mssql-ds.xml in server\default\deploy
I have Windows XP SP3.
I don't understand what can be my mistake because the error seem be in JBoss source.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222942#4222942
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222942
More information about the jboss-user
mailing list