[seam-issues] [JBoss JIRA] Created: (SEAM-101) Seam Persistence does not work in Tomcat
Leonardo Costa (JIRA)
jira-events at lists.jboss.org
Mon Oct 3 21:44:26 EDT 2011
Seam Persistence does not work in Tomcat
----------------------------------------
Key: SEAM-101
URL: https://issues.jboss.org/browse/SEAM-101
Project: Seam 3 Distribution
Issue Type: Task
Components: Release tasks
Affects Versions: 3.0.0.Final
Environment: MacOSX/Windows XP, java version "1.6.0_26"/Core 2 Duo, Tomcat, EclipseLink, JSF2, Weld,
Reporter: Leonardo Costa
Priority: Blocker
I'm having problems on entityManager access with seam-persistence, weld, eclipselink and tomcat. Everything seems to go perfectly:
Logs:
"INFO: WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
30/09/2011 08:48:47 org.jboss.seam.solder.core.VersionLoggerUtil logVersionInformation
INFO: Seam Solder 3.0.0.Final (build id: 3.0.0.Final)
INFO: Configuring Seam Managed Persistence Context from producer field pacote.library.PersistenceProducer.emf with qualifiers (@javax.enterprise.inject.Any(),
@javax.enterprise.inject.Default())"
Error exception:
"Caused by: javax.naming.NamingException - Cannot create resource instance at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)"
My implementation:
My beans.xml
`
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:ee"
xmlns:t="urn:java:org.jboss.seam.transaction"
xmlns:ft="urn:java:org.jboss.seam.faces.transaction"
xmlns:sc="urn:java:org.jboss.seam.solder.core"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd">
<interceptors>
<class>org.jboss.seam.transaction.TransactionInterceptor</class>
</interceptors>
<t:SeSynchronizations>
<s:modifies />
</t:SeSynchronizations>
<t:EntityTransaction>
<s:modifies />
</t:EntityTransaction>
</beans>
`
My producer:
`
public class PersistenceProducer {
@Produces
@ConversationScoped
@ExtensionManaged
@PersistenceUnit(unitName = "TemplateRichFacesPU")
EntityManagerFactory emf;
}
`
My generic DAO:
`
@Transactional
public class BaseDaoImp<T, ID> implements BaseDaoInt<T, ID>, Serializable {
private static final long serialVersionUID = -1L;
@Inject
private EntityManager entityManager;
@Transactional
public List<T> getAll() {
Query qry = entityManager.createNamedQuery("table.all");
return (List<T>) qry.getResultList();
}
}
`
My extent:
`
@Named
@Dependent
public class AutorDao extends BaseDaoImp<Autor, Long> {
private static final long serialVersionUID = -1L;
public List todosAutores() {
List<Autor> result = getAll();
return result;
}
}
`
Use:
`
@Named
@ConversationScoped
public class AdminAutorCtrl implements Serializable {
private static final long serialVersionUID = -1L;
@Inject
private AutorDao autorDao;
private Autor[] autores;
public void todosAutores() {
autores = (Autor[]) autorDao.getAll().toArray(new Autor[0]);
}
}
`
Error exception:
`
org.apache.myfaces.view.facelets.el.ContextAwareELException: javax.el.ELException: Error reading 'autor' on type pacote.controller.AdminAutorCtrl$Proxy$_$$_WeldClientProxy
at org.apache.myfaces.view.facelets.el.TagValueExpression.getValue(TagValueExpression.java:101)
at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:246)
at javax.faces.component.UIOutput.getValue(UIOutput.java:71)
at javax.faces.component.UIInput.getValue(UIInput.java:147)
at org.apache.myfaces.shared.renderkit.RendererUtils.getValue(RendererUtils.java:347)
at org.apache.myfaces.shared.renderkit.RendererUtils.getStringValue(RendererUtils.java:295)
at org.apache.myfaces.shared.renderkit.html.HtmlTextRendererBase.renderInputBegin(HtmlTextRendererBase.java:190)
at org.apache.myfaces.shared.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:179)
at org.apache.myfaces.shared.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:75)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:685)
at org.apache.myfaces.shared.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:336)
at org.apache.myfaces.shared.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:169)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:685)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:681)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:681)
at org.richfaces.renderkit.RendererBase.renderChildren(RendererBase.java:276)
at org.richfaces.renderkit.html.PanelRenderer.encodeEnd(PanelRenderer.java:181)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:685)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:681)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:681)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:681)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1695)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:281)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:90)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.el.ELException: Error reading 'autor' on type pacote.controller.AdminAutorCtrl$Proxy$_$$_WeldClientProxy
at javax.el.BeanELResolver.getValue(BeanELResolver.java:91)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:171)
at org.apache.el.parser.AstValue.getValue(AstValue.java:169)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:55)
at org.apache.myfaces.view.facelets.el.TagValueExpression.getValue(TagValueExpression.java:93)
... 46 more
Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049 Unable to invoke [method] @PostConstruct public pacote.controller.AdminAutorCtrl.init() on
pacote.controller.AdminAutorCtrl at 16ae29f
at org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:595)
at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:200)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:340)
at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:122)
at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:87)
at pacote.controller.AdminAutorCtrl$Proxy$_$$_WeldClientProxy.getAutor(AdminAutorCtrl$Proxy$_$$_WeldClientProxy.java)
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 javax.el.BeanELResolver.getValue(BeanELResolver.java:87)
... 52 more
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.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
at org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:193)
at org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:591)
... 63 more
Caused by: java.lang.RuntimeException: javax.naming.NamingException: Cannot create resource instance
at org.jboss.seam.transaction.DefaultSeamTransaction.getSeamTransaction(DefaultSeamTransaction.java:153)
at org.jboss.seam.transaction.DefaultSeamTransaction.isActiveOrMarkedRollback(DefaultSeamTransaction.java:62)
at org.jboss.seam.transaction.Work.workInTransaction(Work.java:42)
at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:188)
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.interceptor.proxy.InterceptorInvocation$InterceptorMethodInvocation.invoke(InterceptorInvocation.java:72)
at org.jboss.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:82)
at org.jboss.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:133)
at org.jboss.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:112)
at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:65)
at pacote.dao.-1608738265$Proxy$_$$_WeldSubclass.getAll(-1608738265$Proxy$_$$_WeldSubclass.java)
at pacote.controller.AdminAutorCtrl.todosAutores(AdminAutorCtrl.java:82)
at pacote.controller.AdminAutorCtrl.init(AdminAutorCtrl.java:38)
... 73 more
Caused by: javax.naming.NamingException: Cannot create resource instance
at org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at org.apache.naming.NamingContext.lookup(NamingContext.java:826)
at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.jboss.seam.transaction.DefaultSeamTransaction.getUserTransaction(DefaultSeamTransaction.java:177)
at org.jboss.seam.transaction.DefaultSeamTransaction.createUTTransaction(DefaultSeamTransaction.java:169)
at org.jboss.seam.transaction.DefaultSeamTransaction.getSeamTransaction(DefaultSeamTransaction.java:134)
... 88 more
`
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list