File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Application Container in JBOSS4.3

Gurmat Bhatia

Joined: Mar 22, 2011
Posts: 2
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 \
-Dejb.home.factory.impl=com.ingrammicro.ejb.EJBHomeFactoryImpl_Default \
-Dserver.root=$WAS_HOME \
-Djava.naming.factory.initial=$NAMING_FACTORY \
-Dlog4j.configuration=file:///app/WebSphere/servers/c2lint/EagnLoggerClient.xml \
-classpath $WAS_CLASSPATH \ $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

Joined: May 14, 2008
Posts: 5852

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

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.

Peter Johnson

Joined: May 14, 2008
Posts: 5852

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:
subject: Application Container in JBOSS4.3
It's not a secret anymore!