[JBoss AOP] - Fatal Error occured while trying to run sample AOP
by rams_P&S
Hi,
I am trying to do some samples in JBoss aop as a standalone ,but I am getting this fatel error while running.
I am referring from this link http://www.madplanet.com/jboss-docu-wiki/Wiki.jsp?page=40.AOP.Simple.Example
Please correct me if anything wrong in my implementation.
here i have given the detailed Error message
D:\APM\AOP\Sample\Demo>java -Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader POJO
[Fatal Error] jboss-aop_1_0.dtd:1:37: A pseudo attribute name is expected.
java.lang.RuntimeException: org.xml.sax.SAXParseException: A pseudo attribute name is expected.
at org.jboss.aop.Deployment.preconfigThroughClassPath(Deployment.java:83)
at org.jboss.aop.Deployment.deploy(Deployment.java:50)
at org.jboss.aop.AspectManager$2.run(AspectManager.java:326)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.aop.AspectManager.instance(AspectManager.java:262)
at org.jboss.aop.AspectManager.instance(AspectManager.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.aop.standalone.SystemClassLoader.initialize(SystemClassLoader.java:465)
at org.jboss.aop.standalone.SystemClassLoader.loadClass(SystemClassLoader.java:174)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Caused by: org.xml.sax.SAXParseException: A pseudo attribute name is expected.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.jboss.aop.AspectXmlLoader.loadURL(AspectXmlLoader.java:1291)
at org.jboss.aop.AspectXmlLoader.deploy(AspectXmlLoader.java:1210)
at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:1236)
at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:1221)
at org.jboss.aop.Deployment.preconfigThroughClassPath(Deployment.java:78)
... 13 more
[Fatal Error] jboss-aop_1_0.dtd:1:37: A pseudo attribute name is expected.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.aop.standalone.SystemClassLoader.initialize(SystemClassLoader.java:487)
at org.jboss.aop.standalone.SystemClassLoader.loadClass(SystemClassLoader.java:174)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Caused by: org.xml.sax.SAXParseException: A pseudo attribute name is expected.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.jboss.aop.AspectXmlLoader.loadURL(AspectXmlLoader.java:1291)
at org.jboss.aop.AspectXmlLoader.deploy(AspectXmlLoader.java:1210)
at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:1236)
at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:1221)
... 8 more
Exception in thread "main" java.lang.Error: Error deploying aop configrations
at org.jboss.aop.standalone.SystemClassLoader.initialize(SystemClassLoader.java:493)
at org.jboss.aop.standalone.SystemClassLoader.loadClass(SystemClassLoader.java:174)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.aop.standalone.SystemClassLoader.initialize(SystemClassLoader.java:487)
... 3 more
Caused by: org.xml.sax.SAXParseException: A pseudo attribute name is expected.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.jboss.aop.AspectXmlLoader.loadURL(AspectXmlLoader.java:1291)
at org.jboss.aop.AspectXmlLoader.deploy(AspectXmlLoader.java:1210)
at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:1236)
at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:1221)
... 8 more
Thanks and Regards
Ram
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112229#4112229
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112229
18 years, 4 months
[JBoss Seam] - Component abstraction*
by javabeats
Hi, everyone!
I have an use case that can have specific behavior depending on the client where the application is deployed. To add such a caracteristic to the code, without having to change it based on each client, I've made pageflow definition and business process definition "scripts", therefore leaving the views involved in the use case much cleaner. To change use case behavior for a certain client, all I have to do is deploy a different process/pageflow definition for him, and the interface behaves according to his needs. Nice.
But what I fail to accomplish now is the same level of abstraction for components. I would like to create, if possible of course, an interface as a component. And use this to control the tasks of my business process. Depending on the implementation of such interface that is deployed, actions would behave differently.
I'm struggling to accomplish this using drools. My architecture is composed of a .EAR file containing ejb-common and web-common projects, for all common artifacts shared between clients. I would like to add new modules representing custom (or specific) interfaces for each client.
So, I came here for suggestions. Do you guys know of any pitfalls of what I'm trying to achieve? (if that's possible at all...)
Thanks in advance!
Rodrigo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112221#4112221
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112221
18 years, 4 months
[Clustering/JBoss] - Sessions Not Replicating on Cluster
by mohancheema
I am trying to cluster 2 JBOSS instances running on different server. The cluster deploy works fine without any problem. If I take one server down it is removed from the cluster. If I start the server it is added in cluster without any problem. I have Configured external Load Balancer using mod-jk. However, it is not replicating sessions on cluster. i.e. If I am accessing the web app on load balanced URL and shutdown the server on which request is going I again get the login page instead of session being continuous. When checked the logs I get following error.
| 2007-12-12 13:47:47,823 DEBUG [org.jboss.web.tomcat.tc5.session.JBossCacheManager] check to see if needs to store and replicate session with id 7ksk372cFlBERMrPe6AG-Q**.node1
| 2007-12-12 13:47:47,845 ERROR [org.jboss.web.tomcat.tc5.session.JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: 7ksk372cFlBERMrPe6AG-Q**.node1 lastAccessedTime: 1197447467014 version: 5 lastOutdated: 0]
| java.io.NotSerializableException: org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
| at java.util.Hashtable.writeObject(Hashtable.java:813)
| 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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
| at org.jboss.web.tomcat.tc5.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175)
| at org.jboss.web.tomcat.tc5.session.JBossCacheService.externalizeSession(JBossCacheService.java:902)
| at org.jboss.web.tomcat.tc5.session.JBossCacheService.putSession(JBossCacheService.java:348)
| at org.jboss.web.tomcat.tc5.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:122)
| at org.jboss.web.tomcat.tc5.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:994)
| at org.jboss.web.tomcat.tc5.session.JBossCacheManager.storeSession(JBossCacheManager.java:637)
| at org.jboss.web.tomcat.tc5.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:52)
| at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:105)
| at org.jboss.web.tomcat.tc5.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:153)
| at org.jboss.web.tomcat.tc5.sso.ClusteredSingleSignOn.invoke(ClusteredSingleSignOn.java:461)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
| at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
| at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
| at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
| at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
|
Could this be the problem.
Any guidance and help will be helpful.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112220#4112220
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112220
18 years, 4 months
[JBoss Seam] - Scope of EntityManager
by dapeng
What is the default scope of a jpa entity manager in Seam? My experience is that it is CONVERSATION. Is that correct?
I often get an error message on the console that the transaction can not be started, when I access a page, which contains no component reference in the cnversation scope. The reason is somehow the component lookup for entityManager in default scope (CONVERSATION) fails, because no conversation has started yet. As soon as a conversation has been started in my application, the exception disappears.
java.lang.IllegalStateException: Could not start transaction
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:571
| )
| at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(Se
| amPhaseListener.java:307)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseList
| ener.java:142)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.ja
| va:116)
| at org.ajax4jsf.resource.ResourceLifecycle.invokePhaseListener(ResourceL
| ifecycle.java:201)
| at org.ajax4jsf.resource.ResourceLifecycle.processPhaseListeners(Resourc
| eLifecycle.java:177)
| at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:1
| 47)
| at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceSe
| rvice.java:336)
| at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
| at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(Interne
| tResourceService.java:198)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(Interne
| tResourceService.java:144)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
| lter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
| alve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
| alve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
| yAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
| e.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
| ava:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
| ava:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
| onnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
| ve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
| a:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
| :844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
| ss(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
| 6)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.springframework.transaction.CannotCreateTransactionException: Cou
| ld not open JPA EntityManager for transaction; nested exception is java.lang.Ill
| egalArgumentException: Instance must not be null
| at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransact
| ionManager.java:374)
| at org.springframework.transaction.support.AbstractPlatformTransactionMa
| nager.getTransaction(AbstractPlatformTransactionManager.java:350)
| at org.jboss.seam.ioc.spring.SpringTransaction.begin(SpringTransaction.j
| ava:74)
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566
| )
| ... 35 more
| Caused by: java.lang.IllegalArgumentException: Instance must not be null
| at org.springframework.util.Assert.notNull(Assert.java:112)
| at org.springframework.util.ClassUtils.getAllInterfaces(ClassUtils.java:
| 703)
| at org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactory.createEntit
| yManager(SeamManagedEntityManagerFactory.java:61)
| at org.springframework.orm.jpa.JpaTransactionManager.createEntityManager
| ForTransaction(JpaTransactionManager.java:391)
| at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransact
| ionManager.java:315)
| ... 38 more
| 12:02:31,191 ERROR [SeamPhaseListener] swallowing exception
| java.lang.IllegalStateException: Could not start transaction
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:571
| )
| at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(Se
| amPhaseListener.java:307)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseList
| ener.java:142)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.ja
| va:116)
| at org.ajax4jsf.resource.ResourceLifecycle.invokePhaseListener(ResourceL
| ifecycle.java:201)
| at org.ajax4jsf.resource.ResourceLifecycle.processPhaseListeners(Resourc
| eLifecycle.java:177)
| at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:1
| 47)
| at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceSe
| rvice.java:336)
| at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
| at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(Interne
| tResourceService.java:198)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(Interne
| tResourceService.java:144)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
| .java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
| lter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
| alve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
| alve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
| yAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
| e.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
| ava:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
| ava:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
| onnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
| ve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
| a:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
| :844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
| ss(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
| 6)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.springframework.transaction.CannotCreateTransactionException: Cou
| ld not open JPA EntityManager for transaction; nested exception is java.lang.Ill
| egalArgumentException: Instance must not be null
| at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransact
| ionManager.java:374)
| at org.springframework.transaction.support.AbstractPlatformTransactionMa
| nager.getTransaction(AbstractPlatformTransactionManager.java:350)
| at org.jboss.seam.ioc.spring.SpringTransaction.begin(SpringTransaction.j
| ava:74)
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566
| )
| ... 35 more
| Caused by: java.lang.IllegalArgumentException: Instance must not be null
| at org.springframework.util.Assert.notNull(Assert.java:112)
| at org.springframework.util.ClassUtils.getAllInterfaces(ClassUtils.java:
| 703)
| at org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactory.createEntit
| yManager(SeamManagedEntityManagerFactory.java:61)
| at org.springframework.orm.jpa.JpaTransactionManager.createEntityManager
| ForTransaction(JpaTransactionManager.java:391)
| at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransact
| ionManager.java:315)
| ... 38 more
I am using Seam together with Spring. application-context.xml
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
| <!-- <property name="dataSource" ref="dataSource"/> -->
| <property name="persistenceUnitName" value="asap"/>
| </bean>
|
| <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
| <!-- Be sure to specify the SeamManagedEntityManagerFactory since that will manage the EM that will be
| beginning and ending transactions.-->
| <property name="entityManagerFactory" ref="seamEntityManagerFactory" />
| </bean>
|
| <tx:annotation-driven proxy-target-class="true" />
|
| <seam:configure-scopes />
| <bean
| class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
| <!-- Because we have multiple EntityManagerFactories in this applicaitonContext identify the
| SeamManagedEntityManagerFactory as the default -->
| <property name="defaultPersistenceUnitName" value="persistenceContextName" />
| </bean>
|
| <!-- EMF that wraps a Seam Managed EM instance for use in Spring -->
| <bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
| <!-- The Seam managed-persistence-context component name. -->
| <property name="persistenceContextName" value="entityManager" />
| <!-- Optionally provide a unit name. If not specified the default would be the persistenceContextName -->
| <property name="persistenceUnitName" value="persistenceContextName" />
| </bean>
components.xml
<core:init debug="true" />
|
| <core:manager conversation-timeout="120000"
| concurrent-request-timeout="500" conversation-id-parameter="cid" />
|
| <persistence:managed-persistence-context name="entityManager"
| auto-create="true" entity-manager-factory="#{entityManagerFactory}" />
|
|
| <spring:context-loader>
| <spring:config-locations>
| <value>classpath:/META-INF/web-context.xml</value>
| <value>classpath:/META-INF/core-custom-context.xml</value>
| <value>classpath:/META-INF/application-context.xml</value>
| </spring:config-locations>
| </spring:context-loader>
|
| <spring:spring-transaction
| platform-transaction-manager="#{transactionManager}" />
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112218#4112218
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112218
18 years, 4 months
[JBoss Seam] - using raiseTimedEvent / TimerSchedule
by brian.cole01
I couldn't find a working example on the forums, so now I've got one, I thought I'd do the right thing and post.
Note:
1. I'm using a POJO here, and didn't change my components.xml at all. If I was in a EJB component, I guess I could have used the EJB (or quartz?) timer service, but what I have here is all I needed.
2. Seam 2.0 and JBoss 4.2.2.
3. The event stuff in Seam is great. Thanks Seam people!
| import java.util.Date;
|
| import javax.ejb.Remove;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Create;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Observer;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.annotations.Startup;
| import org.jboss.seam.annotations.async.Asynchronous;
| import org.jboss.seam.async.TimerSchedule;
| import org.jboss.seam.core.Events;
| import org.jboss.seam.log.Log;
| import org.jboss.seam.log.Logging;
|
| @Name("scheduleProcessor")
| @Scope(ScopeType.APPLICATION)
| @Startup
| public class ScheduleProcessor {
|
| private final Log log = Logging.getLog(ScheduleProcessor.class);
|
| @Create
| public void init() {
| log.info("init at " + new Date());
| Events.instance().raiseEvent("test1");
| Events.instance().raiseAsynchronousEvent("test2");
| Events.instance().raiseTimedEvent("test3", TimerSchedule.ONCE_IMMEDIATELY);
| Events.instance().raiseTimedEvent("test4", new TimerSchedule(3000L, 8000L)); // delay of 3 secs, then run every 8 secs
| }
|
| @Remove
| public void remove() {
| }
|
| @Observer("test1")
| @Asynchronous
| public void test1() {
| log.info("test 1");
| }
|
| @Observer("test2")
| @Asynchronous
| public void test2() {
| log.info("test 2");
| }
|
| @Observer("test3")
| @Asynchronous
| public void test3() {
| log.info("test 3");
| }
|
| @Observer("test4")
| @Asynchronous
| public void test4() {
| log.info("test 4");
| }
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112213#4112213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112213
18 years, 4 months