[Messaging, JMS & JBossMQ] - Re: Bug: Injected EJB objects instantiated on every MDB call
by doktora
I'd bet my software hat on it.
I've added some sop's to the constructors of CalculatorMDB and RecordManagerBean just to make sure that the container is playing by the rules when calling postConstruct:
CalculatorMDB() {
| System.out.println("CalculatorMDB() CONSTRUCTOR");
| }
|
| RecordManagerBean() {
| System.out.println("RecordManagerBean::CONSTRUCTOR()");
| }
|
And here is the output from hitting the "Calculate" button three times on /EJB3Trail/serviceobjects/injection/calculator.jsp
17:24:06,980 INFO [STDOUT] CalculatorMDB() CONSTRUCTOR
| 17:24:07,001 INFO [STDOUT] RecordManagerBean::CONSTRUCTOR()
| 17:24:07,002 INFO [RecordManagerBean] ++++++++++++ postConstruct +++++++++++
| 17:24:07,005 INFO [STDOUT] The onMessage() is called
| 17:24:09,997 INFO [STDOUT] RecordManagerBean::CONSTRUCTOR()
| 17:24:10,000 INFO [RecordManagerBean] ++++++++++++ postConstruct +++++++++++
| 17:24:15,106 INFO [STDOUT] RecordManagerBean::CONSTRUCTOR()
| 17:24:15,107 INFO [RecordManagerBean] ++++++++++++ postConstruct +++++++++++
| 17:24:15,108 INFO [STDOUT] The onMessage() is called
| 17:24:25,052 INFO [STDOUT] RecordManagerBean::CONSTRUCTOR()
| 17:24:25,056 INFO [RecordManagerBean] ++++++++++++ postConstruct +++++++++++
| 17:24:25,058 INFO [STDOUT] The onMessage() is called
|
One CalculatorMDB object was created and four (?) RecordManagerBean objects.
Doesn't seem right to me.
cheers
dok
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139060#4139060
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139060
18 years
[JBoss Portal] - Re: JBoss Portal + DWR
by tomstrummer
I don't know about the demo but I was able to get DWR 2 and 3 running in a portlet.
Assuming the dwr definition is packaged in your portlet (called 'myPortlet')
First, go to /myPortlet/dwr/ and verify the debug pages display and the remote methods and DTOs look correct.
Then in my portlet's JSP I added this:
| <script src="${pageContext.request.contextPath}/dwr/interface/MyRemote.js"
| type="text/javascript"></script>
| <script src="${pageContext.request.contextPath}/dwr/engine.js"
| type="text/javascript"></script>
|
and I can call the "MyRemote" methods just as if it were a WAR. Don't forget you need the servlet definition in your web.xml. In my case I used the DwrSpringServlet so I didn't have a dwr.xml, just a bean definition.
Also recommend using FireFox + FireBug extension to debug any client-side problems.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139047#4139047
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139047
18 years
[JBoss Portal] - JBoss Portal From Source - JSFSunRIPortlet war sample not wo
by adesai@atech.com
Hello friends,
I downloaded latest JBoss Portal from Source y/d and configured it with JBoss AS 4.2.2 GA along with MySQL5.
I also downloaded 2 sample examples
1. HelloWorldJSFMyFaces42Portlet.war
2. HelloWorldJSFSunRIPortlet.war
The first one did work fine. However; the second one did not work. I have a running version of JBoss Portal 2.6.4 on other machine where this second war is working pretty well.
Can anybody let me know why is it not working with the JBoss that I configured from the Source?
Here is the exception:
| 2008-03-26 09:19:51,640 ERROR [STDERR] java.lang.ClassCastException: com.sun.faces.portlet.LifecycleFactoryImpl
| 2008-03-26 09:19:51,640 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:805)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:486)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:381)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:69)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 2008-03-26 09:19:51,640 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
|
and
|
| 2008-03-26 09:19:51,656 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
| 2008-03-26 09:19:51,671 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/helloworldjsfsunriportlet]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
| javax.faces.FacesException: java.lang.ClassCastException: com.sun.faces.portlet.LifecycleFactoryImpl
| at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:387)
| at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:69)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
| at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
| at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
| at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
|
Thanks for your help.
Amol
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139040#4139040
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139040
18 years