-
1. Re: Load Library problem
peterj Jul 2, 2008 5:43 PM (in response to tgcosta)Have you deployed an application to JBossAS? If so, does JBossAS start properly without that app deployed?
You stated "initiate the JBoss service". Does this mean that you set up JBossAS to run as a service? If so, what package are you using to set JBossAS up as a service? JBoss Native? The Java Service Wrapper? Also, what happens if you start JBossAS from the command line using the run.bat file?
Where are you locating the error message that you posted? Dialog box? Event log? Command prompt? Server log file? -
2. Re: Load Library problem
tgcosta Jul 3, 2008 10:43 AM (in response to tgcosta)Hey Peter, let me explain with more details what's happened.
I need to make some tests with JBoss in a x64 ambient. Then i did a download of the Java Virtual Machine (JDK 1.5.0_15) that can works in a x64 system and get a stable version of JBoss, i choice 4.2.2.GA version.
In my test, i need to put one instance of JBoss like a windows service. This is ok but when i try to initiate this service appear this message:
"The JBoss service on Local Computer started and then stopped. Some services stop automatically if they have no work to do..."
After this, i looking for more details about this message, and i search for this in Event Viewer, then i found it:
1º message: "The LoadLibrary function failed for the following reason: LoadLibrary is not a valid Win32 application."
2º message: "Could not load the Java Virtual Machine."
3º message: "The JBoss service failed to start."
Is this what's happened with me. Can you help me?
I'm thankful for your attention.
Thiago. -
3. Re: Load Library problem
peterj Jul 3, 2008 2:42 PM (in response to tgcosta)It sounds like you wrote your own Windows service code to start JBossAS as a service. If so, that code, written in C, is incorrect.
Might I ask why you are not using an established mechanism for doing this, such as JBoss Native? -
4. Re: Load Library problem
tgcosta Jul 4, 2008 4:35 PM (in response to tgcosta)Hi PeterJ
So, i didn't wrote the code to start JBossAS. I have an JBossService.exe and a file that call this. Here is the code that i use:
@echo off
setlocal
set Nome=%~n0
set DirIns=%~dp0
set DirJB=C:\jboss-4.2.2.GA
set DirJBS=%DirJB%\_service
set ArqExe=%DirJBS%\JBossService.exe
set JVM=%JAVA_HOME%\jre\bin\server\jvm.dll
if not "%DirIns%"=="%DirJBS%\" (
echo.
echo %Nome% ERRO: Current Directory Invalid!
echo.
echo Precisa ser %DirJBS%
echo.
pause
exit /b
)
if not exist %ArqExe% (
echo.
echo %Nome% ERRO: File not find!
echo.
echo %ArqExe%
echo.
pause
exit /b
)
if "%JAVA_HOME%"=="" (
echo.
echo %Nome% ERRO: Enviroment Variable JAVA_HOME isn't ok!
echo.
pause
exit /b
)
if not exist %JVM% (
echo.
echo %Nome% ERRO: JVM not found!
echo.
echo %JVM%
echo.
pause
exit /b
)
echo -------------------------------------------------------------------------------
echo JVM DO JBoss1 Configuration
echo.
echo Automatic Configuration for JVM (Machine Memory Virtual Java)
echo.
echo.
set /p vm_min="Choose VM min: [Padrao=128] "
set /p vm_max="Choose VM max: [Padrao=512] "
if "%vm_min%"=="" (
set vm_min=128
)
if "%vm_max%"=="" (
set vm_max=512
)
set vm_min=-Xms%vm_min%m
set vm_max=-Xmx%vm_max%m
echo.
echo Installing Service JBoss1...
%ArqExe% -uninstall JBoss1 > nul
%ArqExe% -install JBoss1 %JVM% -Djava.class.path=%JAVA_HOME%\lib\tools.jar;%DirJB%\bin\run.jar %vm_min% %vm_max% -start org.jboss.Main -params -cdefault1 -stop org.jboss.Main -method systemExit -out %DirJBS%\stdout1.log -err %DirJBS%\stderr1.log -current %DirJB%\bin -manual
set vm_min=
set vm_max=
echo.
echo %Nome%: Ok
echo.
pause
echo.
echo.
echo Installation succeeded!
echo.
echo.
pause
I tried to use a JBoss Native, but occurred the same problem. I think the main problem is with LoadLibrary for x64 system.... -
5. Re: Load Library problem
peterj Jul 4, 2008 9:18 PM (in response to tgcosta)Is your JavaService.exe built for 64-bit systems? With JBoss Native, there is a build specifically for 64-bit systems - the 32-bit one will not work. Same goes for JavaService.exe - your must use one built for 64-bit.
-
6. Re: Load Library problem
tgcosta Jul 8, 2008 8:32 AM (in response to tgcosta)Hi PeterJ
I will try this. Do you have the specific link that i can download the JavaService for x64 systems?
Thanks
Thiago. -
7. Re: Load Library problem
peterj Jul 8, 2008 12:29 PM (in response to tgcosta)I do not know if JavaService is available for x64 systems. You might want to switch over to using JBoss Native instead: http://www.jboss.org/jbossweb/downloads/jboss-native/
-
8. Re: Load Library problem
tgcosta Jul 15, 2008 10:28 AM (in response to tgcosta)Hi Peter
In the same time, i'm trying to test the JBoss (4.2.2.GA) in a Linux system (x64). Do you have or do you know where i can find a guide for install, configure and run it ?
Tks.
Thiago. -
9. Re: Load Library problem
peterj Jul 15, 2008 12:40 PM (in response to tgcosta)http://www.jboss.org/jbossas/docs/
Installation on Linux is almost the same as on Windows:
1) set JAVA_HOME to a JDK (you need a Sun JDK, the Java that comes with Linux distros is not sufficient to run JBossAS)
2) unzip the JBossAS binary zip file
3) Make the *.sh file in the bin directory executable
To run as a service on Linux, I was going to refer you to http://wiki.jboss.org/wiki/StartJBossOnBootWithLinux, but that seems way to complicated. Instead, use the jboss_init*.sh files as templates for the script to place into /etc/init.d. -
10. Re: Load Library problem
tgcosta Jul 17, 2008 11:05 AM (in response to tgcosta)Hi Peter, how are you? I hope everything's ok...
Peter, i found this error when i try to start JBoss. Can you help me?
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/jboss/jboss-4.2.2.GA
JAVA: java
JAVA_OPTS: -Dprogram.name=run.sh -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true
CLASSPATH: /usr/jboss/jboss-4.2.2.GA/bin/run.jar
=========================================================================
11:51:30,266 INFO [Server] Starting JBoss (MX MicroKernel)...
11:51:30,267 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)
11:51:30,268 INFO [Server] Home Dir: /usr/jboss/jboss-4.2.2.GA
11:51:30,268 INFO [Server] Home URL: file:/usr/jboss/jboss-4.2.2.GA/
11:51:30,268 INFO [Server] Patch URL: null
11:51:30,268 INFO [Server] Server Name: default
11:51:30,269 INFO [Server] Server Home Dir: /usr/jboss/jboss-4.2.2.GA/server/default
11:51:30,269 INFO [Server] Server Home URL: file:/usr/jboss/jboss-4.2.2.GA/server/default/
11:51:30,269 INFO [Server] Server Log Dir: /usr/jboss/jboss-4.2.2.GA/server/default/log
11:51:30,269 INFO [Server] Server Temp Dir: /usr/jboss/jboss-4.2.2.GA/server/default/tmp
11:51:30,269 INFO [Server] Root Deployment Filename: jboss-service.xml
11:51:30,583 INFO [ServerInfo] Java version: 1.4.2,Free Software Foundation, Inc.
11:51:30,583 INFO [ServerInfo] Java VM: GNU libgcj 4.1.2 20070626 (Red Hat 4.1.2-14),Free Software Foundation, Inc.
11:51:30,583 INFO [ServerInfo] OS-System: Linux 2.6.18-53.el5,x86_64
11:51:30,748 INFO [Server] Core system initialized
11:51:31,773 ERROR [MainDeployer] Could not create deployment: file:/usr/jboss/jboss-4.2.2.GA/server/default/conf/jboss-service.xml
org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.UndeclaredThrowableException)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
at org.jboss.system.ServiceController.install(ServiceController.java:226)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(libgcj.so.7rh)
Caused by: java.lang.reflect.UndeclaredThrowableException
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:236)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:451)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
...27 more
Caused by: java.lang.NoClassDefFoundError: org.jboss.dom4j.DocumentFactory
at java.lang.Class.initializeClass(libgcj.so.7rh)
at org.jboss.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
at org.jboss.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:449)
at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:291)
at org.jboss.mx.metadata.XMLMetaData.build(XMLMetaData.java:255)
at org.jboss.mx.modelmbean.XMBean.(XMBean.java:253)
at org.jboss.mx.modelmbean.XMBean.(XMBean.java:282)
at java.lang.reflect.Constructor.newInstance(libgcj.so.7rh)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1233)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:212)
...29 more
Failed to boot JBoss:
org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.UndeclaredThrowableException)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
at org.jboss.system.ServiceController.install(ServiceController.java:226)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(libgcj.so.7rh)
Caused by: java.lang.reflect.UndeclaredThrowableException
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:236)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:451)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
...27 more
Caused by: java.lang.NoClassDefFoundError: org.jboss.dom4j.DocumentFactory
at java.lang.Class.initializeClass(libgcj.so.7rh)
at org.jboss.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
at org.jboss.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:449)
at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:291)
at org.jboss.mx.metadata.XMLMetaData.build(XMLMetaData.java:255)
at org.jboss.mx.modelmbean.XMBean.(XMBean.java:253)
at org.jboss.mx.modelmbean.XMBean.(XMBean.java:282)
at java.lang.reflect.Constructor.newInstance(libgcj.so.7rh)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1233)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:212)
...29 more
11:51:31,776 INFO [Server] Runtime shutdown hook called, forceHalt: true
11:51:31,776 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
11:51:31,783 INFO [Server] Shutdown complete
Shutdown complete
Halting VM
Tks for your attention.
Thiago. -
11. Re: Load Library problem
peterj Jul 17, 2008 12:36 PM (in response to tgcosta)See these lines:
11:51:30,583 INFO [ServerInfo] Java version: 1.4.2,Free Software Foundation, Inc.
11:51:30,583 INFO [ServerInfo] Java VM: GNU libgcj 4.1.2 20070626 (Red Hat 4.1.2-14),Free Software Foundation, Inc.
That means you are using the free Java environment provided by the Linux distro.
Go read my previous post. -
12. Re: Load Library problem
tgcosta Jul 17, 2008 2:06 PM (in response to tgcosta)Peter, you're totally right...
I have one problem. I follow your advices step by step.
I installed jdk1.5.0_16 with JBoss 4.2.2.GA, but when i was verify if the installation was ok using the command "/usr/sbin/alternatives --config java or javac" the result is this:
[thiago@xxxx ~]$ /usr/sbin/alternatives --config java
There is 1 program that provides 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
How can i change this? Like you tell me, i need to refresh this with the SUN JDK 1.5.0_16, but i don't know how can i do this.
I will need your help for more one time.
Thanks.
Thiago. -
13. Re: Load Library problem
peterj Jul 17, 2008 2:30 PM (in response to tgcosta)If you install Sun's JDK 1.5.0_16, you will probably find it at /usr/java/jdk1.5.0_16. Set JAVA_HOME to that directory (I mentioned this also in my previous post).
-
14. Re: Load Library problem
tgcosta Jul 17, 2008 2:40 PM (in response to tgcosta)Peter
I did this. I edit the .bash_profile in my home directory. See:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export JAVA_HOME=/usr/java/jdk1.5.0_16
export PATH=$PATH:$JAVA_HOME/bin
export ANT_HOME=/usr/Ant
export PATH=$PATH:$ANT_HOME/bin
export JBOSS_HOME=/usr/jboss/jboss-4.2.2.GA
export PATH=$PATH:$JBOSS_HOME/bin
~
what do you think?
Thiago.