[JBoss JIRA] Created: (SOLDER-120) Deployment error when having more than one @Named @Unwraps producer in the project
by Cody Lerum (JIRA)
Deployment error when having more than one @Named @Unwraps producer in the project
----------------------------------------------------------------------------------
Key: SOLDER-120
URL: https://issues.jboss.org/browse/SOLDER-120
Project: Seam Solder
Issue Type: Bug
Affects Versions: 3.0.0.Final
Reporter: Cody Lerum
Having two @Producer methods in an application which are @Named throws a deployment error. If you remove the @Named it deploys fine. The two producers are in different classes with different method names.
WELD-001414 Bean name is ambiguous. Name resolves to beans [org.jboss.seam.solder.unwraps.UnwrapsProducerBean@eb3516, org.jboss.seam.solder.unwraps.UnwrapsProducerBean@923822]
Looking at this error and the source it does appear that the UnwrapsProducer doesn't read the producer method name if the value is not defined in the annotation as it should. However even If I explicitly set the name in the @Named Weld still fails to deploy
org.jboss.weld.exceptions.DeploymentException: WELD-001414 Bean name is ambiguous. Name newServiceReturn resolves to beans [org.jboss.seam.solder.unwraps.UnwrapsProducerBean@8807d7, Producer Method [ServiceReturn] with qualifiers [@Any @CreateBean @Named] declared as [[method] @Produces @Unwraps @CreateBean @Named public co.domain.service.returns.ServiceReturnUtil.newServiceReturn()]]
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] (SEAMPERSIST-69) Transacation is problematic when save data
by hantsy bai (Created) (JIRA)
Transacation is problematic when save data
------------------------------------------
Key: SEAMPERSIST-69
URL: https://issues.jboss.org/browse/SEAMPERSIST-69
Project: Seam Persistence
Issue Type: Bug
Reporter: hantsy bai
Priority: Critical
I used a ConversationScoped bean to save/update data. but it is very strange, when I edit the data and want to update the data, the result was not saved successfully.
When I added @Transactional to the save the method, the same result.
When I added em.flush in the save method(with @Transactional annotation), I got an exception, please refer to the forum post.
When I used em.flush standalone(without @Transactional annotation), it works well.
In before Seam2 application, all above worked well.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] Created: (SEAM-101) Seam Persistence does not work in Tomcat
by Leonardo Costa (JIRA)
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@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
14 years, 4 months
[JBoss JIRA] Created: (SEAMFACES-183) I cannot insert value expressions with the composite components property
by luca stancapiano (JIRA)
I cannot insert value expressions with the composite components property
------------------------------------------------------------------------
Key: SEAMFACES-183
URL: https://issues.jboss.org/browse/SEAMFACES-183
Project: Seam Faces
Issue Type: Bug
Components: UI Components
Affects Versions: 3.0.1
Environment: seam 3.0.1 + mojarra 2.0.3.b5
Reporter: luca stancapiano
Fix For: 3.0.1
If I use a value expression in a composite component, it is rejected and moved to a default value. Here an example of a jsp:
<ui:composition ................
xmlns:p="http://java.sun.com/jsf/composite/components/property"
.........
<p:input id="number" label="#{bundles.messages.receipt_number}">
............
</p:input>
<h:button id="cancel" value="#{bundles.messages.template_linkReset}" outcome="/receipt.xhtml"/>
...........
The problem is inside the encodeBegin method of org.jboss.seam.faces.component.UIInputContainer class:
...............
if (!getAttributes().containsKey(getRequiredAttributeName()) && elements.hasRequiredInput()) {
getAttributes().put(getRequiredAttributeName(), true);
}
if (!getAttributes().containsKey(getLabelAttributeName())) {
getAttributes().put(getLabelAttributeName(), generateLabel(elements, context));
}
...............
The containsKey method of the javax.faces.component.UIComponentBase$AttribuetsMap class ignores all keys from a subclass of the UIComponentBase, in our case the UIInputContainer. Doing an:
getAttributes().get(getLabelAttributeName())
we get the correct result. This achievement is showed in the JSF javadocs (http://javaserverfaces.java.net/nonav/docs/2.1/javadocs/javax/faces/compo...):
If the attribute name specified as a key matches a property of this UIComponent's implementation class, the following methods will have special behavior:
containsKey - Return false.
get() - If the property is readable, call the getter method and return the returned value (wrapping primitive values in their corresponding wrapper classes); otherwise throw IllegalArgumentException.
put() - If the property is writeable, call the setter method to set the corresponding value (unwrapping primitive values in their corresponding wrapper classes). If the property is not writeable, or an attempt is made to set a property of primitive type to null, throw IllegalArgumentException.
remove - Throw IllegalArgumentException.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] Created: (SEAMFACES-208) Support for resolving no argument methods in an EL value expression
by Dan Allen (JIRA)
Support for resolving no argument methods in an EL value expression
-------------------------------------------------------------------
Key: SEAMFACES-208
URL: https://issues.jboss.org/browse/SEAMFACES-208
Project: Seam Faces
Issue Type: Feature Request
Components: CDI Integration
Affects Versions: 3.1.0.Beta2
Reporter: Dan Allen
Fix For: 3.1.0.Final
The EL specification added support for resolving parameterized methods in value and method expressions, with one exception. It does not support resolving methods with 0 parameters. The reason is that an () used at the end of a property is not acknowledged. As a result, the resolver attempts to resolve the method name as a bean property.
For example, assume we have the method:
{code}
public Integer count() {
return 1;
}
{code}
If we attempt to resolve this in a value expression using:
{code}
#{bean.count()}
{code}
We can an error message "count property not found on bean"
It works as expected if the method has at least one parameter:
{code}
public Integer count(Integer i) {
return i;
}
{code}
The following expression will resolve to a value of 1.
{code}
#{bean.count(1)}
{code}
This also breaks resolving the size of a collection:
{code}
#{employees.size()}
{code}
In this case, the error is a bit strange because it tries to parse size as an index.
The root cause of all this is that the spec does not properly honor 0 parameters as a valid number of parameters for a parameterized methods. Instead, it ignores the () and treats the expression as a property.
Method expressions does not have this limitation since both .action and .action() are equivalent expressions.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] (SEAMFACES-217) Seam Faces documentation issues
by Marek Schmidt (Created) (JIRA)
Seam Faces documentation issues
-------------------------------
Key: SEAMFACES-217
URL: https://issues.jboss.org/browse/SEAMFACES-217
Project: Seam Faces
Issue Type: Bug
Components: Documentation
Affects Versions: 3.1.0.Beta3
Reporter: Marek Schmidt
Faces
1.1 Maven dependency configuration
link to "Maven user-defined property" without href in HTML output. (use "url" attribute in docbook instead of "href")
2.1. @RenderScoped
link to "Seam Messages API" doesn't work
8. Faces View Configuration
"A personal favorite", whose?
8.5 Configuring Transactional Views
Docs about Transactional Views should be updated, or perhaps removed if they are not implemented yet.
Missing pieces
1. It should be explicitly noted that Seam Faces produces a Conversation under the EL name "conversation" (see impl/src/main/java/org/jboss/seam/faces/context/conversation/NamedConversationAliasProducer.java)
2. injecting @Faces List<Locale>, @Faces @DefaultLocale is not documented
3. conversation boundaries (@Begin, @End, ConversationBoundaryInterceptor), are not documented
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months