Skip to Content

Hi all,

in this blog I want to share some details for implementing two workarounds for referencing the EJB DC from the Standalone Portal Application DC in NWDI for 7.3 development.

The reason for the workarounds is very good described by Krum Bakalsky in one of the answers to this question: http://scn.sap.com/thread/1900441

Short description: The Portal DC and EJB DC have different Java EE versions (Portal DC => 1.3 and EJB  => 1.5)

In my case I faced a little bit different error message during deployment as in the question I mentioned above :

* EJB Model Builder: “META-INF/ejb-jar.xml” not found. For applications prior Java EE 5 this file is mandatory in EJB modules.[message resource bundle missing], file: btexx.com~frwk~ejb.jar#META-INF/ejb-jar.xml, severity: error

The corresponding ejb-jar.xml was missing at all. It was simply not generated, since I created the EJB via EJB Wizard of the SAP NWDS and the file is not required from Version 5 of Java EE. The deployment of the corresponding EAR file was successful, but the deployment of the Portal Application which referenced the EJB DC failed with the error message above.

To avoid such errors there are two workarounds:

Workaround 1: Remove the reference for the EJB public part of type ASSEMBLY

Workaround 2: Align the versions of both DC components.

In following I want to describe the steps to implement these workarounds in some more details. 

Note: The first workaround is a preferred solution from my opinion, because I can’t really estimate the risks of potential problems which can come after the aligning the portal application version to 1.5 (aligning ejb version to 1.3 is useless, since it would mean a step in the past of the java enterprise development 🙂 ). However both workarounds worked for me. 

Workaround 1: Remove the reference for the EJB public part of type ASSEMBLY

The EJB DC should normally have already two public parts after creation:

  • client (of type COMPILATION)
  • ejbjar (of type ASSEMBLY)

EJB public parts.PNG

If you create a dependency to the EJB DC you should disable the reference to the “ejbjar” public part (just uncheck the “Build Time” property in dependency details):

EJB public parts_2.PNG

As a result the jar file of the EJB DC will not be included in the generated deployable artifact of your portal applications (you can check it in <DC project name>/gen/default/deploy/<name>.sda) and the next deployment should be successfull.

Workaround 2: Align the versions of both DC components.


The other workaround requires the update of the application.xml file in the generated sda artifact of your Portal application. The generated file by default looks like this:

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

<!DOCTYPE application PUBLIC “-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN” “http://java.sun.com/dtd/application_1_3.dtd“>

<application>

</application>

Indeed for the Java EE 5 applications the content of the application file should be:

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

<application xmlns="http://java.sun.com/xml/ns/javaee"

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

xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/application_5.xsd">

</application>

This change can be accomplished with following steps:

  1. Extract the file application.xml from <Portal DC project name>/gen/default/deploy/<name>.sda/META-INF
  2. Change the schema as shown above
  3. Create META-INF folder under the root folder of your Portal Application DC project and place the modified file there
  4. Add the newly created META-INF folder as a resource root in DC configuration:

EJB public parts_3.PNG

5. Build and deploy the DC

I hope this information will be helpful for all which want to combine the portal and JEE development in the projects. Happy coding! 🙂  

Best regards,

Artem

To report this post you need to login first.

13 Comments

You must be Logged on to comment or reply to a post.

  1. Dario Rengifo

    hi Artem, actually i have

    [JLinEE reported following erros for sap.com/home~xxxx  application.

    ERRORS:


    * Web Model Builder: Exception occurred: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 4-byte UTF-8 sequence. at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684), file: sap.com~home~xxxx.war#WEB-INF/web.xml, severity: error]


    Hint: 1) The given archive file is not a valid Java EE or SAP specific application.

    at com.sap.engine.services.deploy.server.validate.jlin.impl.JLinPluninImpl.exec(JLinPluninImpl.java:126)

    ….

    ¿Can be related ? Thanks for any information.

    (0) 
      1. Dario Rengifo

        Hi Artem, thanks for your reply. I have  SAP NetWeaver Developer Studio 7.3 SP09 PAT0001

        When i make  “checkin” for the activities in the component “epwesecc” (of type Enterprise Portal / Portal Application Standalone)  the NWA’s log Viewer shows me some errors and deploy fails:

        firts this warning:

        JLinEE validation of application [sap.com/home~epwesecc] returned result Messages for application “sap.com/home~epwesecc” reported by JLinEE checks:

        ERRORS:

        Web Model Builder: Exception occurred: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 4-byte UTF-8 sequence. at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684), file: sap.com~home~epwesecc.war#WEB-INF/web.xml, severity: error

        WARNINGS:

        References Test: There are no matching deploy time references (described in META-INF/SAP_MANIFEST.MF) for the following runtime references [sap.com/home~bjmodecc, sap.com/tc~je~usermanagement~api] (described in the META-INF/application-j2ee-engine.xml), file: 201404281440480391_mdm.gov_TDMODECC_1_sap.com_home~epwesecc.sda, severity: warning

        after, this error:

        [JLinEE reported following erros for sap.com/home~epwesecc application.

        ERRORS:

        * Web Model Builder: Exception occurred: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 4-byte UTF-8 sequence. at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684), file: sap.com~home~epwesecc.war#WEB-INF/web.xml, severity: error]

        Hint: 1) The given archive file is not a valid Java EE or SAP specific application.

        [EXCEPTION]

        com.sap.engine.services.deploy.server.validate.jlin.JLinValidationException: [JLinEE reported following erros for sap.com/home~epwesecc application.

        ERRORS:

        * Web Model Builder: Exception occurred: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 4-byte UTF-8 sequence. at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684), file: sap.com~home~epwesecc.war#WEB-INF/web.xml, severity: error]

        Hint: 1) The given archive file is not a valid Java EE or SAP specific application.

        at com.sap.engine.services.deploy.server.validate.jlin.impl.JLinPluninImpl.exec(JLinPluninImpl.java:126)

        at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.validateApplication(DeployUtilTransaction.java:460)

        at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:175)

        at com.sap.engine.services.deploy.server.application.UpdateTransaction.begin(UpdateTransaction.java:234)

        at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:421)

        at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:473)

        at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:1836)

        at com.sap.engine.services.deploy.server.DeployServiceImpl.update(DeployServiceImpl.java:582)

        at com.sap.engine.services.deploy.server.DeployServiceImpl.update(DeployServiceImpl.java:487)

        at com.sap.engine.services.dc.gd.impl.ApplicationDeployer.update(ApplicationDeployer.java:74)

        at com.sap.engine.services.dc.gd.impl.InitialApplicationDeployer.performDeployment(InitialApplicationDeployer.java:141)

        at com.sap.engine.services.dc.gd.impl.InitialGenericDeliveryImpl.deploy(InitialGenericDeliveryImpl.java:57)

        at com.sap.engine.services.dc.cm.deploy.impl.OnlineDeployProcessor.performDelivery(OnlineDeployProcessor.java:213)

        at com.sap.engine.services.dc.cm.deploy.impl.BulkOnlineDeployProcessor.deploy(BulkOnlineDeployProcessor.java:67)

        at com.sap.engine.services.dc.cm.deploy.impl.AbstractDeployProcessor$DeployProcessorHelper.visit(AbstractDeployProcessor.java:282)

        at com.sap.engine.services.dc.cm.deploy.impl.DeploymentItemImpl.accept(DeploymentItemImpl.java:84)

        at com.sap.engine.services.dc.cm.deploy.impl.AbstractDeployProcessor.deploy(AbstractDeployProcessor.java:100)

        at com.sap.engine.services.dc.cm.deploy.impl.DeployThread.run(DeployThread.java:39)

        at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)

        at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)

        at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)

        thanks for your attention Artem

        (0) 
        1. Artem Böhme Post author

          Hi Dario,

          if you say “checkin” I assume you use the NWDI? What NWDS says, if you try to build the project locally (right-click on the project -> Development Component -> Build) and then deploy the component directly to your portal system (right-click on the project -> Development Component -> Deploy)

          Best regards,

          Artem

          (0) 
          1. Dario Rengifo

            hi Artem, deploy directly the component works fine but i need an administrator account, for  customer  restrictions we can´t deploy directly (AuthorizationException). We must work with checkin :/  .

            For another components on the same track  the checkin works, but for this component  doesn’t

            I checked my classes and other files as web.xml , jasper (.jrxml)  but they´re in UTF-8. I´m not sure if the problem  is on the configuration files as:


            …”file: sap.com~home~epwesecc.war#WEB-INF/web.xml


            thanks 🙂

            (0) 
  2. Dario Rengifo

    Artem, solved!! was a problem with a web.xml that contains the track’s description (the “caption” option in “DC details”) inside the war file. Thanks for your support 🙂

    (0) 
  3. govardan raj

    hi artem ,

    Thanks for the document you have shared ,

    currently we are facing the same issue

    please suggest

    Description Resource Path Location Type

    EJB Model Builder: incompatible verion:

    EJB version defined in “META-INF/ejb-jar.xml” is bigger than the application version.[message resource bundle missing]
    ejb-jar.xml
    /***********/ejbModule/META-INF

    L/***************/ejbModule/META-INF/ejb-jar.xml

    earlier version was jdk 1.4 and currenty we are migrating so we are using nwds 7.31 sp 12 , in this we are facing the above issue please suggest a solution .

    Because here we are not refering the ejb via portal application we are migrating the ejb project from 7.01 to 7.31 .

    Regards

    Govardan

    (0) 
    1. Artem Böhme Post author

      Hi Govardan,

      please provide following information:

      – how exactly you migrate the projects? Can you describe the process in more detail please? E.g. do you switch only th JDK version or migrate from EJB 2.x to EJB 3.x?

      – What is a target system? Which version?

      – At which moment you recieve the error? During deployment? Building?

      Best regards,

      Artem

      (0) 
      1. govardan raj

        Dear Artem,

        E.g. do you switch only th JDK version or migrate from EJB 2.x to EJB 3.x?

        we  are migrating from ejb 2.x to ejb 3.x ,

        we had implemented ejb projects in 7.0 PI , now we have to migrate the same to  PI 7.4

        single stack(Target System) ,

        we are receving this error when we are trying to build the ejb project .

        we are migrating the ejb projects for the first time , please provide if we have any best practise that we should follow to migrate the projects  from 7.0 to 7.31 .

        Regards

        Govardan

        (0) 
        1. Artem Böhme Post author

          Hello Govardan,

          – do you have created new projects in NWDS from scratch or just imported existing projects from NWDS 7.0 in NWDS 7.3?

          – do you have made some code changes to your EJBs to make them EJB3.x compliant?

          Please provide the content of ejb-xml.xml and ejb-j2ee-engine.xml files from META-INF folder of your ejb project

          Thanks and regards,

          Artem

          (0) 
          1. govardan raj

            Hi Artem ,

            we are not creating new projects , we are directly copying the projects from 7.01 workspace to new the workspace and importing that to NWDS 7.31 ,

            we dont have any changes to the ejbs .

            ejb-j2ee-engine.xml

            ———————————————————————————————————————————

            <?xml version=”1.0″ encoding=”UTF-8″?>

            <ejb-j2ee-engine xsi:noNamespaceSchemaLocation=”ejb-j2ee-engine_3_0.xsd” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“>

              <enterprise-beans>

                <enterprise-bean>

                  <ejb-name>*****************_PortTypeBean</ejb-name>

                </enterprise-bean>

              </enterprise-beans>

            </ejb-j2ee-engine>

            ———————————————————————————————————————————

            i dont have ejb-xml.xml instead i have ejb-jar.xml

            ——————————————————————————————————————————

             

            <?xml version=”1.0″ encoding=”UTF-8″?>

            <ejb-jar xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance

            xmlns=”http://java.sun.com/xml/ns/javaee

            xmlns:ejb=”http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd

            xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd

            version=”3.0″>

            <description>EJB JAR description</description>

            <display-name>EJB JAR</display-name>

            <enterprise-beans>

            <session>

            <ejb-name>***********_PortTypeBean</ejb-name>

            <home>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundHome4</home>

            <remote>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundRemote4</remote>

            <local-home>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundLocalHome4</local-home>

            <local>com.sap.aii.proxy.xiruntime.core.AbstractProxyInboundLocal4</local>

            <ejb-class>com.*****.***.********_PortTypeBean</ejb-class>

            <session-type>Stateless</session-type>

            <transaction-type>Container</transaction-type>

            </session>

            </enterprise-beans>

            </ejb-jar>

            ——————————————————————————————————————————

            (0) 
            1. Artem Böhme Post author

              The problem, that you have that deployment descriptors are EJB 3.x but you seems to have the EJB 2.x EJBs (do you have remote, local, local-home etc. interfaces?)

              Do you still have the old projects from 7.01 workspace? I would suggest to replace the ejb-j2ee-engine.xml and ejb-xml.xml from there in your project in 7.3. workspace

              Best regards,

              Artem

              P.s. Here some background info: https://help.sap.com/saphelp_nw73/helpdata/en/48/fc2119a0ad2637e10000000a42189d/content.htm

              (0) 

Leave a Reply