Migrate Web Appl to JBOSS 7
Veröffentlicht: 27.03.2012 um 07:46 von MQue
- In general: JBoss 7 has a new kernel which is inspired by OSGi, therefore module/bundle based
- If ClassNotFoundException occures:
put all external JARs into /WEB-INF/lib of your dynamic web project (JBoss AS 7 has it's own logging system but e.g. if you use log4j.jar but it into /WEB-INF/lib) or create a module in JBOSS_HOME/modules, in case of log4j: JBOSS_HOME/modules/org/apache/log4j/main, copy log4j.jar inside main and create a XML file like at the next point at Step 3 (module.xml)
or define dependencies (similar to OSGi): https://docs.jboss.org/author/displa...DefFoundErrors - JBoss 7 doesn't work with xxx-ds.xml configuration files out of the box, Therefore in order to access dataSource over JNDI:
- create the directory structure: JBOSS_HOME/modules/com/oracle/ojdbc6/main
- put the JAR ojdbc6.jar into the main directory and further put this
- module.xml- file also into the main directory.
- add driver to drivers in standalone.xml (driver.xml)
- Afterwards go to your JBoss Administration Console (e.g. http://localhost:9990/console/App.ht...er/datasources) and create a new Datasource
- At Step 2 of the datasource- creation choose the driver- module added above (number 3)
- Now it is possible in the application to get the created DataSource e.g. with: InitialContext#lookup("dataSourceName");
- If you use class com.sun.rowset.CachedRowSetImpl in your application you will probably get a NoClassDefFoundError, therefore add following lines at the module.xml of JBOSS_HOME/modules/sun/jdk/main
- <path name="com/sun/rowset"/>
- <path name="com/sun/rowset/internal"/>
- <path name="com/sun/rowset/providers"/>
- System properties should/must be set in the Administration Console under "General Configuration -> System Properties", if you set it directly in standalone.xml (or domain.xml) it will be overwritten. Take care that there is no separate xxx.properties file - system properties in JBoss 7 are set in the standalone.xml- file at JBOSS_HOME/standalone/configuration
- If you use common-codec.1.x.jar in your application, add this JAR into /WEB-INF/lib, there is a modul JBOSS_HOME/modules/org/apache/commons/codec but no binary is available
Kommentare 0







