[JNDI and Naming] - What is the exact correct way to make JBoss datasource JNDI
by mattjiang
Hi All,
I saw many people got confused of configuring DataSource JNDI on JBoss, I saw two major example, but for me only one works.
I use Spring 2.5.6, Jboss 4.2.2GA, Sun JDK 1.5
Example 1:(works)
mysql-ds.xml
<?xml version="1.0"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>jdbc/esoafds</jndi-name>
| <connection-url>jdbc:mysql://192.168.1.2:3306/jbranch?useUnicode=true&characterEncoding=UTF8&autoReconnect=true</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>root</user-name>
| <password></password>
| <min-pool-size>3</min-pool-size>
| <max-pool-size>100</max-pool-size>
| <use-java-context>false</use-java-context>
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
Spring applicationContext.xml
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/esoafds" resource-ref="false" />
Above example, could someone advises me why I have to add <use-java-context>false</use-java-context> to make this config works?
Example 2:(It should work, but NOT)
mysql-ds.xml
<?xml version="1.0"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>jdbc/esoafds</jndi-name>
| <connection-url>jdbc:mysql://192.168.1.2:3306/jbranch?useUnicode=true&characterEncoding=UTF8&autoReconnect=true</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>root</user-name>
| <password></password>
| <min-pool-size>3</min-pool-size>
| <max-pool-size>100</max-pool-size>
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
Please be aware that no "use-java-context" tag needed.
web.xml
<resource-ref>
| <description>Esoaf DataSource</description>
| <res-ref-name>jdbc/esoafds</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| </resource-ref>
jboss-web.xml
<jboss-web>
|
| <resource-ref>
| <res-ref-name>jdbc/esoafds</res-ref-name>
| <jndi-name>java:jdbc/esoafds</jndi-name>
| </resource-ref>
|
| </jboss-web>
Spring applicationContext.xml
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
| <property name="jndiName" value="java:jdbc/esoafds"/>
| </bean>
Should I add "java:" before "jdbc/esoafds" or not?
The second example can find correct JNDI name from JBoss, but it returns null from JNDI look up.
Can any body give me a hint what's the concept difference between the two approaches? Why my example 1 works, but exmple 2 return null look up.
Thanks a lot.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258569#4258569
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258569
16 years, 6 months
[Installation, Configuration & Deployment] - Urgent: org.jboss.xb.binding.JBossXBException: Failed to par
by JithuK
Hi All,
I am trying to migrate an application from jBoss 4 to jBoss 5.
I am getting below error , while deploying a war file.
Can someone let me identify what exactly has gone wrong here ..
Any help is highly appreciated.
15:05:18,080 ERROR [AbstractKernelController] Error installing to Parse: name=vfszip:/home/clarify/appserver/jboss-5.1.0.GA/s
erver/tBroker/deploy/ibmpm.war/ state=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/home/clarify/appserver/jboss-5.1.0.GA/
server/tBroker/deploy/impm.war/
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerW
ithOutput.java:362)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerW
ithOutput.java:322)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerW
ithOutput.java:294)
at org.jboss.deployment.JBossEjbParsingDeployer.createMetaData(JBossEjbParsingDeployer.java:95)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutpu
t.java:234)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.ja
va:306)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: container-configuration cannot appear in this posit
ion. Expected content of jboss is unordered_sequence: jmx-name? enforce-ejb-restrictions? unauthenticated-principal? resource
-managers? exception-on-rollback? enterprise-beans* container-configurations? missing-method-permissions-excluded-mode? invok
er-proxy-bindings? loader-repository? security-domain? webservices? assembly-descriptor?
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:189)
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:256)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerW
ithOutput.java:348)
... 34 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: container-configuration cannot appear in this position. Expected con
tent of jboss is unordered_sequence: jmx-name? enforce-ejb-restrictions? unauthenticated-principal? resource-managers? except
ion-on-rollback? enterprise-beans* container-configurations? missing-method-permissions-excluded-mode? invoker-proxy-bindings
? loader-repository? security-domain? webservices? assembly-descriptor?
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:449)
at org
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258560#4258560
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258560
16 years, 6 months