cancel
Showing results for 
Search instead for 
Did you mean: 

How to manually completely remove a J2EE application from the server?

Former Member
0 Kudos

Hello,

I have created and deployed a certain test J2EE application.

After I finished with it I wanted to remove it, yet I cannot do it: Any removal attempt, either by the SDM or Admin Tool, encounters exceptions and errors I cannot handle. I tried restarting the server, stopping the application yet nothing works. on telnet the application has always STOPPING ststus...

Desperately, I have decided to manually remove this application from the server yet I don't know the steps.

Can someone please give me a step-by-step guidance on how to completely remove this application from the server, so it won't appear anyome both at the SDM and at the deploy service of the WAS?

Thank you in advance,

Roy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please provide version and SP of the J2EE and the OS, DB you are running

Former Member
0 Kudos

Hello Frank,

Portal and WAS: NW04 SP16.

OS: Windows 2003

DB: Microsoft SQL Server 2000

Roy

Former Member
0 Kudos

The easy way:

OK, on this version the "sapinst.exe" on the Installation Master CD contains a option (all the way at the bootom of the first screen) called "Additional Life Cycle Management" or something close to it. Running this option uninstalls the J2EE, and optionally removes the users and the database.

The hard way:

1. Stop the J2EE using the MMC

2. In Control Panel -> Administrative Tools -> Services choose the services SAPOSCol and SAPService<SID>. Set them both to startup mode "Disabled". At this point you may have to reboot the server. When the server is up again, make sure that the J2EE is stopped. (It realy should not start because you "Disabled" the services.

3. At MS-SQL detach the database <SID>

4. Open a Command window in the exe directory where "ntscmgr.exe" is located and run the following:

"ntscmgr remove SAPService<SID>"

Additionally, if this is the only SAP instance on the server, also run the comman "ntscmgr remove SAPOSCol"

Both of these command should return "Delete service successful"

5. If this is the only SAP instance on the server, then at the OS level remove the shares "sapmnt" and "saploc"

6. At the OS level, you can delete all files under ..usr\sap\<SID>

7. At the OS level you can now remove user <SID>adm and the various Groups.

8. Restart you server and you are done.

Former Member
0 Kudos

Hello Frank,

I think you misunderstood me, I don't want to remove the whole J2EE engine (god forbid), I simply would like to manually remove the problematic J2ee application I wrote and deployed and I can't get rid of...

Former Member
0 Kudos

Hi Roy,

The way to undeploy a J2EE application is via SDM or Visual Administrator. A doc can be found at

\usr\sap\<sid>\<id>\SDM\program\doc

However looking at your post it is not working and you have received "exceptions and errors" while trying to do so.

Maybe if you paste the exceptions, someone can give good advice based on the error information.

There is as well a SAP note - 756084 that describes some common met problems while working with the SDM and has references to other SAP notes.

HTH

Peter

Former Member
0 Kudos

Hi Peter,

The behaviour is very strange, I have already tried many things without success. In any case at this separate I have opened for the problem you can see all the information that you need. Specially read my last post at the thread. If you have suggestions for solutions other than the ones I've already tried I will be happy to hear.

Regards,

Roy

Former Member
0 Kudos

Hi Roy,

Indeed it's strange, in the other thread you have said :

"I even restarted the J2EE, once it was up removed the application from it successfully and deployed it again successfully. The problem is that the next deployment hangs"

When you undeploy an application, if it is started it is stopped first. Could it be that due to some reasons your application can not stop properly after some conditions and that is causing the problem ?

The next time if it is working properly and is operational and you want to undeploy/deploy, can you just first try to stop it manually and see if that will work or will hang ?

When some operation hangs, the troubleshooting is to get a thread dump and see what the server is doing. When you reproduce the hanging take two thread dumps and search for threads with a stacktrace starting from

com.sap.engine.services.deploy

Maybe that could give a hint.

HTH

Peter

Former Member
0 Kudos

Hey Peter,

I think you have a lead here.

I have reproduced the problem and when I want to stop the application manually it is getting hanged.

From the terminal I see it on constant yellow "STOPPING".

From the admin tool deploy service, same thing, it is on constant "Stop" sign, which indicates it is on stop process.

The reason I asked for manual undeployment is because I thought that perhaps the regular deploy doesn't clean everything correctly so I wanted to get rid of any reminder of the application at the server.

So, back to the STOPPING hanging situation: In order to create a thread dump I simply ask for a thread dump at the context menu of the server at the MMC or do I need to do anything more before that? And why do I need two thread dumps, why not just one?

Regards,

Roy

Message was edited by: Roy Cohen

Former Member
0 Kudos

Hi Roy,

Yes, that should be enough. The files would go to something like :

\usr\sap\<sid>\<id>\work

In case of problems you may consult SAP notes 710154 and 599539.

In order to explore the problem, you need to take it during the first hanging (i.e. the first stop you made after the server reboot)

Why two and not just one thread dump ?

Suppose you are waiting for a friend to come to your house, but your friend is late. By some magic you could take a snapshot of the position of his/her car. You want to take two snapshots within some minutes in between just to differentiate between - "late due to a traffic jam and moving with 10 miles per hour" and "late since the car is still in front of his/her office and is not moving at all"

HTH

Peter

Former Member
0 Kudos

Hi Peter,

I've reproduced the problem and created a thread dump. I believe these lines are the important ones:

-


"SAPEngine_Application_Thread[impl:3]_10" prio=5 tid=0x080cc9d8 nid=0x18e0 in Object.wait() [8a8f000..8a8fdb8]

at java.lang.Object.wait(Native Method)

- waiting on <0x14450d88> (a java.lang.Object)

at java.lang.Object.wait(Object.java:429)

at com.sap.engine.services.ejb.EJBAdmin.destroyContainers(EJBAdmin.java:1145)

- locked <0x14450d88> (a java.lang.Object)

at com.sap.engine.services.ejb.EJBAdmin.commitStop(EJBAdmin.java:2529)

at com.sap.engine.services.deploy.server.application.StopTransaction.commonCommitFinished(StopTransaction.java:262)

at com.sap.engine.services.deploy.server.application.StopTransaction.commitCommon(StopTransaction.java:305)

at com.sap.engine.services.deploy.server.application.StopTransaction.commit(StopTransaction.java:291)

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

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.application.RemoveTransaction.begin(RemoveTransaction.java:133)

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

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

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

at com.sap.engine.services.deploy.server.DeployServiceImpl.remove(DeployServiceImpl.java:903)

at com.sap.engine.services.deploy.server.DeployServiceImpl.remove(DeployServiceImpl.java:5056)

at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:885)

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)

-


Could you please advise how to proceed from here?

Thank you in advance,

Roy

Former Member
0 Kudos

Hi Roy,

The application cannot be stopped because the thread is waiting for all ejb containers to be destroyed. Check the remaining threads that have "ejb" in them and see why they are not stopping.

HTH

Peter

Former Member
0 Kudos

Hi Peter,

Well, it looks like it is unable to stop the JMS Queue connection factory my application is using.

When I try to manually stop or remove this factory it indeed hangs.

I have created another thread dump at this hang and there is some sort of a dead lock there. How do you suggest we proceed from here?

Former Member
0 Kudos

Hi Roy,

Since EJB-s are involved and now there is JMS mentioned, I guess you are using MDB-s.

One possible reason could be that you are using non-XA factory and you are relying on transactions. Simply change the factory to XAQueueConnectionFactory.

The other option would be that there is a thread stuck in your onMessage() that prevents the correct stop.

HTH

Peter

Former Member
0 Kudos

Hi Peter,

Will the XA property affects on removal of the factory?

Do you think that changing it to XA will result in me being able to remove it from the server? If you think so, could you please advice how do I do it, since now it has Factory type: Unknown and it is read only.

Regards,

Roy

Former Member
0 Kudos

Hi Roy,

If your MDB is with Required or RequiredNew transactional attribute you need to use XA factories. Simple change in your descriptor (jms-factories.xml) from something like jmsfactory/default/QueueConnectionFactory

to

jmsfactory/default/XAQueueConnectionFactory, and delete the old resource from VA.

If that was the problem, after redeploying you application with the correct descriptor, you would be able to stop properly your application.

Check SAP note 721295 as well, that basically repeats the same.

HTH

Peter

Former Member
0 Kudos

Hello Peter,

I think your analysis was correct, it solved my problem.

Thank you very very much! Points are on their way 2 u...

One question though: Why RequiresNew needs XA (I know it is not recommended to use RequiresNew on an MDB, I was just making few experiments) ? After all, it is a whole new transaction and not bounded to the previous one.... What am I missing here?

And by the way, The same applies (XA for RequiresNew) for a JDBC factory?

Roy

Message was edited by:

Roy Cohen

Answers (0)