[jira] [Commented] (DELTASPIKE-436) WELD-001416 Enabled interceptor TransactionalInterceptor specified twice in tomcat8
[ https://issues.apache.org/jira/browse/DELTASPIKE-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13813763#comment-13813763 ] Jozef Hartinger commented on DELTASPIKE-436: https://issues.jboss.org/browse/WELD-1543 WELD-001416 Enabled interceptor TransactionalInterceptor specified twice in tomcat8 --- Key: DELTASPIKE-436 URL: https://issues.apache.org/jira/browse/DELTASPIKE-436 Project: DeltaSpike Issue Type: Bug Components: JPA-Module Affects Versions: 0.5 Environment: jdk1.7,tomcat8(rc5) Reporter: mihaisheng i write a jpa demo,and this demo work fined in jboss-as7.1.1.final. i want to make it worked in tomcat8. after depolyed the war to tomcat,the error occurred. - org.jboss.weld.exceptions.DeploymentException: WELD-001416 Enabled interceptor class org.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor specified twice: - classorg.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor/class in file:/d:/Tomcat%208.0rc5/temp/9-prog_tomcat/WEB-INF/beans.xml@5, - classorg.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor/class in jar:file:/D:/Tomcat%208.0rc5/temp/9-prog_tomcat/WEB-INF/lib/deltaspike-jpa-module-impl-0.5.jar!/META-INF/beans.xml@24 - im sure this demo work fined in jboss-as7.1.1.final. 1.EntityManagerProducer --- public class EntityManagerProducer { @PersistenceContext(unitName = persistence0) private EntityManager entityManager; @Produces @SessionScoped protected EntityManager createEntityManager() { return this.entityManager; } protected void closeEntityManager(@Disposes EntityManager entityManager) { if (entityManager.isOpen()) { entityManager.close(); } } } --- 2.do some database transactional work in a @Transactional way --- import java.io.Serializable; import javax.enterprise.context.SessionScoped; import javax.inject.Inject; import javax.inject.Named; import javax.persistence.EntityManager; import javax.persistence.Query; import org.apache.deltaspike.core.api.provider.BeanProvider; import org.apache.deltaspike.jpa.api.transaction.Transactional; @Named @SessionScoped @Transactional public class Test implements Serializable { private static final long serialVersionUID = -1231439157655757940L; @Inject CurrentUser currentUser; @Transactional public String test1(){ EntityManager entityManager0=BeanProvider.getContextualReference(EntityManager.class,false); //just fill some test data to database String sql=insert into grandscape_user (user_name,user_password) values (:u,:p); Query query=entityManager0.createNativeQuery(sql); query.setParameter(u, Jason Porter); query.setParameter(p, secrete); query.executeUpdate(); return success; } } --- 3.persistence.xml --- ?xml version=1.0 encoding=UTF-8? persistence xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd; version=2.0 persistence-unit name=persistence0 transaction-type=RESOURCE_LOCAL providerorg.hibernate.ejb.HibernatePersistence/provider non-jta-data-sourcejava:comp/env/jdbc/MysqlDB/non-jta-data-source properties property name=hibernate.connection.driver_class value=com.mysql.jdbc.Driver/ property name=hibernate.connection.url value=jdbc:mysql://localhost:3306/grandscape_websit//property property name=hibernate.connection.username value=root / property name=hibernate.connection.password value=root / property name=hibernate.dialect value=org.hibernate.dialect.MySQLInnoDBDialect/ property name=hibernate.connection.autocommit value=true / property name=hibernate.hbm2ddl.auto value=validate/ property name=hibernate.show_sql value=false/ property name=hibernate.cache.use_second_level_cache value=true/ property name=hibernate.cache.provider_class value=net.sf.ehcache.hibernate.SingletonEhCacheProvider/ property name=hibernate.search.default.directory_provider value=org.hibernate.search.store.FSDirectoryProvider/ property name=hibernate.search.default.indexBase value=./lucene/indexes/ property name=hibernate.search.default.batch.merge_factor
[jira] [Commented] (DELTASPIKE-430) re-visit DependentProvider
[ https://issues.apache.org/jira/browse/DELTASPIKE-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13814121#comment-13814121 ] Mark Struberg commented on DELTASPIKE-430: -- To be honest, I don't really like the UnmanagedInstance interface. It feels a bit bloated and has unnecessary restrictions. Eg you really must invoke all those methods in the correct order. The reason for InjectionTarget to have these methods is not because it makes sense from a users perspective, but because it makes sense from a *Container integration* perspective. A user will never ever decide to not invoke the @PostConstruct methods at all. And even if he would, then UnmanagedInstance will great him with an IllegalArgumentException. There is really only 1 valid way to invoke the methods at all I think. To be honest, this Interface completely went under my radar and I did only see it when the spec was already final. So I really rather keep our current implementation. re-visit DependentProvider -- Key: DELTASPIKE-430 URL: https://issues.apache.org/jira/browse/DELTASPIKE-430 Project: DeltaSpike Issue Type: Task Components: Core Affects Versions: 0.5 Reporter: Gerhard Petracek Assignee: Mark Struberg Priority: Critical Fix For: 0.6 we could align (parts) with Unmanaged.UnmanagedInstance (specified in cdi 1.1) -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] [Created] (DELTASPIKE-441) provide a default implementation for the interface 'SecurityViolation'
Mark Struberg created DELTASPIKE-441: Summary: provide a default implementation for the interface 'SecurityViolation' Key: DELTASPIKE-441 URL: https://issues.apache.org/jira/browse/DELTASPIKE-441 Project: DeltaSpike Issue Type: Improvement Components: Security-Module Affects Versions: 0.5 Reporter: Mark Struberg Assignee: Mark Struberg Fix For: 0.6 I've seen quite some code using DeltaSpike already and everytime there was either tons of anonymous classes which always looked the same, or a simple discrete class for SecurityViolation. We should really just provide a simple implementation class with a String parameter. -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (DELTASPIKE-441) provide a default implementation for the interface 'SecurityViolation'
[ https://issues.apache.org/jira/browse/DELTASPIKE-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13814303#comment-13814303 ] Gerhard Petracek commented on DELTASPIKE-441: - i'll commit what we had in codi (there was some nice feedback about it) provide a default implementation for the interface 'SecurityViolation' -- Key: DELTASPIKE-441 URL: https://issues.apache.org/jira/browse/DELTASPIKE-441 Project: DeltaSpike Issue Type: Improvement Components: Security-Module Affects Versions: 0.5 Reporter: Mark Struberg Assignee: Mark Struberg Fix For: 0.6 I've seen quite some code using DeltaSpike already and everytime there was either tons of anonymous classes which always looked the same, or a simple discrete class for SecurityViolation. We should really just provide a simple implementation class with a String parameter. -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (DELTASPIKE-430) re-visit DependentProvider
[ https://issues.apache.org/jira/browse/DELTASPIKE-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13814666#comment-13814666 ] Mark Struberg commented on DELTASPIKE-430: -- PS2: UnmanagedInstance is kind of @New but manually callable. We could provide this as well but the semantic is imo different to DependentProvider. I also often use the DependentProvider for dynamically resolving EJBs to get rid of any warnings. EJBs are treated as being @Dependent scoped per the CDI spec. But that is actually quite misleading. So I just use the getInstance() from DependentProvider, and then throw the dp away without calling destroy(). Destroying of pooled instances is handled by the EJB container anyway. re-visit DependentProvider -- Key: DELTASPIKE-430 URL: https://issues.apache.org/jira/browse/DELTASPIKE-430 Project: DeltaSpike Issue Type: Task Components: Core Affects Versions: 0.5 Reporter: Gerhard Petracek Assignee: Mark Struberg Priority: Critical Fix For: 0.6 we could align (parts) with Unmanaged.UnmanagedInstance (specified in cdi 1.1) -- This message was sent by Atlassian JIRA (v6.1#6144)