cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with EAR referencing a library DC

Former Member
0 Kudos

I followed the procedure described in the NetWeaver documention for creating, deploying and referencing a library module (DC) but my servlet will not load.

1) I have a deployed my library DC and I can check in Visual Admin that it is available and that it contains the proper jars.

2) I reference my library DC in my EAR (in application-j2ee-engine.xml)

3) I deploy the EAR but I get a servlet not found when I access the WebApp.

If I put the jars from the library module in my EAR then everything works fine...

Any idea as to why things are not working as documented?

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Laurent,

Point <i>2) I reference my library DC in my EAR (in application-j2ee-engine.xml)

</i> is potenatialy incorrect.

What is the name and provider of library DC? (You can see it in VA)

And what did you pu to application-j2ee-engine.xml?

For example, if you need to refer to sapxmltoolkit library, you should use something like:


	<reference 
		reference-type="hard">
		<reference-target 
			provider-name="sap.com" 
			target-type="library">sapxmltoolkit</reference-target>
	</reference>

Best regards, Maksim Rashchynksi.

Former Member
0 Kudos

Thanks Maksim, you definitely put me on the right track and got me a bit further along.

I will try to award you the brownie points ...

What happens, for the record, is that the IDE inserts the "Display Name" within the <reference-target> element but the system needs the "Library Name". In my case, this was the "gazmetro.commobilitexlibs" instead of "mobilite/xlibs". I edited the XML source and now I get things almost working except that I get a message saying that my library DC is not active even though I activated the DC and deployed it... Here is the dep0loyment warning that I get:

2006-03-27 12:30:02 /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] WARNING:

[011]Deployment finished with warning

URL to deploy : file:/C:/DOCUME1/LG74201.GAZ/LOCALS1/Temp/temp41153gazmetro.commobilite~ear_cm.ear

Result

=> deployed with warning : Finished with warnings: development component 'mobilite/ear_cm'/'gazmetro.com'/'SP1_MOB10_D'/'20060327122722':

Caught exception during application startup from SAP J2EE Engine's deploy service:

java.rmi.RemoteException: Error occurred while starting application gazmetro.com/mobilite/ear_cm and wait. Reason: Clusterwide exception: server ID 1873050:com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Application gazmetro.com/mobiliteear_cm cannot be started. Reason: it has hard reference to resource gazmetro.comgazmetro.commobilitexlibs 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:170)

at com.sap.engine.services.deploy.server.application.StartTransaction.begin(StartTransaction.java:139)

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:327)

at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:111)

at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:230)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4680)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4585)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4558)

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:304)

at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)

at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)

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 exception : Got problems during deployment

0 Kudos

Hi Laurent,

I would try writing "gazmetro.com/mobilitexlibs" instead of "gazmetro.commobilite~xlibs", i.e. replace first tilde with a slash. I have had bad experiences before where the WAS is <i>very</i> sensitive to the syntax of these references.

Regards,

Thorsten

Former Member
0 Kudos

Unfortunately, I tried various naming schemes with no success. I suspect the problem is really related to the error message: somehow, the WAS does not consider the library DC as an active DC since it appears to find it but does not allow the EAR to bind to it...

I am still searching for a detailed procedure describing how to create and deploy an active DC. My library DC appears as an active DC in NW Studio and I deploy the library from this view but apparently, the J2E does not consider it as active...

Very frustrating this whole game of managing DCs. What we really need a detailed spec describing how things work and where and how the information is stored because most of the supplied wizards and NW Studio functions simply do not seem to work as designed or intended. I seem to spend most of my time at reverse engineering the system. Thuis simply does not make sense. SAP should spend less effort on trying to make things easy to use and more time on documentating how things really work. Any coder can edit an XML file and all XML configuration files and there roles should be documented. We lose precious days figuring things out from documentation intended for 1st year undergraduates and discovering how things really work below the surface. My 2 cents worth...

Former Member
0 Kudos

Have you used the Visual Administrator to see if your library was really deployed? Go to Server / Libraries and see if you can find your library. It will be displayed using the textual description of the library - if no description was specified when the DC was created, then the technical name will be used.

If it's not there, then that's your problem. No library, no reference. Of course, deployment should have failed if this were the case, unless you incorrectly specified the library references.

However, if it is there, check the library name of the library in the right hand pane. Make sure the reference you've setup is using this name. Again, you should have gotten deployment errors assuming you have a hard reference to the library.

Lastly, you can look at the class loader references. Go to Server / Services / Classloader Viewer / Applications in the VA, and select your application. You should see a nice tree of all the references for your application. Make sure your library is in there - if it isn't, well, you got problems.

Also check the deploy log for your application to ensure that the application was deployed correctly. Sometimes a deployment may look successful, when in fact there were errors that aren't reported. When in doubt, check the logs!

I'm with you regarding documentation. The docs are quite large and vague, and in many cases completely insufficient. SDN does help, but unfortunately, short of opening an OSS ticket for each question, your best bet is to start digging. Note that the tools can be somewhat buggy as well, which compounds your difficulties. For example, NWDS SP16 cannot (without tweaking) build J2EE server libraries such that you can actually deploy external jar files to the server. A pretty fundamental error, one that should NOT have gotten past QA - but it did.

Former Member
0 Kudos

Ken,

Thank you for the helpful post. As it apparently turns out, the naming scheme is probably the root of the problem. Although my library is listed under the name "gazmetro.commobilitexlibs" in Visual Admin, I need to reference it as follows in the application-j2ee-engine.xml file:

<reference

reference-type="hard">

<reference-target

provider-name="gazmetro.com"

target-type="library">mobilite~xlibs</reference-target>

</reference>

Now my deployment warnings have disappeared and the Visual Admin/Classloader Viewer displays things that appear right (thanks for pointing out the ClassLoader Viewer diagnostic tool). Anyway, now I have "ServletNotFoundException" which is strange but apparently I have moved one step closer to the ultimate solution...

Once again, the "official" documentation seems at best incomplete if not simply wrong...

Former Member
0 Kudos

Hi Laurent,

I am desperatly looking for a solution to the ServletNotFoundException.

For different reasons I must have my servlet and my API in the same SDA, but putting the servlet on the SDA throws the servlet not found.

Any solution?

Thank you,

Adil.

Former Member
0 Kudos

Hi Laurent,

is this on 04 or 04s? The newer build logic actually is capable of creating the application-j2ee-engine.xml file during build based on the DC dependencies. You could give this a try by temporarily removing (or renaming) the application-j2ee-engine.xml and then checking the generated SDA/EAR.

Regarding creation and deployment of an active DC:

There's no such thing. You (as developer) create DCs. CBS/DTR enforce an "activation" process that distinguishes "inactive" (what you checked in) and "active" (what was successfully activated/built on CBS). Autodeployment in NWDI will always use "active" versions as that is the build result from CBS. In the IDE you can sync sources from either inactive or active workspace and create a deploy archive in the IDE. The difference is simply the content of those activities that were not yet activated, i.e. succesfully built.

If you sync archives for a DC you will always get a build result from CBS so it will be an "active" version.

But this active/inactive distinction only applies to CBS/DTR, there's no such distinction on the engine.

(See e.g. http://help.sap.com/saphelp_nw2004s/helpdata/en/55/c75242f8a0bd30e10000000a155106/frameset.htm )

The documentation does include quite a lot of info, but the terminology can be quite confusing. Have you thought about reporting your problems to SAP?

Regards,

Marc

Answers (1)

Answers (1)

0 Kudos

Hi Laurent,

Not sure, but don't you need to reference the library in your web project as well?

- Thorsten