[EJB 3.0] - EntityListener, EntityManager, and Threading
by justinmiller
We have a situation where we have specified an @EntityListener with @Post* annotated methods for a set of entity beans (ejb3 pojo's that is). From the @Post* methods, we then pass the pojo to a MBean service where we know there is both threading and further database access occurring.
It is when the pojo is passed to the mbean that we are running into errors. A forum posting says that EntityManager methods may not be invoked in an @EntityListener - so that could be one cause of our errors. The other contributing factor could be the threading that is occurring in the MBean; the ejb spec prohibits spawning threads from an EJB.
Are we correct in one or both of these conjectures?
Is there a better and/or correct way to accomplish what we're trying to do?
The caveat with the post-handling is that we will take generic action based on the fact that we have an entity bean in our hands. We don't care about the actual declared type of the pojo, just that it is, in fact, an entity bean.
Thanks,
Justin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985916#3985916
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985916
19Â years, 8Â months
[JBoss Seam] - Exception on Seam1.1 Beta1&2
by gus888
Hi all,
I have tomahawk schedule component, which run fine on Seam1.0.1GA. After I upgraded it to Seam1.1 Beta 1 and 2, once I clicked the schedule link, the schedule page was displayed as usual, but all Seam system on server was down. Some of logs is as follows. Appreciate any guidance.
2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
| 2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.Component] trying to inject with hierarchical context search: scheduleEditor
| 2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: scheduleEditor
| 2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: org.jboss.seam.core.persistenceContexts
| 2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: em
| 2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 2006-11-13 22:54:39,359 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
| 2006-11-13 22:54:39,359 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
| 2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.persistence.persistenceProvider
| 2006-11-13 22:54:39,359 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.persistence.persistenceProvider
| 2006-11-13 22:54:39,375 DEBUG [org.ajax4jsf.framework.renderer.RendererBase] Finish encoding of component _viewRoot with class org.ajax4jsf.framework.ajax.AjaxViewRoot
| 2006-11-13 22:54:39,375 DEBUG [org.ajax4jsf.framework.ajax.AjaxRegionBrige] Save State of UIAjaxComponent with Id _viewRoot
| 2006-11-13 22:54:39,375 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@673c9f, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1652020{ url=null ,addedOrder=0}
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 2006-11-13 22:54:39,406 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
| 2006-11-13 22:54:39,406 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
| 2006-11-13 22:54:39,406 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
| 2006-11-13 22:54:39,406 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
| 2006-11-13 22:54:39,406 DEBUG [org.hibernate.pretty.Printer] listing entities:
| 2006-11-13 22:54:39,406 DEBUG [org.hibernate.pretty.Printer] com.cvn.domain.ScheduleSettings{defaultModel=1, detailedRowHeight=22, compactWeekRowHeight=200, workingEndHour=17, theme=default, tooltip=true, visibleStartHour=8, visibleEndHour=18, person=com.cvn.domain.Person#1, settingsId=1, workingStartHour=9, readonly=false, compactMonthRowHeight=100, expandToFitEntries=false, headerDateFormat=yyyy-MM-dd, renderZeroLength=false}
| 2006-11-13 22:54:39,406 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 3
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying business process context
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroyContext.BUSINESS_PROCESS
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postDestroyContext.BUSINESS_PROCESS
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroyContext.CONVERSATION
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.persistenceContexts
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.core.persistenceContexts
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Contexts] destroying: scheduleEditor
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.scheduleEditor
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.Component] trying to inject with hierarchical context search: user
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.Component] trying to inject with hierarchical context search: em
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: em
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.Component] trying to inject with hierarchical context search: scheduleExplorer
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: scheduleExplorer
| 2006-11-13 22:54:39,406 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: org.jboss.seam.core.persistenceContexts
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preRemoveVariable.scheduleEditor
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postRemoveVariable.scheduleEditor
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.interceptors.RemoveInterceptor] Stateful component was removed: scheduleEditor
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.facesMessages
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: conversation
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.conversation
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: em
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.em
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.ManagedPersistenceContext] destroying seam managed persistence context for persistence unit: java:/cvnEntityManagerFactory
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postDestroyContext.CONVERSATION
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing session context
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroyContext.EVENT
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.core.manager
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.exade.vcp.Filter.done
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: ajaxContext
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.AddResourceFactory.CACHE_MAP_KEY
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.ajax4jsf.VIEW_STATE_SAVED
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.ajax4jsf.CURRENT_PHASE
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.exade.vcp.Filter.ResponseWrapper
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facelets.Encoding
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.application.jsp.JspStateManagerImpl.SERIALIZED_VIEW
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.sun.facelets.legacy.ELCONTEXT
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.cvn.custom.util.component.html.util.ExtensionFilter.doFilterCalled
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postDestroyContext.EVENT
| 2006-11-13 22:54:39,437 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
| 2006-11-13 22:54:39,437 DEBUG [org.ajax4jsf.framework.DebugLifecycle] End phase RENDER_RESPONSE(6)
| 2006-11-13 22:54:39,437 DEBUG [com.cvn.custom.util.renderkit.html.util.ReducedHTMLParser] PI found at line 1
| 2006-11-13 22:54:39,437 DEBUG [com.cvn.custom.util.renderkit.html.util.ReducedHTMLParser] DOCTYPE found at line 3
| 2006-11-13 22:54:39,453 WARN [com.cvn.custom.util.renderkit.html.util.DefaultAddResource] MyFaces special javascript could not be retrieved from request-map.
| 2006-11-13 22:54:39,453 DEBUG [org.ajax4jsf.framework.ajax.xmlfilter.FilterServletResponseWrapper] Create StringWriter for buffer servlet output
| 2006-11-13 22:54:39,453 DEBUG [org.ajax4jsf.framework.ajax.xmlfilter.FilterServletResponseWrapper] Create StringWriter for buffer servlet output
| 2006-11-13 22:54:39,453 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 2006-11-13 22:54:39,453 DEBUG [org.jboss.seam.servlet.SeamExceptionFilter] ended request
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985915#3985915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985915
19Â years, 8Â months
[JBossWS] - Re: Exception while deploying a webservice with attachment (
by mnsharif
Yeah, the generated jaxrpc-mapping.xml does have <param-type>java.lang.String</param-type> and Yes, i do have .... type='xsd:string'/> like thing in my part definitions in WSDL. But that is there for a reason, which i will try to explain.
As a matter of fact, wscompile does not allow to have primitive types (like xsd:string etc) to be specified like following:
<message name = "methodName">
| <part name = "paraName" element = "xsd:string"/>
| </message>
If used, wscompile gives error and skips mapping for this method. Please note that this behavior is peculiar to document based web wervices _only_ (this is allowed in rpc style). So, in document based services, i have to wrap these primitive types in wrapper types like this
<message name = "methodName">
| <part name = "paraName" element = "ns2:wrapperString"/>
| </message>
and then, combination of following fragment in types section of the WSDL gives me the equavilent desired effect.
<complexType name = "wrapperStringType">
| <sequence>
| <element
| name = "parameterOne"
| type = "string"
| nillable = "true"/>
| </sequence>
| </complexType>
| <element name = "wrapperString" type = "tns:wrapperStringType"/>
|
Now everything is fine with attachment-less webservices. But for the web-service where i need attachment support, the message _has_ to be defined as
<message name = "methodWithAttachment">
| <part name = "paraName" element = "ns2:wrapperString"/>
| <part name = "attachmentContents" type = "xsd:string"/>
| </message>
Interestingly enough, the wscompile tool does _not_ show any error/warning while generating mapping. The attachmentContents above is my parameter defined in mime:content (which happens to be of type text/plain), so that could be the possible reason of wscompile staying silent on this part being specified as xsd:string.
But at deployment time i get the following warning and then exception (as i mentioned in my first post):
anonymous wrote : 22:11:09,354 WARN [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://www.w3.org/2001/XMLSchema}string
| 22:11:09,354 ERROR [MainDeployer] Could not create deployment: file:/D:/jboss-4.0.4.GA/server/default/deploy/alhamd.war
| org.jboss.ws.WSException: Cannot obtain java/xml type mapping for: {http://www.w3.org/2001/XMLSchema}string
| at org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataDoc(JSR109MetaDataBuilder.java:513)
|
Phew! No wonder, writing this all down is more difficult than explaining on face.
mnsharif
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985912#3985912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985912
19Â years, 8Â months