Migration from JBoss4

    Possible Problems while moving an application from JBoss4 to JBoss5

    This document contains a list of all Problems encountered while moving an previously working application from an older JBoss-Version to JBoss5.

    Users are encouraged to insert all problems they had while migrating to the new JBoss version.

     

    EAR wont be deployed, while it worked in JBoss 4.0.x

    Possible Reasons:

    The ejb-jar-Attributes are more seriously validated against the dtd.

     

    Solutions:

    Validate or replace the current header of the ejb-jar.xml:


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar
      PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>

     

    Persistence.xml fails to deploy, while it worked in JBoss 4.2.x

    Possible Reasons:

    JBoss 5 is strict in validating persistence.xml

     

    Solutions:

    Make sure the header of persistence.xml is :


    <persistence
        xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
        version="1.0">

     

     

    JSP's are not compiled anymore

    Possible Reasons:

    According to JSP 2.0 specification (chapter 1.7 page 72,73)

    This code is illegal:
    <mytags:tag value="<%= "hi!" %>" />
    Instead the correct sentence would be:
    <mytags:tag value='<%= "hi!" %>' />
    <mytags:tag value="<%= \"hi!\" %>" />
    <mytags:tag value='<%= \"name\" %>' />

    Solutions:

    Change all tags to a pattern like <mytags:tag value='<%= "hi!" %>' /> to be compatible with the current spec.

     

    Quick-Solution to get it working for now:

    Solution for JSPC-Precompilation with ant:
    export ANT_OPTS="-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"

     

    JBoss:
    in run.conf add the JVM-Parameter
    -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"

    Application cannot be found under expected context-root

    Possible Reasons:

    The application.xml in your <ear>/META-INF under path application/module/web/context-root is not used, but the context-root from <app-war.war>/WEB-INF/jboss-web.xml.

    Solutions:

    Remove context-root from <app-war.war>/WEB-INF/jboss-web.xml, if different until some patch comes out.

     

     

    JSP's are reaching the 65k-boundary, while in JBoss 4.0.x they worked

    Possible Reasons:

    Tomcat encodes all of its variables, making the code very large. Also, but probably not important - lots of useless? comments are added.

    Solutions:

    Alter jboss-5.0.0.GA/server/default/deployers/jbossweb.deployer/web.xml


    In section
    <servlet>
          <servlet-name>jsp</servlet-name>
          <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>


    add     
      <init-param>
         <param-name>genStrAsCharArray</param-name>
         <param-value>true</param-value>
      </init-param>

     

    That helps to keep the page (probably) smaller, but in the end, a better design of your JSP-page will be necessary.

     

     

    Warnings for EAR-dependent jars while deploying

    In the server.log the following message gets recorded for the EAR containing an ejb.jar with embedded jar-files:

    13:31:29,386 WARN  [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/usr/local/jboss-5.0.0.GA/server/default/deploy/<some-ear>/<some-ejb>.jar/<embedded-jar>.jar
    javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/usr/local/jboss-5.0.0.GA/server/default/deploy/<some-ear>/<some-ejb>.jar/<embedded-jar>.jar",type=SubDeployment already registered.
             at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
             at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
             at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)

    Possible Reasons:

    Unknown

    Solutions:

    Unknown

     

     

    SAX-Exceptions, XSLT-Errors, other related XML problems

     

    Possible Reasons:

    WEB-INF/lib containing xalan.jar, xercesImpl.jar, serializer.jar, xml-apis.jar

     

    Solutions:

    Delete the libraries from WEB-INF/lib, the JBoss-libs are used. That worked in JBoss4.x.x nevertheless, even when the same jars where available in jboss/lib/endorsed, now it doesnt anymore, why?