Grigory Kalabin [https://community.jboss.org/people/gkalabin] created the 
discussion

"lookup on ServletContextListener.contextDestroyed"

To view the discussion, visit: https://community.jboss.org/message/764118#764118

--------------------------------------------------------------
Hi everybody!

I'm using JBoss as 7.1.1.

I want to release some resources when my application stops (undeploy or server 
instance shutdown). The resources are located in jndi. 

Currently I'm using ServletContextListener interface: on contextInitialized I 
bind resources to JNDI and on contextDestroyed I have to release the resources, 
but I have an exception:

Error looking up myName, service service jboss.naming.context.java.myName is 
not started


I tryed to bind data on different addresses (java:comp/myName, 
java:comp/env/myName, java:/myName,java:jboss/myName), but behaviour is the 
same in all cases.
When the application runs I can successfuly look up my object.

What I'm doing wrong? My be there is another method to release resources on 
application stop?

P.S. I also attached a sample project: if deploy it and then undeploy you can 
see that it can't look up the objects on destroy. In index.jsp you can see that 
it's possible to lookup the objects when the app runs.

Thank you for any help.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/764118#764118]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to