1 2 Previous Next 18 Replies Latest reply on Sep 2, 2010 2:41 AM by Sascha Hoffmann Branched to a new discussion.

    How to start Jboss 5.1.0 with eclipse

    Sascha Hoffmann Newbie

      I have a problem to start Jboss 5.1.0 with eclipse. From the commandline the Jboss starts without problems, but from eclipse not.

      I get a messagebox that say: 'Could not create the Java Virtual Machine'

      and the console says: 'Error occurred during initialization of VM
      Could not reserve enough space for object heap'

      and the log-directory is empty.

       

      I tryed some solutions from the Internet but nothing works. What should I do?

        • 1. Re: How to start Jboss 5.1.0 with eclipse
          Peter Johnson Master

          How much free memory do you have on your PC when Eclipse is running? The error message you are getting says that there is not enough free available memory to accomodate the heap size specified for JBoss AS. If you did not change the heap size, then JBoss AS needs at least 512MB of free memory (actually, it will need more than that, probably around 600MB because of various non-heap related memory).

          • 2. Re: How to start Jboss 5.1.0 with eclipse
            Sascha Hoffmann Newbie

            The Windows Manager says that I have 1GB free ram.

             

            I tried to start the Jboss with my old version of eclipse (vers. 3.4) and it worked out. But why?

            • 3. Re: How to start Jboss 5.1.0 with eclipse
              Wolfgang Knauf Master

              Hi,

               

              did you modify "eclipse.ini", or do you use the default one? Do you have many eclipse plugins which might consume more memory than a standard installation?

               

              You might try to increase some of the parameters. See e.g. this: http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html

               

              Hope this helps

               

              Wolfgang

              • 4. Re: How to start Jboss 5.1.0 with eclipse
                Wolfgang Knauf Master

                Hi,

                 

                you might also try to start with a blank new Eclipse workspace. Sometimes this helps ;-).

                 

                Best regards

                 

                Wolfgang

                • 5. Re: How to start Jboss 5.1.0 with eclipse
                  jaikiran pai Master

                  By the way, which version of Eclipse and Java is this? FWIW, there was an interesting issue which would result in OOM issue with Eclipse when Oracle changed one of the Java property values when they took over Sun:

                   

                  http://it.slashdot.org/story/10/07/28/2121259/Oracles-Java-Company-Change-Breaks-Eclipse

                  https://bugs.eclipse.org/bugs/show_bug.cgi?id=319514

                   

                  Not sure if it's related in your case.

                  • 6. Re: How to start Jboss 5.1.0 with eclipse
                    Sascha Hoffmann Newbie

                    I use the standard eclipse.ini and I think this should do. Because it has the same parameters as my old eclipse version.

                     

                    Sadly the blank workspace was no solution :-)

                     

                    I use eclipse 3.6 helion and Java 6, jdk1.6.0_20 on windows xp

                    • 7. Re: How to start Jboss 5.1.0 with eclipse
                      Peter Johnson Master

                      What JVM options are you using? Have you changed run.conf.bat?

                       

                      Try this. With Eclipse running, open a command prompt, cd to the jboss_home/bin directory and run run.bat. If that fails, post the command prompt output. (That output will also answer the two questions in the prior paragraph.)

                      • 8. Re: How to start Jboss 5.1.0 with eclipse
                        luv zorabian Newbie

                        Please first make sure the you have correct setting for JVM in your eclipse under java->installed JRE

                        Try after settiing the JAVA_OPTS...

                        • 9. Re: How to start Jboss 5.1.0 with eclipse
                          Sascha Hoffmann Newbie

                          I tryed to start jboss while eclipse was open and it worked out. Only with eclipse I could not start jboss.

                           

                          I also tryed to start my old jboss (vers. 4.2.3) and it worked out. Where is the difference in these two jboss versions?

                          • 10. Re: How to start Jboss 5.1.0 with eclipse
                            Peter Johnson Master

                            What OS are you running? Post the appropriate run scripts (run.bat and run.conf.bat if Windows, run.sh and run.conf if Linux).

                             

                            For heap memory allocation there is no difference between 4.2.x and 5.x - they both set the heap to a max of 512MB (unless you changed it.)

                            • 11. Re: How to start Jboss 5.1.0 with eclipse
                              Peter Johnson Master

                              Wait a minute - Eclipse doesn't use the run scripts to start the app server. Instead, search the Eclipse installation directory for a file named jboss5.serverdef. That file contains the statrup parameters, including the heap size. If you don't see it, post the file.

                               

                              Also, exactly what version of Eclispe are you using and are you using JBoss Tools and if so which version (if you are not using JBoss Tools, you should be).

                              • 12. Re: How to start Jboss 5.1.0 with eclipse
                                Sascha Hoffmann Newbie

                                I use Windows XP Pro and Eclipse 3.6 Helios with JBoss Tools 3.2.0.M1

                                 

                                I took a look in the jboss5.serverdef and I think it looks fine. Here is the file

                                 

                                [Code]

                                <?xml version="1.0" encoding="UTF-8"?>

                                <tns:ServerRuntime

                                    xmlns:tns="http://eclipse.org/jst/server/generic/ServerTypeDefinition"

                                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                                    xsi:schemaLocation="http://eclipse.org/jst/server/generic/ServerTypeDefinition ServerTypeDefinitionSchema.xsd "

                                    name="JBOSS 5.0" version="v5.0">

                                <property id="serverRootDirectory"

                                    label="%ApplicationServerDirectory"

                                    type="directory"

                                    context="runtime"

                                    default="/your_server_root/appservers/jboss" />

                                <property id="serverAddress"

                                    label="%serverAddress"

                                    type="string"

                                    context="server"

                                    default="127.0.0.1" />

                                <property id="port"

                                    label="%serverPort"

                                    type="string"

                                    context="server"

                                    default="8080" />

                                <property id="jndiPort"

                                    label="%jndiPort"

                                    type="string"

                                    context="server"

                                    default="1099" />   

                                <property id="serverConfig"

                                    label="%jboss323serverConfig"

                                    type="combo"

                                    context="server"

                                    default="default,all,minimal,other - type your own here" />

                                 

                                    <port>

                                        <no>${port}</no>

                                        <name>Http</name>

                                        <protocol>http</protocol>

                                    </port>

                                 

                                    <module>

                                        <type>jst.web</type>

                                        <publishDir>${serverRootDirectory}/server/${serverConfig}/deploy</publishDir>

                                        <publisherReference>org.eclipse.jst.server.generic.antpublisher</publisherReference>

                                    </module>

                                    <module>

                                        <type>jst.ejb</type>

                                        <publishDir>${serverRootDirectory}/server/${serverConfig}/deploy</publishDir>

                                        <publisherReference>org.eclipse.jst.server.generic.antpublisher</publisherReference>

                                    </module>

                                    <module>

                                        <type>jst.ear</type>

                                        <publishDir>${serverRootDirectory}/server/${serverConfig}/deploy</publishDir>

                                        <publisherReference>org.eclipse.jst.server.generic.antpublisher</publisherReference>

                                    </module>

                                 

                                 

                                    <project>

                                 

                                        <classpathReference>jboss.project</classpathReference>

                                 

                                    </project>

                                 

                                 

                                 

                                    <start>

                                 

                                        <mainClass>org.jboss.Main</mainClass>

                                 

                                        <workingDirectory>${serverRootDirectory}/bin</workingDirectory>

                                 

                                        <programArguments>-c ${serverConfig}</programArguments>

                                 

                                        <vmParameters>-Dprogram.name=run.bat -Xms128m -Xmx512m  -XX:MaxPermSize=256m</vmParameters>

                                 

                                        <classpathReference>jboss</classpathReference>

                                 

                                    </start>

                                 

                                    <stop>

                                        <mainClass>org.jboss.Shutdown</mainClass>

                                        <workingDirectory>${serverRootDirectory}/bin</workingDirectory>

                                        <programArguments>-S</programArguments>

                                        <vmParameters>-Djboss.boot.loader.name=shutdown.bat</vmParameters>

                                        <classpathReference>jboss.shutdown</classpathReference>

                                    </stop>

                                    <publisher id="org.eclipse.jst.server.generic.antpublisher">

                                        <publisherdata>

                                            <dataname>build.file</dataname>

                                            <datavalue>/buildfiles/jboss323.xml</datavalue>

                                        </publisherdata>

                                        <publisherdata>

                                            <dataname>target.publish.jst.web</dataname>

                                            <datavalue>deploy.j2ee.web</datavalue>

                                        </publisherdata>

                                        <publisherdata>

                                            <dataname>target.publish.jst.ejb</dataname>

                                            <datavalue>deploy.j2ee.ejb</datavalue>

                                        </publisherdata>

                                        <publisherdata>

                                            <dataname>target.unpublish.jst.web</dataname>

                                            <datavalue>undeploy.j2ee.web</datavalue>

                                        </publisherdata>

                                        <publisherdata>

                                            <dataname>target.unpublish.jst.ejb</dataname>

                                            <datavalue>undeploy.j2ee.ejb</datavalue>

                                        </publisherdata>       

                                        <publisherdata>

                                            <dataname>target.publish.jst.ear</dataname>

                                            <datavalue>deploy.j2ee.ear</datavalue>

                                        </publisherdata>

                                        <publisherdata>

                                            <dataname>target.unpublish.jst.ear</dataname>

                                            <datavalue>undeploy.j2ee.ear</datavalue>

                                        </publisherdata>               

                                    </publisher>

                                 

                                    <classpath id="jboss" >

                                        <archive path="${serverRootDirectory}/bin/run.jar" />

                                    </classpath>

                                    <classpath id="jboss.shutdown" >

                                        <archive path="${serverRootDirectory}/bin/shutdown.jar" />

                                    </classpath>

                                 

                                    <classpath id="jboss.project" >

                                 

                                 

                                        <fileset dir="${serverRootDirectory}">

                                           <include name="client/*.jar" />

                                           <include name="server/default/lib/*.jar" />

                                 

                                           <include name="server/default/deploy/jbossweb.sar/jsf-libs/*.jar" />

                                 

                                           <!-- This will be ignored if EJB3 is not there 5.0 -->

                                           <include name="lib/*.jar" />

                                           <include name="server/default/deployers/jbossweb.deployer/*.jar" />

                                           <include name="server/default/deployers/jboss-aop-jboss5.deployer/*.jar" />

                                           <include name="common/lib/*.jar" />

                                           <include name="server/default/deploy/jbossweb.sar/*.jar" />

                                 

                                           <!-- for validation to work this library is defined as an archive -->

                                           <exclude name="lib/jboss-kernel.jar" />

                                        </fileset>

                                 

                                        <!-- leave one generic jar as an archive so that validation works -->

                                        <archive path="${serverRootDirectory}/lib/jboss-kernel.jar" />

                                 

                                    </classpath>

                                    <jndiConnection>

                                        <providerUrl>jnp://${serverAddress}:${jndiPort}</providerUrl>

                                        <initialContextFactory>org.jnp.interfaces.NamingContextFactory</initialContextFactory>

                                        <jndiProperty>

                                            <name></name>

                                            <value></value>

                                        </jndiProperty>

                                    </jndiConnection>

                                </tns:ServerRuntime>

                                 

                                [/Code]

                                • 13. Re: How to start Jboss 5.1.0 with eclipse
                                  Peter Johnson Master

                                  Wow, I learn something new every day. JBoss Tools does not use the jboss*.serverdef files. Instead, it generates a *.launch file in the workspace, where the '*' is the same as the server name defined in Eclipse. Mine, which uses the default name, is "JBoss 5.1 Runtime 1 Server.launch". Find that file in the workspace/.metadata and notice that it sets -Xmx768m, which along with the 256MB permgen size, and the necessary overhead required by the JRE, then it uses up slightly more than the 1GB of memory you have available. Reducing -Xmx to 512m should get you running again.

                                  • 14. Re: How to start Jboss 5.1.0 with eclipse
                                    Sascha Hoffmann Newbie

                                    Hey thanks for your backup, but I can't find any *.launch-file in my workspace. Must I start the server via jboss before I can search for the file or is the file steady there?

                                    1 2 Previous Next