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

Deployment in JBoss

Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
Hi I have a difficulty in using JBoss, as this is the first time a m using JBoss.
Problem is am confused where to keep my war files in the JBoss installation folder, in case of Tomcat we place the WAR file in the webapps folder and make the context path in the server.xml .
How to do this with JBoss.
I am not using any IDE, Is JBoss used only with IDEs cant we use is like Tomcat without an IDE?


SCJP 1.5
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If it is just a war you are deploying, all you need to do is put in in the deploy folder for your server. e.g. %JBOSS_HOME%/server/%servername%/deploy.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
Thanks!! but how/where to set the port number and context-root?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Out the box, you will have a context that matches your war file name. e.g. myApp.war will have the context /myApp.

Ports are defined in the various JBoss configuration files. The Tomcat ports are defined in the tomcat service, so jbossweb-tomcat55.sar contains server.xml where these can be set.
Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
Ports are defined in the various JBoss configuration files. The Tomcat ports are defined in the tomcat service, so jbossweb-tomcat55.sar contains server.xml where these can be set.


But i dont find any jbossweb-tomcat55.sar file in my installation directory!
Can you please tell me where can i se the ports?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

For JBossAS 4.2.x, the server.xml file can be found in the server/xxx/jboss-web.deployer directory.

Please note that it always helps to state which version of JBossAS you are using - the configuration files tend to wander around and change names with each major release.


JBoss In Action
Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
Thanks Peter!! Am able to start my JBoss server now.

If it is just a war you are deploying, all you need to do is put in in the deploy folder for your server. e.g. %JBOSS_HOME%/server/%servername%/deploy.

Ive place my war file in the following location
C:\Program Files\JBoss\jboss-4.2.2.GA\server\default\deploy
But am not able to deploy it.... Suppose my war file is myApp.war then the the context root will be myApp is'nt it?
Do i need to make entry in any web.xml file?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10264
    
168

C:\Program Files\JBoss\jboss-4.2.2.GA\server\default\deploy


I would recommend that you move (just copy/paste) your JBoss installation to a different location which does not have a space in its path name. There have been many weird issues reported when JBoss or Java was installed in a folder having a space in its pathname.

But am not able to deploy it....


Do you see any errors? Can you post them here.

Suppose my war file is myApp.war then the the context root will be myApp is'nt it?


By default, yes.

Do i need to make entry in any web.xml file?


No.


[My Blog] [JavaRanch Journal]
Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
I would recommend that you move (just copy/paste) your JBoss installation to a different location which does not have a space in its path name. There have been many weird issues reported when JBoss or Java was installed in a folder having a space in its pathname.


Ive copied the JBoss installation to C:\ drive but the same problem persists!!
Ive copied the javamail.war file C:\jboss-4.2.2.GA\server\default\deploy
folder and accessing through http://localhost/javamail (no port number as ive changed the port number 8080 to 80)
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

We cannot help you if you do not post the errors you are seeing. Post at least the first 30 lines of the exception stack trace.
Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
If any exception occurs i could have confirmed that the server is detecting my WAR. That is what my problem its not detecting the WAR.

HTTP Status 404 - /javamail

--------------------------------------------------------------------------------

type Status report

message /javamail

description The requested resource (/javamail) is not available.


--------------------------------------------------------------------------------

JBossWeb/2.0.1.GA

This is the thing i get!!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10264
    
168

This message indicates that the application wasn't deployed at javamail context. Post the logs that you see on the console when you start and deploy your application.
Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99


This is the part of the error am getting in the logs..
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10264
    
168

The error stacktrace shows that your application has not been deployed. One of the errors is the "JVM_BIND Port Already in Use". Read this to understand how that can be fixed.

The other error is this:


Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref: MySession has no valid JNDI binding. Check the jboss-web/resource-ref.)


You probably have a resource-ref entry in the web.xml but dont have a corresponding entry in jboss-web.xml.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deployment in JBoss