cancel
Showing results for 
Search instead for 
Did you mean: 

Java EJB

Former Member
0 Kudos

I am building a simple Server side Java Proxy for deployment on our SAP system. I am

using the NWDS Version: 7.0.11 as the development environment.

I have based my work on the example in the SAP How-To guide

"How to work with Java Proxies" Version 1.00 - August 2006

I have no problems building, deloying and using a simple Server

side proxy - I use SoapUI 2.0 as the client to test the Proxy and

see the results I would expect.

When I change the examples slightly to include a reference to

some NON SAP libraries that the Java code needs in the IMPL

class, I run into problems. Section 3.10 of the SAP How-To document

references the fact that the application-j2ee-engine.xml file needs

to be populated with library references ...I have added to this

file the JAR files that my code will reference, however, I am

not sure about how to format these non-sap jar entry definitions.

What I have done looks like this:

<reference

reference-type="weak">

<reference-target

provider-name="uniobjects"

target-type="library">asjava.uniobjects</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="uniproxy"

target-type="library">asjava.uniproxy</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="ferg.com"

target-type="library">com.ferg.ws</reference-target>

</reference>

The jars that support the above references DO get included in the resulting .EAR file.

What I need to know is if the above references are properly formatted in the application-j2ee-engine.xml

file - note that I guessed at what was needed for the "provider-name" - I'm guessing this is just any arbitrary name .... also, are there are any other configuration files which need tweaking to cause the non-SAP JAR file references to get satisfied.

When I run a test with SoapUI 2.0 where the code in my IMPL class references methods in the Non-SAP

jars, the call simply times out ...I see no indication in SXMB_MONI of any activity.

Thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

OK ...I figured this out ...seems that the content of the application-j2ee xml file is not really relevant as regards the specification of non SAP JAR files ( libraries ) ....

the issue was one of a method in the called non SAP JAR file returning an

incorrect / unpected value ...this seems to cause some sort of timeout issue responding

back through XI - that I am now investigating ...when a different value is used in the

calling app, all works well ...guess I need to investigate how java Exceptions are bubbled

back through the EJB layers to the calling app.

Thanks for the suggestions guys !

Former Member
0 Kudos

Stefan ....not sure what you are saying here ....how do suggest I change the construct of either the application-j2ee-engine.xml or the EAR itself ?

Thanks

stefan_grube
Active Contributor
0 Kudos

Put the librarie files in the EAR and leave the descriptor file as standard (do not add your libraries here)

Regards

Stefan

stefan_grube
Active Contributor
0 Kudos

When you add your jar files in the EAR file, you need ne library reference.

You only need them, when you create a library project in developer studio and attach your libraries there.

Then you deploy the library project first and reference in the EJB project to this.

The reference name can be determined from the library project.

Hope that helps

Stefan

Former Member
0 Kudos

Can you change the reference type to hard

<reference

reference-type="hard">

<fail-over-enable mode="disable">

Regards

Unni

Former Member
0 Kudos

Thanks for responding ...yes I tried that and deployment failed - did not seem to be able to find a reference to the JAR file - the jar(s) in question are in the EAR ...the ear has following structure:

-


Name | Size | Packed | Modified | Path

-


asjava.jar 92,585 86,831 5/7/2007 9:07 AM

asjava_p.jar 32,816 31,485 5/7/2007 9:07 AM

B2bSharedLib.jar 46,938 42,025 2/1/2008 9:25 AM

FEIUtilities.jar 131,858 126,440 5/7/2007 9:07 AM

SAP_Server_Proxy_2.jar 23,215 20,372 7/22/2008 12:32 PM

MANIFEST.MF 181 133 7/22/2008 12:32 PM META-INF\

SAP_MANIFEST.MF 576 340 7/22/2008 12:32 PM META-INF\

application-j2ee-engine.xml 2,807 358 7/21/2008 4:59 PM META-INF\

application.xml 403 238 7/21/2008 1:23 PM META-INF\

sda-dd.xml 600 172 7/22/2008 12:32 PM META-INF\

-


=====================================================================

The application-j2ee-engine.xml file has - note that I use Provider-Name of SAP.COM

even for my non SAP jars since I am not sure what else to use ... :

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

<!DOCTYPE application-j2ee-engine SYSTEM "application-j2ee-engine.dtd">

<application-j2ee-engine>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">com.sap.aii.proxy.xiruntime</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">com.sap.aii.messaging.runtime</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">com.sap.xi.util.misc</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">com.sap.guid</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">asjava.unirpc</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">asjava.uniclientlibs</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">asjava.uniobjects</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">asjava.uniproxy</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">com.ferg.ws</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">com.ferg.ws.dto</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">com.ferg.ws.ordermanagement.dto</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">feiutilities</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">feiutilities.secure</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">feiutilities.tag</reference-target>

</reference>

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">feiutilities.unidata</reference-target>

</reference>

<provider-name>sap.com</provider-name>

<fail-over-enable

mode="disable"/>

</application-j2ee-engine>

=====================================================================

The ejb-jar.xml file in SAP_Server_Proxy_2.jar has:

<?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>

<description>EJB JAR description</description>

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

<enterprise-beans>

<session>

<ejb-name>JAVAPROXYRAMTESTInboundSynchronousMI_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>ramProxyTest.JAVAPROXYRAMTESTInboundSynchronousMI_PortTypeBean</ejb-class>

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

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

</session>

</enterprise-beans>

</ejb-jar>

===========================================================================

The deployment errors are as follows:

===========================================================================

Deployment started Mon Jul 21 16:37:19 EDT 2008

===========================================================================

Starting Deployment of SAP_Server_Proxy_2_EAR

Finished with warnings: development component 'SAP_Server_Proxy_2_EAR'/'sap.com'/'localhost'/'2008.07.21.16.05.38'/'0':Caught exception during application startup from SAP J2EE Engine's deploy service:java.rmi.RemoteException: Error occurred while starting application sap.com/SAP_Server_Proxy_2_EAR and wait. Reason: Clusterwide exception: server ID 105884950:com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Application sap.com/SAP_Server_Proxy_2_EAR cannot be started. Reason: it has hard reference to resource asjava.unirpc with type library, which is not active on the server. at com.sap.engine.services.deploy.server.ReferenceResolver.processReferenceToLibrary(ReferenceResolver.java:505) at com.sap.engine.services.deploy.server.ReferenceResolver.processMakeReference(ReferenceResolver.java:393) at com.sap.engine.services.deploy.server.ReferenceResolver.beforeStartingApplication(ReferenceResolver.java:328) at com.sap.engine.services.deploy.server.application.StartTransaction.beginCommon(StartTransaction.java:162) at com.sap.engine.services.deploy.server.application.StartTransaction.begin(StartTransaction.java:136) at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:292) at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:342) at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:126) at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245) at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4707) at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4612) at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4585) at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1163) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:313) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)

Deployment of SAP_Server_Proxy_2_EAR finished with Warning (Duration 21725 ms)

===========================================================================

Deployment ended Mon Jul 21 16:37:44 EDT 2008

Former Member
0 Kudos

Hi Rod,

In your exception, I see

Reason: it has hard reference to resource asjava.unirpc with type library, which is not active on the server

but

application-j2ee-engine.xml entry is

<reference

reference-type="weak">

<reference-target

provider-name="sap.com"

target-type="library">asjava.unirpc</reference-target>

</reference>

Are you saying you tried changing to

<reference

reference-type="hard"> and getting a different exception than what is mentioned in your post?

Just clarifying

Unni

Former Member
0 Kudos

Correct... I tried changing the reference-type to "hard" and encountered the deployment error ...

when I changed it to "weak", everything deploys fine but I get a timeout.

Note that if I do not reference non SAP libraries in my code, the EJB functions fine so

my presumption is that this is an issue of access the code in the 3rd party library.

Stefan Grube suggested that I NOT make reference to the NON SAP libraries in my

application-j2ee-engine.xml file ....I am making those changes now and shall test.