1 2 Previous Next 25 Replies Latest reply on Jul 21, 2008 11:19 AM by Peter Johnson

    Load Library problem

    Thiago Costa Newbie

      hi for All

      I tried to run Jboss 4.2.2.GA with JDK 1.5.0_15 for 64 bits system, but i found one problem and i would like some help.

      This message appear when i try to initiate the JBoss service:

      "The LoadLibrary function failed for the following reason: LoadLibrary isn't a valid Win32 application."

      I use the Windows 2003 server x64 edition.

      Somebody can help me?


      Thanks.
      Thiago.

        • 1. Re: Load Library problem
          Peter Johnson Master

          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
            Thiago Costa Newbie

            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
              Peter Johnson Master

              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
                Thiago Costa Newbie

                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
                  Peter Johnson Master

                  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
                    Thiago Costa Newbie

                    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
                      Peter Johnson Master

                      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
                        Thiago Costa Newbie

                        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
                          Peter Johnson Master

                          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
                            Thiago Costa Newbie

                            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
                              Peter Johnson Master

                              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
                                Thiago Costa Newbie

                                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
                                  Peter Johnson Master

                                  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
                                    Thiago Costa Newbie

                                    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.

                                    1 2 Previous Next