my dog learned polymorphism*
The moose likes JBoss/WildFly and the fly likes Application Container in JBOSS4.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Application Container in JBOSS4.3" Watch "Application Container in JBOSS4.3" New topic
Author

Application Container in JBOSS4.3

Gurmat Bhatia
Greenhorn

Joined: Mar 22, 2011
Posts: 2
Hi,
I am new to JBOSS...
We are migrating our application from WAS4 to JBOSS4.3.
We have some scripts in WAS4, that we need to migrate to JBOSS
Those scripts are using application launcher to launch the JAR file present in a ear.(The code was developed long back and we are not actually sure about the code details...we are analyzing the code to get the details)
I have search lot of places and it looks like in JBOSS4.3, we don't have application client launcher.

Attaching a sample of script that we have in WAS4 (using websphere client launcher), not sure how to migrate it in JBOSS 4.3

$JAVA_HOME/bin/java \
$WAS_JAVAOPTS \
$CLIENTSAS \
-Dejb.home.factory.impl=com.ingrammicro.ejb.EJBHomeFactoryImpl_Default \
-Dserver.root=$WAS_HOME \
-Dws.ext.dirs=$WAS_EXT_DIRS \
-Dcom.ibm.CORBA.BootstrapHost=$COMPUTERNAME \
-Djava.naming.factory.initial=$NAMING_FACTORY \
-Dlog4j.configuration=file:///app/WebSphere/servers/c2lint/EagnLoggerClient.xml \
-classpath $WAS_CLASSPATH com.ibm.ws.bootstrap.WSLauncher \
com.ibm.websphere.client.applicationclient.launchClient $EARFILE -CCclasspath=$CLASSPATH -CCBootstrapHost=$COMPUTERNAME -CCBootstrapPort=4000 -CCverbose=true -CCjar=VendorUpload.jar

Here VendorUpload.jar is present in the ear file mentioned as $EARFILE


Thanks in advance
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Gurmat, welcome to Java Ranch!

I am not a WAS expert (it's been ages since I have used it), so I really don't know what "application launcher" does. But let me tell you how to run apps in JBoss AS.

First, start JBoss AS but running the run script in the bin directory.
Second, copy your application's archive files (EAR, WAR, JAR, etc.) to the server/default/deploy directory.

That is all there is to it.

The first chapter of JBoss in Action (see link below) is free and should help you get started. While the book is specific to 5.x, most of the information is relevant in 4.3.


JBoss In Action
Gurmat Bhatia
Greenhorn

Joined: Mar 22, 2011
Posts: 2
Thanks Peter for your response.
I placed by ear file (abc.ear) in the deploy directory the server/default/deploy

my script in WAS4 is launching the application client (container) and executing the jar file which is present in that ear (abc.ear)

Now I am not sure how to achieve it in JBOSS, if I direct execute jar,
$JAVA_HOME/bin/java -jar $APP_HOME/deploy/VendorUpload.jar

As the ear file is not launched, it won't recognized the methods that are present in other jars in the same ear and it is giving below error:

Exception in thread "main" java.lang.NoClassDefFoundError:

I am not sure how to launch the whole application and execute one of the jar present in that application.

Thanks,
Gurmat
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

You are launching the client? I assume that your client is attempting to access EJBs deployed to JBoss AS. If that is the case, then you need to include the JAR that contains the client interfaces for your EJBs within your client's classpath. If you haven't created a separate interface JAR for your EJBs, then you might be able to get away with simply including the EJB JAR file in your client's classpath.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Application Container in JBOSS4.3