Issue with JNDI Namespace while migrating from jboss EAP 5.1 to 6.0.1
madhusudhanraju_26 Jun 19, 2013 7:53 AMFacing the datasource configuration issue while migrating from jboss EAP 5.1 to jBoss v6.0.1 GA.
Am using MS SQL Server 2005 version as a database and code written in v5.1 connects to the database in the following way:
- The Server_Name.prop property file is placed under the src/resources folder with the following information
Server_Name.prop:
database=java:Datasource
query=select * from table_name
min_dbconn=6
max_dbconn=25
dbuser=user_name
qryTimeOut=30
loglevel=DEBUG
password=pwd
- The above datasource is binded to JNDI name in the jboss-web.xml file under WEB-INF folder by using the depends tag as following;
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<replication-config>
<replication-trigger>SET</replication-trigger>
<replication-granularity>ATTRIBUTE</replication-granularity>
</replication-config>
<depends>jboss.jca:service=DataSourceBinding,name=Datasource</depends>
</jboss-web>
- In jboss-5.1, i deployed the mssql-ds.xml file with the jndi name as following
<jndi-name>Datasource</jndi-name>
- Since all configurations goes to standalone.xml file, in the datasource tag in have configured as following
<datasources>
<datasource jndi-name="java:/Datasource" pool-name="Datasource" enabled="true" use-java-context="true">
<connection-url>jdbc:sqlserver://Server_Name:Port_number;DatabaseName=Datasource</connection-url>
<driver>sqlserver</driver>
<security>
<user-name>x</user-name>
<password>y</password>
</security>
<datasource>
<datasources>
- Got to know that depends tag is no longer supported according to jboss-web_7_1.xsd. Can someone let me know whart is the replacement tag for this?
Am getting the following error:
16:38:35,710 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.subunit."app.ear"."appWeb.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."app.ear"."appWeb.war".PARSE: JBAS018733: Failed to process phase PARSE of subdeployment "appWeb.war" of deployment "app.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_41]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_41]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_41]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018014: Failed to parse XML descriptor "/D:/jboss-eap-6.0.1/standalone/deployments/app.ear/appWeb.war/WEB-INF/jboss-web.xml" at [8,2]
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:79)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[8,2]
Message: Unexpected element 'depends' encountered
at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:109)
at org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser.parse(JBossWebMetaDataParser.java:212)
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:71)
... 6 more
16:38:36,130 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "myjar.jar"
16:38:36,130 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "app.ear"
16:38:36,140 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.subunit."app.ear"."appWeb.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."app.ear"."appWeb.war".PARSE: JBAS018733: Failed to process phase PARSE of subdeployment "appWeb.war" of deployment "app.ear"
16:38:36,260 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
16:38:36,260 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
16:38:36,260 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.0.1.GA (AS 7.1.3.Final-redhat-4) started (with errors) in 23123ms - Started 163 of 247 services (2 services failed or missing dependencies, 81 services are passive or on-demand)
I am deploying an app.EAR file in the deployments folder where the it contains appWeb.war file and a myjar.jar file. Classes in the war file extends the classes in the jar file so i deployed the myjar.jar file directly to deployments folder.
Can someone please assist how can i modify my code so that i will be able to establish database connection?