Showing posts with label JDK. Show all posts
Showing posts with label JDK. Show all posts

Thursday, October 27, 2011

Tomcat and JBoss co-existence


Introduction

The purpose of this note is to make Tomcat and JBoss co-existence in one system.  If Tomcat has been installed in your system and you wanted to install JBoss in the same system, you may face some problems due to conflict of resources such as ports.  This note should help you solve them.

Scenario: -

Let’s say, you have installed JDK 1.4/1.5 and Tomcat 5.0/5.5 (on Port No. 8085) to deploy some applications.  Now, you want to install JBoss 3.2.6 (on Port No. 8080) to deploy some other EJB application.  You follow the normal procedure to install JBoss.  After installing, during, you may face the following error:

11:59:03,017 ERROR [Http11Protocol] Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:264)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:137)
.
.
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:407)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:311)
at org.jboss.Main.boot(Main.java:145)
at org.jboss.Main$1.run(Main.java:399)
at java.lang.Thread.run(Thread.java:534)

Solution: -

The search suggested me to change the webserver Port Number from 8080 to Something-Else (for example, 8090).  8080 is a favorite port number for a lot of different applications these days.  Please search the below mentioned files and replace 8080 to another port, say, 8090 -
'...deploy/http-invoker.sar/META-INF/jboss-service.xml' and
'...deploy/jbossweb-tomcat50.sar/server.xml'

After doing these settings restart the web server. You may still face the following console message on JBoss startup: -

11:20:00,168 INFO  [ChannelSocket] Port busy 8009 java.net.BindException:
Address already in use: JVM_Bind

This appears to be a known issue with JBoss. You can read more about this in bugs.sun.com  and bug_id=5098261

As per this information, it is not a bug.

Try the below links to ensure everything is fine:
http://localhost:8090
http://localhost:8090/jmx-console

Conclusion: - 

Tomcat and JBoss can co-exist by a simple configuration of port settings at appropriate places.


Thursday, April 21, 2011

Alfresco 3 Setup with JBoss 4.2.3

Alfresco 3 download (wiki.alfresco.com/)

*) JDK 6 was installed in C:\java.

*) Unzip jboss-4.2.3.GA.zip file in C:\Java.

*) Install MySQL 5.0.18
Copy mysql-connector-java-5.1.13-bin.jar file in C:\Alfresco\jboss-4.2.3.GA\server\default\lib
Execute the DB Script (alfresco-labs-war-3Stable\extras\databases\mysql\db_setup.sql).

*) Create one folder(alfresco.war) in C:\Alfresco\jboss-4.2.3.GA\server\default\deploy\ 
Unzip alfresco.war in C:\Alfresco\jboss-4.2.3.GA\server\default\deploy\alfresco.war.

*) Create one folder(share.war) in C:\Alfresco\jboss-4.2.3.GA\server\default\deploy\ 
Unzip share.war in C:\Alfresco\jboss-4.2.3.GA\server\default\deploy\share.war.

*) Copy alfresco-labs-war-3Stable\commands\bin and alfresco-labs-war-3Stable\commands\ImageMagick folders to C:\Alfresco\jboss-4.2.3.GA\bin folder.

*) Create a conf directory for alfresco and move the distribution extension folder.
   i.e., Copy *.* files from alfresco-labs-war-3Stable\extensions\extension folder to C:\Alfresco\jboss-5.1.0.GA\server\default\conf\alfresco.

*) Edit run.bat file in C:\Alfresco\jboss-4.2.3.GA\bin 
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m -XX:MaxPermSize=128m
set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote -Dalfresco.home=.
*) Edit C:\Alfresco\jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer\server.xml and C:\Java\jboss-4.2.3.GA\server\all\deploy\jboss-web.deployer\server.xml and add URIEncoding="UTF-8" to the section
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" maxHttpHeaderSize="8192"
For example:
<Connector port="8080" URIEncoding="UTF-8" address="${jboss.bind.address}"
maxThreads="250" maxHttpHeaderSize="8192"

*) Edit \jboss\server\default\deploy\ejb3.deployer\META-INF\persistence.properties and change the line:
hibernate.bytecode.provider=javassist
to
hibernate.bytecode.provider=cglib

*) Run the application by using run.bat in C:\Java\jboss-4.2.3.GA \bin 
*) Test application by using URL:http://localhost:8080/alfresco 
*) The default UserID:admin and Password:admin

WCM Integration:
==============
*) Get alfresco-labs-wcm-3Stable.zip and unzip it.
*) copy the file wcm-bootstrap-context.xml to the Alfresco<extension> directory (C:\Java\jboss-4.2.3.GA\server\default\deploy\alfresco.war\WEB-INF\classes\alfresco\extension).
*) Restart JBoss

Verifying the WCM installation
=======================
*) In alfresco.log, search for the following text:
The Web Forms folder was successfully created: and The Web Projects folder was successfully created:
*) Check that the following additional spaces are in your Alfresco repository:
• Web Projects in Company Home
• Web Forms in Data Dictionary