1

Till now i run war file in jboss-4.2.2.GA,windows7 in that i had deployed myproject.war and myproject- ds.xml in server/default/deploye then its working fine.

now i want migrate jboss-as-7.1.1.Final,windows7 in that i will deployee myproject.war.dodeploye and myproject-ds.xml file in standalone/deployments but its shows exception

 13:55:29,304 ERROR 

[org.jboss.as.server.deployment.scanner]
 (DeploymentScanner-t hreads - 1) {"JBAS014653: Composite operation
 failed and was rolled back. Steps that failed:" => {"Operation step-2"
 => {"JBAS014671: Failed services" => {"jbos s.deployment.unit.\"myproject-ds.xml\".PARSE" =>
 "org.jboss.msc.service.StartEx ception in service
 jboss.deployment.unit.\"myproject-ds.xml\".PARSE: Failed to process
 phase PARSE of deployment \"myproject-ds.xml\""}}}}
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
nag
  • 647
  • 6
  • 25
  • 43

4 Answers4

2

JBoss AS 7 uses a totally different way for deploying and configuring things. Look here for more info.

Basically, all configuration is now made via one file: standalone.xml which is located under /standalone/configuration and you put your war/EAR files under /standalone/deployments.

Also if you have a reference to an external jar, you need to add it as a module.

Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
Tomer
  • 17,787
  • 15
  • 78
  • 137
  • There is also a tool to migrate the -ds.xml files: https://docs.jboss.org/author/display/AS71/Developer+Guide#DeveloperGuide-IronJacamarDatasourceandResourceAdapterMigrationTool – Stefano Travelli Oct 11 '12 at 10:13
2

you need to create datasource in standalone.xml and create a global module

standalone.xml

<subsystem xmlns="urn:jboss:domain:datasources:1.1">
        <datasources>
        <datasource jndi-name="java:/jdbc/myCRMDatasource" pool-name="myCRMDatasource" enabled="true">
                <connection-url>jdbc:hsqldb:hsql://localhost/xdb</connection-url>
                <driver>hsqldb</driver>
                <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                <pool>
                    <prefill>true</prefill>
                </pool>
                <security>
                    <user-name>SA</user-name>
                </security>
            </datasource>
            <driver name="hsqldb" module="org.hsqldb">
                    <xa-datasource-class>org.hsqldb.jdbcDriver</xa-datasource-class>
                </driver>
       </datasources>
  </subsystem>

and create in JBOSS_HOME/modules/org/hsqldb/main/module.xml

<module xmlns="urn:jboss:module:1.1" name="org.hsqldb">
  <resources>
    <resource-root path="hsqldb.jar"/>
  </resources>

   <dependencies>
     <module name="javax.persistence.api"/>
     <module name="javax.transaction.api"/>
         <module name="javax.validation.api"/>
     <module name="org.hibernate"/>
  </dependencies>
</module>

and put the jar in JBOSS_HOME/modules/org/hsqldb/main/

Maddy
  • 923
  • 5
  • 8
  • thanx for Maddy i have one issue now i am using jboss seam2.1.2 in that we have to declar sampleDemoDatasourcein persistence.xml but when i run this formate in jboss 7 it dnt allow ,when i chaged and run it but its throw exception isService status report BAS014775: New missing/unsatisfied dependencies: service jboss.jdbc-driver.oracle (missing) dependents: [service jboss.data source.java:/sampleDemoDatasource] – nag Oct 11 '12 at 08:51
0

Glad it helped.

In order to add Oracle JDBC driver, you need to add Module in the JBoss.

What you need:

1.JBOSS_HOME/modules/oracle/jdbc/main/module.xml, with

<module xmlns="urn:jboss:module:1.0" name="oracle.jdbc">
  <resources>
    <resource-root path="ojdbc6.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>

2. JBOSS_HOME/modules/oracle/jdbc/main/ojdbc6.jar

Maddy
  • 923
  • 5
  • 8
  • ya i can added both module.xml and standalone.xml same thing as you mensined maddy – nag Oct 11 '12 at 09:55
  • can you please check it this link http://stackoverflow.com/questions/12836688/how-to-deployee-jboss-seam-2-1-2-in-jboss-7 – nag Oct 11 '12 at 09:56
0

I recommend to use Maven JBoss AS plugin - maven-jboss-as-plugin. You can also use the web console - it's at port 9990. http://localhost:9990.

First you need to have a user to access the Management API. That's done using AS/bin/add-user.sh

Use mvn jboss-as:add-resource to add a datasource. See this example.

Use mvn clean install jboss-as:deploy to deploy your application.

Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277