wood burning stoves*
The moose likes JBoss/WildFly and the fly likes JBoss as service on 64 bit Windows server 2003 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss as service on 64 bit Windows server 2003" Watch "JBoss as service on 64 bit Windows server 2003" New topic
Author

JBoss as service on 64 bit Windows server 2003

Akhil Kashyap
Greenhorn

Joined: Feb 12, 2010
Posts: 17
Hi,

My current production environment is as below:

OS: Windows Server 2003 - 32 Bit
AS: JBoss 3.2
JDK: 1.4

JBoss here runs as a windows service.

Now we are planning to migrate to Windows Server 2003 64 bit.

I have tried to run same Jboss with same JDk from console on 64 bit OS and everything was smooth. But when I tried to create windows service of JBoss it did not start and gave error message "The JBoss service on local computer started and then stopped. Some services stop automatically if they have no work to do, for example, the performance and alert logs."

When I looked into the event logs I found "Load libraray function failed as it is not a valid Win 32 application."

P.S. I have used 64 bit JavaService to create windows service of JBoss.

Any one having any idea what I am missing...kindly suggest.

Thanks in advance

Akhil
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Are you using a 64bit JVM?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Akhil Kashyap
Greenhorn

Joined: Feb 12, 2010
Posts: 17
Hi,

Thanks for the reply.

As of now I am not using 64 Bit JVM.

I have downloaded JDK 1.4 64 bit. Does that mean I have to look out for JBoss 3.2 64 bit also....?


Akhil.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

If you are using a 64-bit JavaService then you will need to use a 64-bit JVM. My understanding from JavaService is that it directly loads the jvm.dll. And a 64-bit executable cannot load a 32-bit DLL.

However, you should be able to use the 32-bit JavaService (with the 32-bit JVM) - there is no rule that services must be the 64-bit.


JBoss In Action
Akhil Kashyap
Greenhorn

Joined: Feb 12, 2010
Posts: 17
Hi

Sorry for the delay in my response.

I have got things working with..

64 bit JVM
64 bit Java Service

@ Peter

I have tried 32 bit Java Service with 32 bit JVM, service was created successfully but when I tried to start, it gave me error message like I mentioned earler in this post.

Can any one suggest some documentation about Java Service so that I can get some idea what is happening behind the scene.

Thanks Peter and Paul for your responses.

Akhil.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Can any one suggest some documentation about Java Service so that I can get some idea what is happening behind the scene.


Let me google that for you: javaservice documentation
Akhil Kashyap
Greenhorn

Joined: Feb 12, 2010
Posts: 17
@Peter

Thanks


Akhil.
Nitin Bhardwaj
Ranch Hand

Joined: Feb 02, 2007
Posts: 72
Hi Akhil,

I am also facing problem in installing the JBoss 5.1 Application Server as a Windows Service on Windows 2008 Server (64 bit). I had a look at JavaService website but it was written that it doesn't work for 64 bit platform. (May be I've read some old post) Till now I've tried several things apart from JavaService to do this. Note that I am using 64 bit JDK 1.6.
Can you please help me with the process for installing the JBoss 5.1 AS as a Windows service on 64 bit?

Best Regards,
Nitin
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Why not use the service.bat file provided with JBoss AS? It works with 32-bit and 64-bit systems. See the jboss_home/bin/readme-service.txt file for details.

By the way, all you need to run Tanuki Java Service Wrapper on a 64-bit system is a 32-bit JVM. When configuring the wrapper, reference the 32-bit JVM.
Nitin Bhardwaj
Ranch Hand

Joined: Feb 02, 2007
Posts: 72
Hi Peter,

I've already tried service.bat (in the bin folder of JBoss 6) to install the JBoss as a Windows service. When for the first time I tried to use it, the following message was shown to me:

C:\servers\jboss-5.1.0\bin>service.bat install
Failed installing JBAS50SVC
Access is denied.
Service JBoss Application Server 5.1 installed


Note that "Failed installing JBAS50SVC Access is denied" is shown in addition to "Service JBoss Application Server 5.0 installed". When I looked at the list of services installed on Windows 2008 server after running the above command, I could not find any service named JBAS50SVC.
I again tried to issue the above command at the command prompt of Windows and now the following appeared:

C:\servers\jboss-5.1.0\bin>service install
Service JBoss Application Server 5.1 installed

However, irrespective of the above second try, I can't find any JBoss service installed on the server.

As an aside I've one more question: We develop our web-application on a 32 bit platform. Suppose if we deploy the WAR generated using a 32 bit JDK to an App server which uses 64 bit JVM, then will it have any issues? (I know that we can run ant script on the 64 bit machine as well which has a 64 bit JDK installed)

Best Regards,
Nitin
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Regarding the "access is denied" error, you must open a command prompt as administrator to do what you are trying. And no, being logged in with an admin account is not sufficient. Right-click on Command Prompt and select Run as Administrator.

Suppose if we deploy the WAR generated using a 32 bit JDK to an App server which uses 64 bit JVM, then will it have any issues?

Java is machine independent - Java apps will run on any machine with a JVM regardless of the bitness of the machine (our mainframes as work run JBoss AS in a 48-bit JVM without any changes to JBoss AS or the apps deployed to it).
Nitin Bhardwaj
Ranch Hand

Joined: Feb 02, 2007
Posts: 72
Thanks Peter, running Command Prompt as Administrator worked.
Best Regards,
Nitin
Nitin Bhardwaj
Ranch Hand

Joined: Feb 02, 2007
Posts: 72
Hi Peter,
Thanks again for your help on installing the JBoss as Windows service.
However, now I am facing another error: When I start the Windows service (for JBoss AS) then it throws the following exception when I try to login to my application named XCMS (Note: I've used JAAS based security for my web application and the database for authentication and authorization):

19:11:05,808 ERROR [[/XCMS]] Exception sending request initialized lifecycle event to listener instance of class com.listener.XCMSServletRequestListener
19:11:27,761 ERROR [CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.OutOfMemoryError: PermGen space


Important Note: No such exception occurs when I start the JBoss AS through run.bat. Everything works fine and I am able to login to the application and use the application.The XCMSServletRequestListener implements the interface java.servlet.ServletRequestListener, and it has been defined as follows in the web.xml:

<listener>
<description>ServletRequestListener for Setting User Information in Session</description>
<display-name>XCMSServletRequestListener</display-name>
<listener-class>com.listener.XCMSServletRequestListener</listener-class>
</listener>

I have no idea why the OutOfMemoryError is coming only with JBoss Windows Service and not with run.bat (JBoss AS).
Request you to help me out.

Best Regards,
Nitin
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

It helps if we have only one discussion: http://community.jboss.org/message/623497#623580
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss as service on 64 bit Windows server 2003