Sunday 15 March 2015


1] Download Jboss.

Go to the JBoss download page at:
http://www.jboss.org/jbossas/downloads

For the "7.1.1.Final" version, locate the "AS Certified Java EE 6 Full Profile" and download the "ZIP" file. Unzip the file.


2] open cmd

go till path of bin folder-->C:\jboss-4.0.2\bin

Click to Zoom













3] Start the server
open cmd and type
run – c default

Note: default is instance name at location C:\jboss-4.0.2\server\default.

You can create your own instance. Just create a newfolder in same location/path and copy all the contents/folders present inside default folder.

I have my own instance : lombard
run – c lombard

Jboss is now started 

Click to Zoom















4] Export WAR/EAR file
Open Eclipse--> Right click your project-->select Export--> WAR file

Click to Zoom

Click to Zoom


































5] Deploy the WAR file
Goto C:\jboss-4.0.2\server\lombard\deploy
Paste the WAR file in this folder

6] Restart the Jboss server
Since we have added our project after starting the server, we need to stop and start the server again in order to take effect.

To stop the server
1) In command prompt press Ctrl + C 
2) It will askYes or No--> Type Y

To start  the server 
Type--> run – c lombard

Now you have successfully deployed application in server

Access your project by typing following url:
http://localhost:8080/ProjectName

Errors while starting Jboss:
1] Run is not recognized as internal or external command.
Solnsave the following as .bat file
          cd D:\jboss-4.0.4.GA\bin
          run – c default
                    OR
          Update your PATH variable
1)Go to My computer >> right click and select properties.
2)On the properties tab select Advanced system settings
3)Click enviroment variables
4)select path and click edit option of user variables
  add
  ";C:\Program Files\Java\jdk1.7.0_60\bin"
  at the end.
5)close the cmd and try again
Done.

2] Run is not recognized as internal or external command.
    Could not locate c/java/jdk/tools.jar
Soln : goto C:/jboss/bin-->right click ' run.bat ' and click edit.
           Now check (set proper path)
      1) set Java_Home = C:/......
      2) set Java =  C:/programfiles.....
                                     OR
   c:/Program Files/Java/jdk1.6.0_23/bin/run – c default        

How to delete temp files  

At times there are situations when changes made in code do not reflect in output. This can be due to temp files.

 
1] How to delete temp files in Jboss
Goto-->Jboss-->server-->instance(Default)-->Delete log, temp, work, data  folders.
Goto-->jboss-->bin-->Delete wdtemp folder.

When you start the Jboss these folders will be created again.


2] How to delete temp files in Tomcat
 1) Stop the Tomcat server.
 2) Delete log, temp, work folders in tomcat folder
 C:\ Apache Software Foundation\
 3) Start the Tomcat server. The work folder will be automatically created.


Jboss server post data configuration (how to increase post limit in jboss ):

If data sent from one page to another is too huge then you need to configure that in jboss.
Goto the following path
path--> C:\jboss-4.0.2\server\rahul\deploy\jbossweb-tomcat55.sar\server.xml
                    or
path--> C:\jboss-4.0.2\server\rahul\deploy\jbossweb.sar\server.xml

There is a <Connector> specified like this
<Connector protocol=”HTTP/1.1″ port=”8080″ ….>
Add an attribute “maxPostSize” to this if not already added. Specify its value as per the requirement.maxPostSize="10485760"  // 2 MB by default. Mentioned in Bytes

You can also increase maxHttpHeaderSize as follows

maxHttpHeaderSize="8192" // 8kb by default. Mentioned in Bytes

This documentation has more information.


Connection Pooling and connection url configuration
goto---> D:\rahul\Software\jboss-4.0.4.GA\server\default\deploy\hsqldb-ds.xml

Search for <connection-url>
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
Replace localDB with your databasename

Connection Pooling
Search for <min-pool-size> 
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>