• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JBoss as service - Having issue when starting the JBoss service

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using JBoss 4.0.2 version and JDK 1.6. I have added service.bat, jbosssvc.exe files in JBoss bin directory. When I try running the service I am getting the error prompt "The JBossService on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
I have set my JAVA_HOME to \jdk1.6\bin folder and tried moving JDK installation from program files to different location. But still not able to get this resolved.

Am I missing something here..Could you please help me on this. Many thanks.

Cheers,
Prashant.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the run.log file in the JBOSS_HOME/bin folder to see the logs.

I have set my JAVA_HOME to \jdk1.6\bin



That's a wrong value. The JAVA_HOME should not point to the bin folder. Instead it should point to the home folder of the JDK installation. What's the output of

 
Prashant Shivashimpi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jaikiran,

The echo %JAVA_HOME% value was - C:\Prashant\Java\jdk1.6.0_20\bin;

I have changed it to C:\Prashant\Java\jdk1.6.0_20\; both in JAVA_HOME and PATH environmental variable. And I tried running the JBoss in Services, but it is throwing me the same error. Am I missing something else. Please let me know your thoughts on this. Many thanks.

Cheers,
Prashant.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have changed it to C:\Prashant\Java\jdk1.6.0_20\;



That's an incorrect value. There should not be a semi-colon at the end of it. So change it to C:\Prashant\Java\jdk1.6.0_20
 
Prashant Shivashimpi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jai,

I had removed semicolon in JAVA_HOME variable. The echo result is as below;

C:\WINDOWS>echo %JAVA_HOME%
C:\Prashant\Java\jdk1.6.0_20

In PATH variable, I have added C:\Prashant\Java\jdk1.6.0_20 at the end without semicolon.

After making this changes, I tried running the JBoss service, it's still failing with same error. Do I need to restart anything after making this changes.

Cheers,
Prashant.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prashant Shivashimpi wrote:
After making this changes, I tried running the JBoss service, it's still failing with same error. Do I need to restart anything after making this changes.



Where did you set that JAVA_HOME value? In command prompt? In the Windows environment entries (there are 2 of those one for system and one for the logged in user)? What does JBOSS_HOME/bin/run.log show?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To run JBoss as a service you need to make sure that you set JAVA_HOME within the system properties, setting user properties will not do.

The other possibility is to set JAVA_HOME within service.bat.
 
Prashant Shivashimpi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jai/Peter,

I have installed jdk1.5.0_22 and using jboss-4.2.3.GA. I have created a service.bat and jbosssvc files. I have set my JAVA_HOME in

1) JAVA_HOME variable in system variables as : C:\Program Files\Java\jdk1.5.0_22\ [No semicolon at the end].
2) In Path variable under system variables, I have added C:\Program Files\Java\jdk1.5.0_22\

After making these changes, I ran "service.bat install" from Jboss bin folder and it created JBoss service in Services in Administrative tools in the control panel.

When I try to run this service, I am getting the same error as mentioned earlier above. I am not sure what exactly causing this issue that JBoss service is not starting.

Could you please let me know your thoughts on this issue. Many thanks.

Cheers,
Prashant.
 
Prashant Shivashimpi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jai/Peter,

One good news..It is working now. I have added JAVA_HOME value is service.bat file.

Thanks a lot Peter, your idea on this worked..

But my question is, if I do not want to set JAVA_HOME in service.bat it should work as it was working earlier. Any changes needs to be made to make this work without having JAVA_HOME variable in service.bat file in JBoss bin folder. Many thanks for your time.

Cheers,
Prashant.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After you set JAVA_HOME in the system variables, did you reboot the system? I seem to recall that the part of Windows responsible for starting services doesn't listen for system variable updates, thus it would be aware of the JAVA_HOME setting only after a reboot.

But I highly recommend that you set it in service.bat anyway - having all of the settings in one place makes maintenance much easier.

Also, take a look at the updated service.bat provided as part of the source code for JBoss in Action. That one makes configuring a service easy because all of the settings are presented at the start of the bat file.
 
Prashant Shivashimpi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did not restarted my system after setting the JAVA_HOME system variable. I removed JDK installation and moved it to a different folder to check whether this has any impact on starting the JBoss as a service.

As mentioned by you it is always a good practice to have all the settings in one place. Thank you so much for your time and help on this. It was really very helpful..

Where I will get the updated service.bat present in JBoss in Action ? Many thanks.

Cheers,
Prashant.
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic