[EJB 3.0] - Cleanup code in Stateless Session Bean when JBoss shuts down
by stwhit
I've written a simple stateless session bean with the following interface:
@Remote
| public interface Foo {
| void sayHello();
| }
and the following implementation:
@Stateless
| public class FooBean implements Foo {
|
| @PostConstruct
| public void postConstruct() {
| System.out.println("Inside postConstruct");
| }
|
| @PreDestroy
| public void preDestroy() {
| System.out.println("Inside preDestroy");
| }
|
| public void sayHello() {
| System.out.println("Hello world");
| }
| }
When I call the sayHello() method from a client, I see the following output:
06:19:16,150 INFO [STDOUT] Inside postConstruct
| 06:19:16,170 INFO [STDOUT] Hello world
When I shutdown JBoss, however, I do not see "Inside preDestroy" printed to the screen.
So, my question is two-fold:
Does the @PreDestroy callback get called when JBoss is shutdown? (I would have expected it to, but apparently it does not..?)
If @PreDestroy does not get, how/where can I put cleanup code in my beans that will get executed when JBoss shuts down?
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054302#4054302
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054302
18Â years, 11Â months
[JBoss Portal] - Re: HELP: SSO not work for my Cluster (without domain name)
by gaopeng_victor
"gaopeng_victor" wrote : "mputz" wrote : You don't need the cookieDomain, as long as you don't have different host names. Have you seen this wiki on SSO?
| | http://wiki.jboss.org/wiki/Wiki.jsp?page=SingleSignOn
|
| Yes, I've seen that wiki. And I've followed that wiki to establish my cluster, except that I used two PCs instead of one. I've configed the org.jboss.web.tomcat.tc5.sso.ClusteredSingleSignOn, enabled the IE cookie. Everything is ok on startup, but when I login on 10.1.16.64, and then visit http://10.1.16.140/portal, it shows that I'm not login.
|
| So I try the cookieDomain attribute, but it also don't work.
|
| Is there anything wrong?
I test the cluster with another simple web application, and find the http session can be replicated sucessfully on one way. That is: I login on node A(host 1) , from jmx-console, I can see that the session is copied to node B(host 2) successfully, so I can access B without loginning again by that session; but the reverse test is fail : when I login on node B with a new session, the replication to A is fail. why?
As to the jboss-portal-ha 2.6, jmx-console show that session replication is also successful from A to B, failed from B to A. But even A to B replication is ok, when I access B's portal by the replicated sessionid, it want me to authenticate again. Is there any thing I need to do with the jboss-portal-ha?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054297#4054297
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054297
18Â years, 11Â months
[Tomcat, HTTPD, Servlets & JSP] - Base is null error
by sandipp
Hi All,
I am getting Base is null error when I try to login to my application.
javax.servlet.ServletException: Base is null: loginFormBean
javax.faces.webapp.FacesServlet.service(FacesServlet.java:202)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
root cause
javax.faces.el.PropertyNotFoundException: Base is null: loginFormBean
org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:455)
org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingImpl.java:169)
com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:111)
javax.faces.component.UIInput.getConvertedValue(UIInput.java:713)
javax.faces.component.UIInput.validate(UIInput.java:638)
javax.faces.component.UIInput.executeValidate(UIInput.java:849)
javax.faces.component.UIInput.processValidators(UIInput.java:412)
javax.faces.component.UIForm.processValidators(UIForm.java:170)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:912)
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:342)
org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:240)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
I am using apache-tomcat-5.5.17,JDK 1.5,Exadel.
I have jsf-api.jar,jsf-impl.jar also I have myfaces-api.jar,myfaces-impl.jar.
On various forums I read that put one jar out of these two(i.e Sun's or myfaces)
But when I created my project first time with above jar files it worked fine for me.
But when I try to create another project its giving me above error.
Can anybody tell me why its giving me above error.I almost searched on google but no luck.
I am deploying my project through ant command to external tomcat.
1) I tried to create project by opening eclipse in clean mode to remove cache but still no success.
Thanks
Sandip
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054296#4054296
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054296
18Â years, 11Â months
[Messaging, JMS & JBossMQ] - excess UIL2 threads
by oglueck
Hi,
We noticed that the UIL2 architecture (SocketManager) uses many threads:
- 2 (read/write) per connection on the server side
- 2 (read/write) per connection on the client side
So if you have like 20 (EJB3) MDBs with a pool size of each 10 each, then UIL2 will create 20 * 10 * 4 = 400 threads that do mostly sleep and perform only ping/pong every minute or so.
Threads cost memory and constitute a scheduling problem. The current design limits the amount of MDBs in one JVM (or in extreme cases on one machine) unnecessarily.
Have the JBoss team ever thought about reducing this massive waste of resources? Maybe with NIO selectors und NIO buffers Threads could be shared among connections. Likewise the MQ destinations could provide selectors instead of blocking calls to pop a message from the stack. I think it makes sense to have one thread per MDB on each client and server side, handling all of the connections. It should be possible to do this without giving up the non-blocking behaviour.
Ortwin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054291#4054291
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054291
18Â years, 11Â months