This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jboss 3.0 + JNDI problem  RSS feed

 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing the following piece of code within the Action Servlet. I am using Struts framework -> Stateless Session Bean (JBoss 3.0) ->
Castor JDO.
fCtx = new InitialContext();
writer = new Logger(System.out).setPrefix("overseer");
map = new Mapping(getClass().getClassLoader());
map.setLogWriter(writer);
map.loadMapping(getClass().getResource(MappingFile));
fJDO = new JDO();
fJDO.setLogWriter(writer);
fJDO.setConfiguration(getClass().getResource(DatabaseFile).toString());
fJDO.setDatabaseName("overseer");
System.out.println("Setting LogInterceptor");
fJDO.setLogInterceptor(new CastorLog4jProxy(fLogName));
System.out.println("Binding JDO");
fCtx.bind("java:/jdo/mydb","jdo/mydb");

Exception is thrown when it tries to bind ....
09:44:10,640 ERROR [STDERR] javax.naming.NameNotFoundException: jdo not bound
09:44:10,640 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
Server.java:495)
09:44:10,640 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
Server.java:503)
09:44:10,640 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingS
erver.java:509)
09:44:10,640 ERROR [STDERR] at org.jnp.server.NamingServer.bind(NamingServer
.java:90)
09:44:10,640 ERROR [STDERR] at org.jnp.interfaces.NamingContext.bind(NamingC
ontext.java:410)
09:44:10,640 ERROR [STDERR] at org.jnp.interfaces.NamingContext.bind(NamingC
ontext.java:381)
09:44:10,700 ERROR [STDERR] at javax.naming.InitialContext.bind(InitialConte
xt.java:358)
09:44:10,700 ERROR [STDERR] at com.softex.itesoverseer.server.servlet.struts
.CustomActionServlet.init(CustomActionServlet.java:55)
09:44:10,700 ERROR [STDERR] at javax.servlet.GenericServlet.init(GenericServ
let.java:258)
09:44:10,700 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load
Servlet(StandardWrapper.java:916)
09:44:10,700 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load
(StandardWrapper.java:808)
09:44:10,700 ERROR [STDERR] at org.apache.catalina.core.StandardContext.load
OnStartup(StandardContext.java:3266)
09:44:10,700 ERROR [STDERR] at org.apache.catalina.core.StandardContext.sta�
t(StandardContext.java:3395)
09:44:10,750 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChi
ld(ContainerBase.java:785)
09:44:10,750 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChil
d(StandardHost.java:454)
09:44:10,750 ERROR [STDERR] at org.jboss.web.catalina.EmbeddedCatalinaServic
eSX.createWebContext(EmbeddedCatalinaServiceSX.java:321)
09:44:10,750 ERROR [STDERR] at org.jboss.web.catalina.EmbeddedCatalinaServic
eSX.performDeploy(EmbeddedCatalinaServiceSX.java:238)
09:44:10,750 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(Abst
ractWebContainer.java:300)
09:44:10,750 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainD
eployer.java:678)
09:44:10,750 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
Deployer.java:513)
09:44:10,750 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
Deployer.java:481)
09:44:10,750 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
)
09:44:10,750 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
her.invoke(ReflectedMBeanDispatcher.java:284)
09:44:10,810 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
eanServerImpl.java:491)
09:44:10,810 ERROR [STDERR] at org.jboss.util.jmx.MBeanProxy.invoke(MBeanPro
xy.java:174)
09:44:10,810 ERROR [STDERR] at $Proxy4.deploy(Unknown Source)
09:44:10,810 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentSca
nner.deploy(URLDeploymentScanner.java:405)
09:44:10,810 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentSca
nner.scanDirectory(URLDeploymentScanner.java:586)
09:44:10,810 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentSca
nner.scan(URLDeploymentScanner.java:465)
09:44:10,810 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeployme
ntScanner.startService(AbstractDeploymentScanner.java:237)
09:44:10,810 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.start(Se
rviceMBeanSupport.java:162)
09:44:10,860 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
)
09:44:10,860 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
her.invoke(ReflectedMBeanDispatcher.java:284)
09:44:10,860 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
eanServerImpl.java:491)
09:44:10,860 ERROR [STDERR] at org.jboss.system.ServiceController$ServicePro
xy.invoke(ServiceController.java:894)
09:44:10,860 ERROR [STDERR] at $Proxy0.start(Unknown Source)
09:44:10,860 ERROR [STDERR] at org.jboss.system.ServiceController.start(Serv
iceController.java:340)
09:44:10,860 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
)
09:44:10,860 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispat�
her.invoke(ReflectedMBeanDispatcher.java:284)
09:44:10,860 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
eanServerImpl.java:491)
09:44:10,860 ERROR [STDERR] at org.jboss.util.jmx.MBeanProxy.invoke(MBeanPro
xy.java:174)
09:44:10,860 ERROR [STDERR] at $Proxy3.start(Unknown Source)
09:44:10,920 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(SARDep
loyer.java:243)
09:44:10,920 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainD
eployer.java:678)
09:44:10,920 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
Deployer.java:513)
09:44:10,920 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
Deployer.java:481)
09:44:10,920 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(Main
Deployer.java:465)
09:44:10,920 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
)
09:44:10,920 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
her.invoke(ReflectedMBeanDispatcher.java:284)
09:44:10,920 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
eanServerImpl.java:491)
09:44:10,920 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(Se
rverImpl.java:314)
09:44:10,970 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(Serv
erImpl.java:216)
09:44:10,970 ERROR [STDERR] at org.jboss.Main.boot(Main.java:142)
09:44:10,970 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:375)
09:44:10,970 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)

However, when I use jdo-service.xml file, it then says Name ALready Bound Exception. What am I doing wrong ? My XML files
(XDoclet generated) are ---
ejb-jar.xml (partly)
.
.
.
.
<session >
<description><![CDATA[The ClientManager Session Bean]]></description>
<display-name>Client Manager Session Bean</display-name>
<ejb-name>client/ClientManager</ejb-name>
<home>com.softex.itesoverseer.server.ejb.interfaces.ClientManagerHome</home>
<remote>com.softex.itesoverseer.server.ejb.interfaces.ClientManager</remote>
<ejb-class>com.softex.itesoverseer.server.ejb.session.ClientManagerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>jdo/mydb</res-ref-name>
<res-type>org.exolab.castor.jdo.JDO</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<res-ref-name>jdbc/Direct</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
.
.
.

jboss.xml (partly)
.
.
.
<resource-managers>
<resource-manager res-class="org.jboss.ejb.deployment.CastorJDOResource">
<res-name>jdo/mydb</res-name>
<res-jndi-name>java:/jdo/mydb</res-jndi-name>
</resource-manager>
</resource-managers>
.
.
.
Can anyone help ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!