8 Replies Latest reply on May 10, 2007 4:43 PM by Elmer Espinosa

    how to configure Java Virtual Machine via JBOSS

    Elmer Espinosa Newbie


      I got software that will run under Java web application
      I already installed both j2sdk1.4.2_12 and jboss-3.2.7 in my machine
      and web application, I successfully installed but I miss one thing
      in the manual is running under Tomcat using Java Virtual Machine

      I got JBOSS

      here's the instruction

      Configure the Java VM for Tomcat
      Java VM for Tomcat must be configured on the
      intended web server machine.
      1. Select Configure Tomcat from Tomcat folder on
      the Start Menu.
      2. Select the Java VM tab
      3. In the Java Options dialog box, enter the lines
      detailed at the foot of this page.


      Configuring the Java VM Java Options dialog
      -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl
      -Xmx200m

      is there any way in JBOSS I can put this
      - Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl
      -Xmx200m

      I not a Java progammer I just follow and step by step instructions on
      the web how to run web application.

      hope you can help me on this.


      Thanks,
      Elmer

        • 1. Re: how to configure Java Virtual Machine via JBOSS
          Peter Johnson Master

          You can add this to the JAVA_OPTS line in either run.bat (Windows) or run.conf (Unix/Linux) in the bin directory. For example (the following change in run.conf should be all on one line):

          JAVA_OPTS="-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl

          • 2. Re: how to configure Java Virtual Machine via JBOSS
            Elmer Espinosa Newbie

            Peter,

            Thanks for your quick reply I add

            JAVA_OPTS="-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" -Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl

            in run.bat

            but I still got an error. I am not the issue is in the Java Virtual Machine.

            is this a proper way in setting my web application

            I create a deploy.bat below is the content

            @echo off
            set JAVA_HOME=C:\j2sdk1.4.2_12
            set JBossHome=C:\jboss-3.2.7

            "%JAVA_HOME%\bin\jar.exe" -cvf iproof.war *.jsp WEB-INF
            copy iproof.war "%JBossHome%\server\default\deploy"
            pause

            and run the deploy.bat

            Hope you can help me on this

            Thanks,
            Elmer

            • 3. Re: how to configure Java Virtual Machine via JBOSS
              Peter Johnson Master

              If you edited run.bat, I hope that the edited line read:

              set JAVA_OPTS=...

              Without the "set" it is ignored. (Since your original post did not say which OS you were using I had to guess, so I guessed Linux.)

              You say you are getting an error. What error are you getting?

              • 4. Re: how to configure Java Virtual Machine via JBOSS
                Elmer Espinosa Newbie

                Peter,

                I put set JAVA_OPTS=

                My operating system is Windows XP

                here is the error:

                type Exception report

                message

                description The server encountered an internal error () that prevented it from fulfilling this request.

                exception

                javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.io.FileNotFoundException: C:\jboss-3.2.7\server\default\tmp\deploy\tmp4738iproof.war\xslt\pages\acrobat.xsl
                org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
                org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
                org.apache.jsp.getacro_jsp._jspService(getacro_jsp.java:53)
                org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
                org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
                org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

                root cause

                javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.io.FileNotFoundException: C:\jboss-3.2.7\server\default\tmp\deploy\tmp4738iproof.war\xslt\pages\acrobat.xsl
                org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:683)
                com.g1.doc1.webflow.JSPHelper.outputSimpleXSLT(Unknown Source)
                org.apache.jsp.getacro_jsp._jspService(getacro_jsp.java:46)
                org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
                org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
                org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

                note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.

                Thanks,
                Elmer

                • 5. Re: how to configure Java Virtual Machine via JBOSS
                  Peter Johnson Master

                  In iproof.war, do you have a file named xslt\pages\acrobat.xsl? My guess is "no' since your jar command did not include the xslt directory.

                  • 6. Re: how to configure Java Virtual Machine via JBOSS
                    Elmer Espinosa Newbie

                    Peter,

                    I am not sure in creating a WAR is correct here is my deploy.bat

                    @echo off
                    set JAVA_HOME=C:\j2sdk1.4.2_12
                    set JBoss_Home=C:\jboss-3.2.7

                    "%JAVA_HOME%\bin\jar.exe" -cvf iproof.war *.jsp WEB-INF
                    copy iproof.war "%JBoss_Home%\server\default\deploy"
                    pause

                    here is my structure in my project's base directory:

                    C:\Projects\iProof\Web\

                    \images\*.gif
                    \images\*.jpeg
                    \library\ip.js
                    \library\ip_search.js
                    \library\ip_style.css
                    \library\ip_user.js

                    \WEB-INF\web.xml
                    \WEB-INF\lib
                    \WEB-INF\lib\Archive.jar
                    \WEB-INF\lib\iProof.jar
                    \WEB-INF\lib\Common.jar
                    \WEB-INF\lib\WebFlow.jar

                    \xml\env.xml
                    \xml\text_en-us.xml
                    \xml\version.xml
                    \xml\site\flow.xml
                    \xslt\messages\*.xslt
                    \xslt\pages\*.xslt
                    \xslt\site\*.xslt

                    blank.html
                    getacro.jsp
                    index.html
                    loading.htm

                    hope you can help me in creating a war file

                    Thanks,
                    Elmer

                    • 7. Re: how to configure Java Virtual Machine via JBOSS
                      Peter Johnson Master

                      You jar statement should be:

                      "%JAVA_HOME%\bin\jar.exe" -cvf iproof.war *

                      This will get all of the files into the war.

                      By the way, you really should look into Ant or Maven 2 to help you with building your application. (It has been years since I used the jar utilitiy to build a jar/war/ear file...)

                      Ant: http://ant.apache.org/

                      Maven2: http://maven.apache.org/

                      • 8. Re: how to configure Java Virtual Machine via JBOSS
                        Elmer Espinosa Newbie

                        Peter,

                        Thanks, I successfully view the page by using your suggestion

                        "%JAVA_HOME%\bin\jar.exe" -cvf iproof.war *

                        I really appreciate your help thanks again.

                        Elmer