[jboss-user] [EJB 3.0] - Question to ejb-jar.xml override
Hi, I haven´t found any clear statements about this topic so maybe someone in here knows about this. Should it be possible through EJB3-specification to override settings/annotations from another jar using the ejb-jar.xml (currently in my local jar)? Or is configuration/override only specific to the jar, where the ejb-jar.xml is located in? Does anyone know anything about this? Thomas View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4212250#4212250 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4212250 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Merging an object twice
Okay. Here comes more details. I use the embedded jboss, that is in the jboss maven repository. Here are the groupId/artifactIds | org.jboss.embedded:hibernate-all:jar:beta3:test | org.jboss.embedded:jboss-embedded-all:jar:beta3:test | org.jboss.embedded:jboss-embedded:jar:beta3:test | org.jboss.microcontainer:jboss-deployers-client-spi:jar:2.0.0.Beta6:test | org.jboss.microcontainer:jboss-deployers-core-spi:jar:2.0.0.Beta6:test | org.jboss.embedded:thirdparty-all:jar:beta3:test | My usage is fairly simple. Iôve got a very simple test-case where I simply added merge() a couple of times to see itôs behaviour: public void simpleTest() { | Member aMember = new Member(); | aMember.setMembershipType(MembershipType.ACTIVE); | getEntityManager().merge(aMember); | aMember.setMembershipType(MembershipType.HONORARY); | getEntityManager().merge(aMember); | try { | doSomething(); | } catch (Exception ex) { | aMember.setMembershipType(MembershipType.SPONSOR); | getEntityManager().merge(aMember); | } | getEntityManager().merge(aMember); | } | If I execute this code, the entity is persisted 4 (!!!) times. I expected that it still is attached to the session and therefor only updates the values. If I use an already persisted entity and try to merge it - maybe as follows: | public void activateMember(Member aMember, Date entryDate) { | aMember.activate(entryDate); | getEntityManager().merge(aMember); | try { | getMailManager().sendActivationConfirmation(aMember); | throw new NotificationException("Big badaboom'!"); | } catch (NotificationException ex) { | String message = String.format("An error occured while sending ActivationConfirmation to '%s': %s", aMember.getEmail(), ex.getMessage()); | LOG.error(message, ex); | member.addActionLog(new ActionLog(message)); | getEntityManager().merge(member); | } | } | If this snippet reaches the second merge, it leads to either an OptimisticLockingException, if using the @Version or an EntityExistsException if I remove this annotation. Here comes the stacktrace: | javax.ejb.EJBTransactionRolledbackException: nested exception is: javax.persistence.OptimisticLockException | javax.persistence.OptimisticLockException | at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:643) | at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:600) | at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:237) | at org.jboss.ejb3.entity.TransactionScopedEntityManager.merge(TransactionScopedEntityManager.java:183) | at company.members.core.services.memberManager.MemberManagerBean.logAction(MemberManagerBean.java:136) | at company.members.core.services.memberManager.MemberManagerBean.activateMember(MemberManagerBean.java:125) | at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:121) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:110) | at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166) | at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44) | at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:101) | at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50) | at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118) | at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126) | at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
[jboss-user] [EJB/JBoss] - Merging an object twice
Hi, Iôve got a strange behaviour: If I call entityManager.merge(object) twice I get a OptimisticLockingException or alternatively an EntityExistsException using the embedded JBoss for test purposes. Is this the correct behaviour? As far as I knew, I could call merge() multiple time and the underlying implementation decides what to do. For a newly created entity call persist, otherwise re-manage the object or update itôs values. But there is not reason why calling merge multiple times causes an Exception. Or am I wrong? Did I misunderstood anything or is this a strange bug in the strange embedded jboss. Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4207156#4207156 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4207156 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Security & JAAS/JBoss] - Accessing Principal within Interceptor
Hi, I would like to access the current principal within a custom written Hibernate Interceptor - which is by nature no sessionBean. What would be the best way to access the current principal which called the EJB within this interceptor? Any chance to get the SessionContext without dependency injection? Or what would be the point to look for? THanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204224#4204224 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204224 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Beginners Corner] - Resource consumption of JBoss compared to single Tomcat
Hi @all, does anyone have any information how the JBoss 4.2.2 compares to a single Tomcat 6.0 concerning resource consumption, such as memory-usage, cpu-usage, open files etc. Simply comparing the features and everything else JBoss offers on top of Tomcat, I get the feeling, that it is really a lot more of resources, that a JBoss might need, but is it really that much? How good are the possibilities to reduce to unnecessary features and services to reduce the JBoss to the minimum of what is really needed? Thanks for any input Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204114#4204114 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204114 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Deploying multiple ears with
@jaikiran Thanks for your answer. It was a little bit circumstantial, as there are some struggles with the current maven ear plugin, but that was finally the solution Now it works!! Thanks! Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203724#4203724 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203724 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Re: Deploying multiple ears with
Thanks for the idea. I´m currently using the hibernate jars from the /server/default/lib directory and no further jars are included in my ear. Unfortunatley the "UseJBossWebLoader" does not have any effect on this. But maybe this is because it is not an web application, but an ear containing one jar with Entity-classes and one jar with the server-ejb3-sessionbeans. Any other idea? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203646#4203646 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203646 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Deploying multiple ears with
Hi, I am currently facing the following problem: I need to configure my ear for multiple environments. Therefor I used the hibernate.properties in the root folder of the ear to configure my persistence-layer. This works perfectly so far, because Hibernate finds the properties through itôs Environment and loads them. BUT: if I now deploy another ear, holding a hibernate.properties for configuring the second application, the hibernate.properties are simply ignored and - even more - the hibernate.properties from the first deployment are used for my second deployment as well. While looking in the Hibernate source code I saw that the corresponding variable is defined as a static variable. private static final Properties GLOBAL_PROPERTIES; It seems as if this class will be loaded only once and the first deployment wins. I already tried to work with isolated classloaders and set the value for | true | in the ear-deployer.xml to false. But this didnÃÂôt make any difference. Does anyone has an idea how to use multiple hibernate.properties or any other way to handle multiple configurations for the persistence-layer? Thanks for any input Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203330#4203330 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203330 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Best way for dynamic configuration?
Hi, I just created a timer-bean running a custom job at a defined interval. This service is annotated with @Service and @Management, so that it is startable/stoppable via the JMX-Console. Now I would like to add some properties that can be changed by the user - for example the interval between two timeouts etc - and does not need any repackaging or redeploying of the application. So what would be the recommended way for this configuration? Configuration file? Database-values? MBeans? Preferably it would be great if I can simply inject these properties from somewhere into my EJB - but this is not a must. Any ideas about this - probably very common requirement - would be greatly appricated. Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176075#4176075 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176075 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Context lookup
Is there any chance to lookup an implementation of a SessionBean using simply the interface and not constructing a JNDI-Name where I would have to care about the prefix wheather it has been deployed in an ear or not? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169577#4169577 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169577 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: 5.0.0CR1: EJB refs across EARs don't work
And in which jar do I find the org.jboss.ejb3.annotation.LocalBinding? I only found it in the embedded JBoss, but this is definately not what I´d like to include in my jar-dependencies. And what is the reason, that there are two annotations LocalBinding? There is also one in org.jboss.annotation.ejb.LocalBinding that can be found in the jar "jboss-annotation-ejb-4.2.3.GA" Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169575#4169575 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169575 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Injecting SessionBean into Thread
Hi, is there any chance to inject a SessionBean directly into a Thread via an annotation instead of using a JNDI-Lookup? Iôve got the case, that I use a TimerBean that starts an own Thread for every file it finds in a hotfolder. Later on this Thread should access a SessionBean through itôs local interface. As the Thread is no SessionBean I couldnôt think of any solution to simply inject the ejb but maybe I overlooked something. Does anyone know of a solution to this problem? Thanks in advance Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169564#4169564 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169564 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Best way for dynamic user configuration
Hi, I just created a timer-bean running a custom job at a defined interval. This service is annotated with @Service and @Management, so that it is startable/stoppable via the JMX-Console. Now I would like to add some properties that can be changed by the user - for example the interval between two timeouts etc - and does not need any repackaging or redeploying of the application. So what would be the recommended way for this configuration? Configuration file? Database-values? MBeans? Preferably it would be great if I can simply inject these properties from somewhere into my EJB - but this is not a must. Any ideas about this - probably very common requirement - would be greatly appricated. Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168665#4168665 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168665 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Exception-Handler an Transitions
Appendix to my previous post: Furthermore I just realized, that the transition to the initially target-node is still executed and the process goes to its initial target node and not in the manually rerouted node. So this works also not as expected as the initial target node should not be reached in any case, if an exception occured, that will be handled by my ExceptionHandler. Any ideas? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164428#4164428 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164428 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Exception-Handler an Transitions
Hi @all, I am calling an Action in a transition as followes | | | | | | | | | | | As there might occur an Exceptions the InvoicingActionHandler I defined a "global" exception-handler | | | | This exception handler is perfectly called and I set the token to the source node of the transition. | public class ProcessFailedExceptionActionHandler implements ActionHandler { | | private static final Logger log = Logger.getLogger(ProcessFailedExceptionActionHandler.class); | | public void execute(ExecutionContext executionContext) throws Exception { | | Node sourceNode = executionContext.getTransitionSource(); | Throwable throwable = executionContext.getException(); | | log.info(String.format("Caught exception %s. Re-routing to source node: '%s'", throwable.getMessage(), sourceNode.getName())); | final Token token = executionContext.getToken(); | token.setNode(sourceNode); | } | } | Unfortunately the code of the action handler defined as "node-enter"-ActionHandler of the target-node is still called, although I re-route the node manually and it should not enter the initially target node anymore. Is there a way to prevent this behaviour? Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164426#4164426 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164426 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: Exception handling in JBPM
maybe this helps: Throwable throwable = executionContext.getException(); View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164405#4164405 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164405 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Override @Id with different generators
Hi, is there a chance to override the defined generator for the @Id? For example if IÃÂÃÂÃÂôd like to define the @Id in a superclass and only change the value of the db-sequence to use? For example something like this: | @MappedSuperclass | public class BaseEntity { | | @Id | @GeneratedValue(generator="idGenerator") | @SequenceGenerator(name = "idGenerator", sequenceName ="base_entity_id_seq") | protected long id; | | .. | } | | @SequenceGenerator(name = "idGenerator", sequenceName = another_id_seq") | public class AnEntity extends BaseEntity { | | } Any input is greatly appriciated Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162499#4162499 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162499 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: A question to the DecisionNode
it only does, if I do not specify 2 conditions. Otherwise it works flawlessly! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156916#4156916 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156916 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: A question to the DecisionNode
Unfortunately the same behaviour if I use totally different transition names. If I do not specify the condition in the second transition, it always uses this transition, although the first transition has already resulted to true. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156718#4156718 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156718 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Parameter and other EL-related questions
Hi, is there any chance to pass parameters within EL as you can for example with the Seam enhanced EL? For example I would like to do the following | {myVar.setFoo('bar')} | Further is there any chance to reference an enum-value within an EL? For example: | {myVar.foo == MyEnum.BAR} | Thanks for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156690#4156690 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156690 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: A question to the DecisionNode
I will try this and rename my transition and let you know, if that worked. But I am right, that the correct bahaviour should be, that the first transition, that results to true, should be taken and - if no condition has been defined - this should automatically result in a true-result. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156613#4156613 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156613 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - Re: DecisionHandler in a state node
okay. But this way it is not the "real" DecisionHandler, which returns the name of the transition, but I would do the decision programmatically via an action-handler. Did I get you right? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156612#4156612 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156612 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - A question to the DecisionNode
Hi, I´ve got a question concerning the DecisionNode. As far as I can read from the documentation the first transition, that resolves to true within a DecisionNode will be used. Unfortunately I experienced a different behaviour for my test-process. This is part of what I have defined: | | | | | | |System.out.println(executionContext.getNode().getName() + " entered"); | | | | | | | | | | | | | | | | | | | | | | | | In my first state a set the variable through a java test-class using | pi.getContextInstance().setVariable(orderingstate, 1); | So as I would say, in the first decision-node (named "isExceedingOrdered") after the starte-node, the first transition should result in false and then use the second transition (named "no"), because it does not have condition, therefor should result in true and then wait in the state "ordered". Unfortunately this works only if I put a condition in the second transition as well (as seen commented in my code above) otherwise it goes directly in the state-node "built". But this is only the case, when I define my transition "no" in "isExceedingBuilt" at first, no matter of what the result of the condition is. So this seems a bit strange to me, but possiblly I misunderstood something. So maybe someone can point me to the right direction. Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156355#4156355 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156355 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss jBPM] - DecisionHandler in a state node
Hi, I´m just getting into the whole jbpm-thing, and after reading the documentation and playing around a bit, I asked myself the following question: I´m not sure, if this is against the current jbpm or workflow concept, but as it is possible to define several transition within a state-node with their individual conditions etc., I was wondering if it shouldn´t be possible to define a DecisionHandler here as well as you already can in the decision-node? Or should I be forced to use the decision-node in that case? Any input is greatly appriciated Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156270#4156270 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156270 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB/JBoss] - Removing entity does not work!
Hi, somehow removing entities does not work using the embedded JBoss for my tests. If I open my own transaction within my test-class and try to delete an entity, everyting works fine. If I call my SessionBean, having exactly the same piece of code, it fails. Even if I try to merge my entity before removing it, does not solve the problem and merge() does not throw an exception at all. This sounds like a very strange behaviour, so I was asking myself, if this might be an problem related to the embedded jboss. Does anyone know, if there is still a bug? FYI: This is my stacktrace when trying to remove the entity within my SessionBean | An error occured while removing Picture with id 12 with error-message: Removing a detached instance com.company.user.Picture#12 | at com.company.ControllerBean.deletePicture(ControllerBean.java:218) | 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:597) | at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:121) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:110) | at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166) | at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79) | at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:193) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:64) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:166) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:249) | at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214) | at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:86) | at $Proxy104.deletePublisherPicture(Unknown Source) | at com.company.ControllerBeanTest.testDeletePicture(ControllerBeanTest.java:293) | Caused by: java.lang.IllegalArgumentException: Removing a detached instance com.company.PublisherPicture#12 | at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45) | at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:86) | at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:52) | at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:766) | at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:744) | at org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:246) | at org.jboss.ejb3.entity.TransactionScopedEntityManager.remove(TransactionScopedEntityManager.java:189) | at com.company.ControllerBean.deletePicture(ControllerBean.java:213) | ... 62 more | Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126947#4126947 Reply to the post : http://www.jboss.com/index.htm
[jboss-user] [EJB 3.0] - Re: Generate ID when creating entities
Tim, thanks a lot for your answer! It seems as if this solution only works in a bi-directional one-to-one relation? Is that true? In my case, I don´t have the "Parent"-object in my "Child" as a back-reference. So is it a "must-requirement" to have a bi-directional relation or is there also a way for a uni-directional relation? Thanks for help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124693#4124693 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124693 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - @Embedded objects within inheritance-strategy
Hi, I have the problem, that when I use an @Embedded object within my inheritance-strategy, the entities will not be fetched correctly. When I change the annotation to @Transient, all corresponding entities are fetched correctly. This is an example of my class structure: | @Entity | @Table(name="baseClass") | @Inheritance(strategy=InheritanceType.JOINED) | public abstract class BaseClass implements Serializable { | | } | | | @Entity | @Table(name = "extendedClass") | @PrimaryKeyJoinColumn(name="id_baseClass") | public class ExtendedClass extends BaseClass { | | ... | | @Embedded //@Transient works | private EmbeddableClass embedded = null; | } | | @Entity | @Table(name = "anotherExtendedClass") | @PrimaryKeyJoinColumn(name="id_baseClass") | public class AnotherExtendedClass extends BaseClass { | | ... | } | | | @Embeddable | public class EmbeddableClass implements Serializable { | | @Column | private boolean aValue; | | @Column | private boolean anotherValue; | | } | | @Entity | @Table(name = "users") | public class User extends SimpleUser implements Serializable { | | @OneToMany(mappedBy = "anotherEntity", cascade={CascadeType.ALL}, fetch=FetchType.LAZY) | private Collection baseClassCollection = new Vector(); | } | | So when I keep the @Embedded-Annotation, I have all objects of the ExtendedClass, but none of the AnotherExtendedClasses. Together with the @Transient-annotation, I receive all entities of all inherited-classes from the database. Anyone having an idea, why this is not working? Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124429#4124429 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124429 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Generate ID when creating entities
Hi, is there a chance to let the EntityManager create the ID at creation-time of an entity? I´ve got the problem, that I want to share one id between multiple entities while having a unidirectional one-to-one relation. This way I only have a generated value at the parent-object and for the dependent entities I have to set the id manually (to the same id, as the parent). Unfortunately the id is only generated when persisting the entity (before that the value is null), so it´s hard to propagate an object-reference to the dependant entities (even with @PrePersist as I would have to parse the parent-object). So what I could do is to manually get the next value from my sequence and set this as an id for every entity. But if the id would be generated when a new entity is created, there won´t be a problem at all. Is there a way to achive this? Any input would be greatly appriciated. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124303#4124303 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124303 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Using joda time in entites
This is one solution I though of as well. But maybe there is already an "integrated" solution as it is in hibernate. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122552#4122552 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122552 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Using joda time in entites
Hi @all, does anyone know, if there is a chance to use the joda time library as the default date-implementation with ejb3? I´m currently facing the following problem. I would like to use the DateTime objects of the joda library within my entities instead of using the plain, old and buggy java.util.Date implementation. If I simply replace the object-types all DateTime-objects are stored in the database as VarBinary. But I would like to use them as a timestamp or date sql-type. I saw, that there is a subproject from joda, that uses the @Type annotation from hibernate to convert them to different SQL-Types. But until now I´m absolutely independent from any persistence-framework, because I simply rely on the javax.persistence-standard, so I would not prefer to mix it now with any hibernate-specific annotations. But maybe there is something similiar, so I can use it anyway. Does anyone know of a good solution to this problem? Thanks for your answers Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122141#4122141 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122141 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Automatically create schema in database
Hi, is there any chance to let the EntityManager automatically create a schema? I defined a default schema for my entities through setting the property 'hibernate.default_schema' in the persistence.xml, but unfortunately it is only possible to deploy these entities, if the schema already exists in the database. I thought of something equal as it is already possible for automatic creation of database-tables for the entities if the property 'hibernate.hbm2ddl.auto' has been defined to 'create'. Thanks for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120317#4120317 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120317 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: JPDL in Seam 2.0
okay... found it myself. The namespaces for the jpdl-definitions have changed - but in the reference for 2.0.0 there´s still the same syntax. Thanks to the examples I found that it should be | | | registerUser.jpdl.xml | createItem.jpdl.xml | | | Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098582#4098582 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098582 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - JPDL in Seam 2.0
Hi, I´m just migrating my application from Seam 1.2.2 to 2.0.0 together with Trinidad 1.2.2 and wondering if anything might have changed using JPDL between these versions. When trying to use the jpdl in Seam 2.0 I get the following Exception after clicking the link. Any ideas what might have changed or might be the cause? | javax.el.ELException: javax.ejb.EJBTransactionRolledbackException | at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:332) | at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341) | at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) | at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) | at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) | at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174) | at org.jboss.seam.navigation.Pages.callAction(Pages.java:636) | at org.jboss.seam.navigation.Pages.preRender(Pages.java:289) | at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:544) | at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:455) | at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146) | at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116) | at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222) | at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) | at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241) | at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198) | at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141) | at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) | at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85) | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) | at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) | at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44) | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) | at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141) | at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281) | 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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68) | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) | at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:150) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) | at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) | at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179) | at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) | at org.apache.catalina.core.StandardHostValv
[jboss-user] [JBoss Seam] - Re: Seam + Maven/Ant
Maybe you have a parent-pom included in your pom, where you have already declared a version? Just an idea! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094121#4094121 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094121 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam + Maven/Ant
Then you should probably do, what you´ve been told by this error-message. Add a version to your artifact you´d like to use. For example a full artifact should look like this: | | javax.mail | mail | 1.4 | | By the way: you can also have a look at http://www.mvnrepository.com. There you simply have to search for the artifact you are looking for and the complete code for inserting into your pom is done as well. So it´s only copy & paste. Good luck Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094082#4094082 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094082 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Cleaning database through hibernate
Hi, is there a good way to clean the whole database through hibernate? The background is as follows: I want to clean the database every time before starting a new testcase, to make sure the database is empty and in a defined state. Currently I´m doing this through dropping the scheme and restarting the session, but this takes very long. Therefor a CREATE-DROP in the hibernate-configuratoin would not be very suitable as well, as I want to prevent hibernate from doing the mapping everytime. I tried doing it through the Criteria-API, fetching all java.lang.Objects and performing a session.delete(object) on every object, but this leads to a not-null or transient object exception, although I did it in one transaction with setting the flushMode to "commit". The other way I tried was doing this through HQL, but this leads to the problem, that I´m working with @CollectionOfElements which I cannot reference through hql (or at least I haven´t found a way to do it), but the HQL does explicitly no cascades. Any help would be greatly appriciated. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088738#4088738 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088738 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Clean complete database
Hi, is there a good way to clean the whole database through hibernate? The background is as follows: I want to clean the database every time before starting a new testcase, to make sure the database is empty and in a defined state. Currently I´m doing this through dropping the scheme and restarting the session, but this takes very long. Therefor a CREATE-DROP in the persistence manager would not be very suitable as well, as I want to prevent hibernate from doing the mapping everytime. I tried doing it through the Hibernate Criteria-API, fetching all java.lang.Objects and performing a session.delete(object) on every object, but this leads to a not-null or transient object exception, although I did it in one transaction with setting the flushMode to "commit". The other way I tried was doing this through HQL, but this leads to the problem, that I´m working with @CollectionOfElements which I cannot reference through hql (or at least I haven´t found a way to do it), but the HQL does explicitly no cascades. Any help would be greatly appriciated. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088415#4088415 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088415 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Excel support in Seam: any interest?
Hi, so what is the current status of this excel-export feature. Is it working already and included in any Seam-release? I´m going to propose Seam for a new project now and I know that it´ll be of great benefit if I can tell them, that excel-export is no problem with Seam (would I would like to do). Any update on this topic would be highly appriciated. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032675#4032675 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032675 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: SEAM - TRINIDAD - @Restrict
Don´t define any view-handler in the faces-config.xml. That won´t work. You can try to replace the sun-facelet view handler with the SeamFaceletViewHandler. Only replace the corresponding entry in the web.xml from the sun FaceletViewHandler to the SeamFaceletViewHandler. Maybe that might work Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029058#4029058 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029058 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: DataModelSelection with two beans without using session
sorry - not yet! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029029#4029029 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029029 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Redirect to error-page for AuthorizationException with @
As a lot of people still have the same problems, would this be something to file in JIRA? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029028#4029028 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029028 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Relations with WHERE-clause
Hi, is it possible to restrict related entities while fetching the data? For example, if I have a one-to-many relationsship and I want to fetch all entries from my "many-relation", that are flagged as active through the annotation in the entity-class. Or if beeing a little bit more complex, add an additional flag in the n:m-cross-table on which to decide if the related entity should be fetched or not through the annotation? Or do I have to do it through a manuel eql-query? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025834#4025834 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025834 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Do we need failed page access logged as ERROR
I´d also prefer not to log the whole exception as this is more like a standard-issue and logging the whole stack-trace always looks like having a problem or a bug in the application, which is not really the case if the user is not logged in. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024822#4024822 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024822 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Trinidad / ajax4 jsf doesn´t work anymore in Seam 1.2.0
Great to hear that. Thank you! Then the work was worth it. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024713#4024713 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024713 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Back button after logout - solved through Seam?
But if you tell the browser not to cache anything, this works. I used this together with Struts, where I had to change the RequestProcessor. There are some examples on how to solve this out in the net. But I don´t really like them, as you have to use jsp:scriptlet for that. But I see, that it´s not possible at the moment. But as I already said: I think this would be something, that should be added. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024689#4024689 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024689 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Documentation on how to set up Seam together with Trinidad a
Hi @all, After I spent a lot of time in setting up Seam, Trinidad, Facelets and ajax4jsf together and want to share my experiences with others I set up a small wiki-page at the apache-wiki yesterday, in which I wrote a short description about what I did to make Seam, Trinidad, Facelets and ajax4jsf work together. Anyone who is interested in how to set up these components to work together or has some ideas to improve this settings is invited to have a look at the following url and share his ideas. You will find it at http://wiki.apache.org/myfaces/TrinidadSeamAjax4JsfFaceletDetail I hope it helps some people to get these great components together. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024663#4024663 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024663 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Setting up an ajax4jsf + trinidad project
Be careful, which version of Seam you are using: The one atao is using is for Seam 1.1.6 whereas dustismo´s is for 1.2.0. But as far as I can see from the exception you simply did not include the trinidad-jars properly. Check if you´ve got both jars, the "impl" and the "api" and also include them in your manifest.mf of your jar. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024658#4024658 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024658 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Back button after logout - solved through Seam?
Hi, I just included the Seam Security into my application and I´m really thrilled about the very easy and effective solution to all the security issues. I like the "redirect-to-protected-pages-through-login-page"-feature especially. It´s always a common problem and it´s so easy this way. This is really the first really good webbased security system, I´ve seen so far. Congratulations to this. But I come to another standard web-application-problem: pressing the back button after logout. Is there an elegant way through the seam security feature to prevent users from seeing protected pages with pressing the back-button? I know, that there are some options for preventing the browser from caching (e.g. through jsp:scriptlet), as the usual meta-tags aren´t enough in most cases, but I think this is not a very elegant solution and I´d prefer to set these header-information through something like the SeamServlet or the FacesServlet. Is there already anything included in Seam? If not, wouldn´t that be anything, that should be included? Thanks for your answers Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024655#4024655 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024655 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - How to instantiate a Seam class out of a backing bean
Hi, how do I instantiate a stateless Seam Bean out of another Seam backing bean, so that all Seam-annotation are still included? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024638#4024638 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024638 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Trinidad / ajax4 jsf doesn´t work anymore in Seam 1.2.0
Joseph, I wrote a little wiki page about that. Have a look at http://wiki.apache.org/myfaces/TrinidadSeamAjax4JsfFaceletDetail I also attached a sample web.xml there. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024580#4024580 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024580 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Redirect to error-page for AuthorizationException with @
If it´s of any importance: I´m using trinidad as well, but this shouldn´t be a problem, should it? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024379#4024379 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024379 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Redirect to error-page for AuthorizationException with @
I did it this way: | | Seam Filter | org.jboss.seam.web.SeamFilter | | | | Seam Filter | /* | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024378#4024378 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024378 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Redirect to error-page for AuthorizationException with @
sorry, but I did it the same way like in the examples. But it´s still the same. It works if the restriction comes through the pages.xml but not if it comes through the backing-bean. Any further suggestions? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024369#4024369 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024369 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Trinidad / ajax4 jsf doesn´t work anymore in Seam 1.2.0
well - I also used ajax4jsf together with 1.1.6 without any problems. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024360#4024360 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024360 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Redirect to error-page for AuthorizationException with @
okay - I will have a look. BTW: Is there any way to include the role through a static variable from an interface, so that you can replace @Restrict("#{s:hasRole(''admin)}") with anything like this @Restrict("#{s:hasRole(SecurityRoles.ADMIN)}") ? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024347#4024347 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024347 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Redirect to error-page for AuthorizationException with @Rest
Hi @all, when I define a restriction like #{s:hasRole('admin')} in my pages.xml and the authorization failes with an AuthorizationException I get the error-page defined in the pages.xml. But if it fails because of a @Restrict("#{s:hasRole('admin')}")-annotation in the backing-bean I get the usual error-page. Is there a way to redirect the the error-page as well? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024311#4024311 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024311 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Trinidad / ajax4 jsf doesn´t work anymore in Seam 1.2.0
You were right, that´s it! Thanks a lot. These forums are just great. I would have never come to this idea! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024258#4024258 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024258 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Trinidad / ajax4jsf do esn´t work anymore in Seam 1.2.0
Hi @all, I greately appriciate all the work you did for the release of 1.2.0 and I really understand, that it is necessary to break with the old architecture at a special point. But unfortunately I have the problem now, that I can´t upgrade from 1.1.6 to 1.2.0 due to an incompability between Seam 1.2.0 / Trinidad and ajax4jsf. This is probably because of the restructuring of the Seam-Filters that went through some major changes - and the result is that my working application doesn´t work with the new release anymore. I now, that you don´t support Trinidad, because it has not left incubator-status yet, but I think, there are still some people out there, who work with that library anyways. So maybe the problem is not that serious and you could tell me how to make it work again. This is the exception I get now: java.lang.NullPointerException | at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:168) | at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:144) | at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:135) | at com.sun.facelets.tag.ui.UIDebug.writeDebugOutput(UIDebug.java:92) | at com.sun.facelets.tag.ui.UIDebug.encodeBegin(UIDebug.java:81) | at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:247) | at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:280) | at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:73) | at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:137) | at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:153) | at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:79) | at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:184) | at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:701) | at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:252) | at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249) | at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249) | at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573) | at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182) | at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101) | at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:221) | at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41) | at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132) | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:210) | at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:167) | at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:140) | at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:93) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63) | at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57) | at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49) | at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) | at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49) | at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:74) | at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49) | at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) |
[jboss-user] [JBoss Seam] - Re: integration with Trinidad (ADF)
okay. After doing some more research on that topic, I solved this problem myself. All you have to do is to include the aj4-trinidad.jar, provided at the ajax4jsf website and everything works smoothly. Although I used the 1.0.6 you still need the 1.0.5-a4j-trinidad. This was a bit confusing as I thought it might already be included in the newer version. Maybe someone might get into the same problem - so this might help. Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023539#4023539 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023539 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Trinidad PPR/Ajax and Seam
Is this only necessary when using the PPR of Trinidad and if using ajax4jsf there is no need or is this a general "must-do" if using trinidad together with seam correctly. Could you give some more detail on the PhaseListener. Is it necessary to write an own PhaseListener that overrides the methods mentioned about or is it necessary to change code of the current PhaseListener provided with Seam? Afterwards: are there any settings that have to be done in the web.xml or faces-config.xml? Some more details would be greatly appriciated. Thanks for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023537#4023537 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023537 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: integration with Trinidad (ADF)
BTW: this error only occures if using an ajax-rerender. Otherwise it works quite fine: Example: | | | | | | | | | | | | | | ... | | | ... | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021990#4021990 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021990 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: integration with Trinidad (ADF)
Is the a4j-trinidad.jar still necessary for ajax4jsf 1.0.6 or is it integrated into that package now? I´m facing a similar issue but already use 1.0.6. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021987#4021987 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021987 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - DataModelSelection with two beans without using session scop
Hi, is there a possibility to use the @DataModelSelection over two different beans without using the session-scope for injection? Right now it works if I use the bean with the @DataModel and the @DataModelSelection with session-scope and use this value through an @In annotation in my other bean. But what I don´t like is that I set the value in session-scope then, so that a create=true with the @In-Value might not work because of old values. But everytime I change the scope of the @Out-value to anything other than session, I don´t have any value in my other bean anymore. Some code for further details: | @Stateful | @Name("ActionBeanA") | @Scope(ScopeType.SESSION) | public class ActionBeanA implements IActionBeanA{ | | @DataModel | private List itemList; | @DataModelSelection | @Out(required=false, scope=ScopeType.SESSION) | private Item item; | | | @Stateful | @Name("ActionBeanB ") | @Scope(ScopeType.CONVERSATION) | public class ActionBeanB implements IActionBeanB { | | @In(required=true, create=true) | private Item item; | | Thanks for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018845#4018845 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018845 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Navigation outcome from bean
Yes - it seems, that it works that way. If a null value is returned, I will be redirected to the page I came from if I include the -Tag Thanks for that View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017714#4017714 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017714 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Navigation outcome from bean
sorry - I didn´t refresh the thread before posting. I guess you already told the solution through your explanation. I´ll try this first. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017684#4017684 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017684 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Navigation outcome from bean
Mike, your idea came pretty close to how it works. Thanks for your help. This is it worked for me now: | | | | | | But do you know if it is possible to redirect to the page, where I came from as well? If I call an action-method and it returns a String with null, I will be redirected to the page I came from automatically. So is there a way to define this through the pages definition as well? I thought about something like this: | | | | | | | | Is there a way to do something like a switch-case if there might be different-results? In the code-example mentioned above, the anotherAction is probably called everytime I have a new rule. DO you know anything about this? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017675#4017675 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017675 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Navigation outcome from bean
sorry - I really did not explain it really clearly. The idea is the following: I have two different xhtml-pages with an command button on each page referencing to the same ActionBean and calling the same methods, but the result of that action always points to the same result-page. So is it possible to define that whenever this bean is called - doesn´t matter from what page - it should redirect to a defined outcome with only one definition in the pages.xml or navigation.xml? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017632#4017632 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017632 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Navigation outcome from bean
Thank you very much for that. I totally overlooked that part. But it´s still neccessary to have a view-id that is a real xhtml-page. There´s no way to use the outcome of a bean-action for multiple pages, is there? So that I could use the outcome of an action for multiple pages? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017617#4017617 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017617 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Navigation outcome from bean
Hi @all, when I browsed through the forum I stumbled about a thread, telling how to user navigation outcomes out of a bean and not a view. Unfortunately I cannot find this thread anymore. Can someone give me a hint or a code-example for this? Thanks for your help and sorry for the inconvenience Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017597#4017597 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017597 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: EntityManager violates foreign key constraint
I did a little further debugging and found out, that it has to do with the optional=false If I remove that attribute, it works without any problems. Anyways: is this the way it should work? I think this behaviour is still a little bit strange and I´m still not satisfied with this non-handled exception. Is there anyone, who´s familiar with the ejb3-workflow in this case? Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012510#4012510 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012510 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - EntityManager violates foreign key constraint
Hi, I experienced a strange behaviour while persisting entities into my database. Event though the entity-Manager did not throw an exception while calling persist, I get an org.hibernate.exception.ConstraintViolationException afterwards. This leads to two problems: 1. How is it possible, that the EntityManager does not throw an exception in that case? Because if there are no problems while persisting to the database I keep on going in my code and trust in an successfull flush to the database as I cannot react on any Exception that occur later on 2. How is it possible, that the sequence in the batch-update is not as it is supposed to be? In my case the batch-updates tries to insert an entity, that is dependand on another entry (mapped through the annotations), which is not inserted yet and leads to an violation of a foreign key constraint. As I cannot change the foreign-key constraint, because I´m working on an existing database, I have to rely on the mechanism of the EntityManager and that the EM checks all possible constraint. Did I miss anything or is this meant to be this way? Here is what I tried. Let´s start with the bad part - the exception ;-)) | 13:22:42,794 INFO [STDOUT] PrePersisting PublisherBalance: entity.PublisherBalance[id=1, value=0] | 13:22:42,794 INFO [STDOUT] PrePersisting publisher: entity.Publisher[id=1] | 13:22:42,844 INFO [STDOUT] Publisher created successfully | 13:22:42,844 INFO [STDOUT] [User]: PreUpdate for user.id: 1 | 13:22:42,854 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null | 13:22:42,854 ERROR [JDBCExceptionReporter] Batch-Eintrag 0 insert into publisher_balance (value, id) values (0, 1) wurde abgebrochen. Rufen Sie getNextException auf, um die Ursache zu erfahren. | 13:22:42,854 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 23503 | 13:22:42,854 ERROR [JDBCExceptionReporter] ERROR: insert or update on table "publisher_balance" violates foreign key constraint "fk_publisher_balance_publisher" | Detail: Key (id)=(1) is not present in table "publisher". | 13:22:42,854 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session | org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update | at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) | at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) | at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249) | at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92) | at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87) | at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:218) | at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2159) | at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2595) | at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51) | at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) | at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232) | at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139) | at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) | at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) | at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) | at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) | at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515) | at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491) | at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110) | at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324) | at org.jboss.tm.TxManager.commit(TxManager.java:240) | at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175) | at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87) | at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) | at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
[jboss-user] [EJB 3.0] - Re: ID-Handling
noone knows about a solution to this? is this so unusual? or is it too obvious? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008774#4008774 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008774 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: trinidad and jpdl / trinidad and the seam EL-extension
Mmh.. the longer I go into details between icefaces and trinidad I get more and more confused. What would you say is the better choice if you start from scratch? It looks like Seam has a very high integration for ice-faces, plus it looks really sexy, but trinidad seems to be longer on the market. I don´t think it´ll be good to mix them up. Do you have a recommendation what you´d do? Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008381#4008381 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008381 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: trinidad and jpdl / trinidad and the seam EL-extension
Do you have a good source where to ask those questions? Do they have a forum as well? Or is this only this mailing list? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008347#4008347 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008347 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Strange behaviour of Seam together with JSF RI 1.2 and Trini
Hi @all, thanks to the various post I got myfaces running together with trinidad and I also got JSF RI running together with trinidad. But the strange thing is, that with the JSF RI Version I receive double-page-headers, but only if I refer to the same page with returning null from an actionBean or after returning to the same page with failed validation. As far as I could work it out it might have anything to do with the view-handler configurations. If I use the jsf RI together with org.jboss.seam.ui.facelet.SeamFaceletViewHandler and remove the trinidad-configuration everything works fine. But to use trinidad as well I have to add the following 2 lines to the faces-config | | org.jboss.seam.jsf.SeamELResolver org.apache.myfaces.trinidad.core Does anyone know the correct setting or configuration to have this combination (JSF RI 1.2, Trinidad M1, Seam) work. This is what I got so far: faces-config.xml | | http://java.sun.com/dtd/web-facesconfig_1_0.dtd";> | | | | | org.jboss.seam.jsf.SeamPhaseListener | | | | | org.jboss.seam.jsf.SeamELResolver | org.apache.myfaces.trinidad.core | | de_DE | de_DE | en_US | | | | | | web.xml | | http://java.sun.com/xml/ns/j2ee"; | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; | xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> | | | | org.jboss.seam.servlet.SeamListener | | | | | | | | | | com.sun.faces.config.ConfigureListener | | | | com.sun.faces.verifyObjects | true | | Set this flag to true, if you want the JavaServer Faces Reference | Implementation to verify that all of the application objects you | have configured (components, converters, renderers, and validators) can | be successfully created. Default value is false. | | | | | | com.sun.faces.validateXml | true | | Set this flag to true, if you want the JavaServer Faces Reference Implementation | to validate the XML in your faces-config.xml resources against the DTD. Default value is false. | | | | | | | | | | javax.faces.DEFAULT_SUFFIX | .xhtml | | | | javax.faces.STATE_SAVING_METHOD | client | | | | facelets.DEVELOPMENT | true | | | | org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER | com.sun.facelets.FaceletViewHandler | | | | | Ajax4jsf Filter | ajax4jsf | org.ajax4jsf.Filter | | | | trinidad | org.apache.myfaces.trinidad.webapp.TrinidadFilter | | | | Seam Exception Filter | org.jboss.seam.servlet.SeamExceptionFilter | | | | Seam Redirect Filter | org.jboss.seam.servlet.SeamRedirectFilter | | | | | ajax4jsf | Faces Servlet | REQUEST | FORWARD | INCLUDE | | | | trinidad | Faces Servlet | | | | Seam Exception Filter | /* | | | | Seam Redirect Filter | *.seam | | | | Faces Servlet | javax.faces.webapp.FacesServlet | 1 | | | | | Faces Servlet | *.seam | | | | | | | | | | | | | | | Thanks for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008345#4008345 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008345 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: trinidad and jpdl / trinidad and the seam EL-extension
Okay. thanks anyways. Currently I´m quite happy because with your help it works for me after all. It´s always a big benefit to have this forum. This way it´s possible to have a nice weekend without frustrations from the week, but instead a good feeling ;-) Thanks again! But I still have a question: 1. Do you know, if there Is a chance to use the hibernate validation annotations inside the ejb3-entities? It seems as if s:validateAll does not have any effect anymore. Can you confirm this? 2. How come, that the messages displayed through tr:messages are different than the message defined through the requiredMessageDetail, whereas tr:message uses the same value? Is there a chance to let tr:messages also display the details? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006833#4006833 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006833 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: trinidad and jpdl / trinidad and the seam EL-extension
Perfectly - exactly as I wanted. Thanks a lot petemuir. Just a short question: I´m running a h:form together with the tr:inputText. This way I can work with my jpdl. Is that how you did it as well - or do you have a complete trinidad-form? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006815#4006815 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006815 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Customize validation messages
Thanks for that - I guess that wasn´t too clear for me. So a component-library like Trinidad also uses a standard-jsf component like inputText, but extends them without keeping the jsf-specifications? So I´m kind of stucked to one component-library if I choose to use one? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006808#4006808 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006808 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: trinidad and jpdl / trinidad and the seam EL-extension
Petemuir, how did you disable the JS validation-popup? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006795#4006795 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006795 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - trinidad and jpdl / trinidad and the seam EL-extension
Hi, I just tried to get Trinidad to work with Seam and did quite well so far. But I have to questions: 1. It seems as if a trinidad-form doesn´t work with my jpdl-pageflows. If I use the together with the the submit doesn´t work. If I change it to together with it works, but I only get the validation-errors in a javascript pop-up window and not in the html-page. Is there a way to change this? If I try to use together with the fields don´t seem to be filled, as I always get the validation errors. Any solution to that? 2. Is the Seam extension to the EL not supported with trinidad? I tried to use the following syntax and got an exception. If I change it to a standard-el-expression everything works fine. Is there any configuration to make it work? | 11:22:53,224 ERROR [STDERR] 26.01.2007 11:22:53 com.sun.facelets.FaceletViewHandler handleRenderException | SCHWERWIEGEND: Error Rendering View[/home.xhtml] | com.sun.facelets.tag.TagAttributeException: /WEB-INF/pages/boxes/registerNewUser.xhtml @10,91 action="#{ registerUserAction.startRegisterUser() }" Error Parsing: #{ registerUserAction.startRegisterUse | r() } | at com.sun.facelets.tag.TagAttribute.getMethodExpression(TagAttribute.java:144) | at com.sun.facelets.tag.jsf.ActionSourceRule$ActionMapper.applyMetadata(ActionSourceRule.java:50) | at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36) | at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62) | at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:140) | at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) | at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109) | at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) | at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273) | at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143) | at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60) | at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) | at com.sun.facelets.tag.jstl.core.ChooseWhenHandler.apply(ChooseWhenHandler.java:45) | at com.sun.facelets.tag.jstl.core.ChooseHandler.apply(ChooseHandler.java:68) | at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109) | at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) | at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273) | at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143) | at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60) | at com.sun.facelets.tag.ui.DefineHandler.apply(DefineHandler.java:58) | at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:128) | at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:306) | at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:279) | at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68) | at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) | at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) | at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) | at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273) | at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143) | at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113) | at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) | at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) | at com.sun.facelets.impl.Defaul
[jboss-user] [JBoss Seam] - Re: Customize validation messages
So what would you guys say: which jsf-implementation works better for seam? Right now we have the Sun JSF RI, Trinidad and myFaces (which I´m currently working with). In the seam documentation it is said, that trinidad is the better choice. Are there any major differences or any deviation from the standard specification between the alternatives, that should be kept in mind? What about future development? Do I have to be afraid that one of them won´t be developed furthermore? What are your experiences? Right now I´m at the very beginning of development, so it´s still time to change. I don´t wanna realize that I did the wrong choice when it´s too late and I have to do a lot of rework then. Thanks for sharing your experiences Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006706#4006706 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006706 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Customize validation messages
Norman, can you please give a little bit more detail about using your code. Simply creating the class and using the s:input-tag leads to an exception. Sorry - but I haven´t done anything in the tag-libraries yet, so I´m not so familiar how to add a new Tag. I get the following exception: com.sun.facelets.tag.TagException: /WEB-INF/pages/registerUser/userDataForm.xhtml @53,142 Tag Library supports namespace: http://jboss.com/products/seam/taglib, but no tag was defined for na | me: input | at com.sun.facelets.compiler.CompilationManager.pushTag(CompilationManager.java:193) | at com.sun.facelets.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:194) | at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) | at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) | at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) | at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) | at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) | at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) | at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) | at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) | at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) | at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) | at javax.xml.parsers.SAXParser.parse(Unknown Source) | at javax.xml.parsers.SAXParser.parse(Unknown Source) | at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:232) | at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104) | at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:192) | at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:141) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:293) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273) | at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143) | at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60) | at com.sun.facelets.tag.ui.DefineHandler.apply(DefineHandler.java:58) | at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:128) | at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:306) | at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:279) | at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68) | at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) | at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) | at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47) | at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294) | at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273) | at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143) | at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113) | at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) | at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) | at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95) | at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510) | at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553) | at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101) | at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:222) | at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384) | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75) | at org.ajax4jsf.framework.ajax.xmlfilter.
[jboss-user] [EJB 3.0] - Up-/Downcasting from objects with partial db-update
Hi, I´ve got two objects, that are extended from each other. For example they look like this: | @Entity | @Table(name = "users") | @Name("user") | @Scope(ScopeType.SESSION) | public class User implements Serializable { | | @Column(name = "create_date", nullable = false) | @Temporal(TemporalType.TIMESTAMP) | private Date createDate; | | @Length(min=6) | @Column(name = "password", nullable = false) | private String password; | | @Column(name = "name", nullable = false) | private String name; | | | } | | @Entity | @Table(name = "extendedUser") | @Name("publisher") | @Scope(ScopeType.SESSION) | public class ExtendedUser extends User implements Serializable { | | @Column(name = "upgrade_date", nullable = false) | @Temporal(TemporalType.TIMESTAMP) | private Date upgradeDate; | | | } | I´ve also got 2 tables. One holds all the attributes for the user and the other one holds only the additional attributes of the extendedUser all with the same primaryKey. What I would like to do now is to upcast my User to an ExtendedUser, so that it keeps all the values in the user-table and creates an entry in my extended-users table with all additional values of the extended object. When I simply upcast my object and try to persist it with an em.merge(extendedUser) I get an Exception because it tries to persist a completely new extendedUser, which is absolutely correct, because it should only add the additional values and not create a new entry. Is there a way to do an upcast/downcast and adding/deleting only the additional attributes of the inherited objects? Thanks for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005398#4005398 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005398 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: PersistenceContext in distributed environment
So what would be the way to go then? Is there a best-practice or any recommendation what to prefer and what better not to do? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005208#4005208 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005208 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - PersistenceContext in distributed environment
Hi, I want to split up my seam application into 2 different application, so that I can use one JBoss as a webserver and another one as the application-server with the underlyng database. Therefor I use the EntityManager only on the application-server, so that all the updates etc. on the database all go through the same method. Now I experience problems when using my entities and want to use object, that are lazy-loaded. One example, I have a User-object with a UserLog: | @Name("user") | @Scope(ScopeType.SESSION) | public class User implements Serializable { | ... | | @OneToMany(cascade = CascadeType.ALL, mappedBy = "user", fetch=FetchType.LAZY) | private Set userLogCollection ; | | ... | | public Set getUserLogCollection() { | return this.userLogCollection; | } | | protected void setUserLogCollection(Set userLogCollection) { | this.userLogCollection = userLogCollection; | } | | public void addUserLog(UserLog userLog) { | if (this.userLogCollection == null) { | this.userLogCollection = new HashSet(); | } | this.userLogCollection.add(userLog); | } | | When I Login I query the EnitityManager through my application-server and return the user-object. When I try to add a new UserLog-Object using the methods of my entity object I get a LIE, probably because the user-object is detached: | 16:45:59,978 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: common.entity.User.userLogCollection, no session or session was closed | org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: common.entity.User.userLogCollection, no session or session was closed | at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) | at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) | at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343) | at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) | at org.hibernate.collection.PersistentSet.toString(PersistentSet.java:309) | at java.lang.String.valueOf(String.java:2615) | at java.lang.StringBuilder.append(StringBuilder.java:116) | When I do this through a method on my application-server together with a em.merge, everything works fine, because the entity becomes managed again. But this cannot be the solution, as would have to write a method for every lazy-loaded object on my application-server. | public User addUserLog(User user, UserLog userLog) { | User userTmp = (User) em.merge(user); | userTmp.addUserLog(userLog); | return userTmp; | } | I tryied to work with the Seam Managed Persistence Context, but as far as I could see in the documentation I have to initialize the EntityManager through the [EMAIL PROTECTED], which doesn´t seem very good, if I would like to have seam-independent controller-beans on my application server. What would be the best solution to work with lazily-loaded objects in a distributed environment? Does anyone have some experiences with that and therefor has a good recommendation? Thank you very much Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4004859#4004859 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4004859 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Some basic JPDL questions
Hi, I´ve got some basic JPDL-questions while trying to create a wizard for registering new user. I had a jpdl-flow, which started with the following JSF-Tag: | #{messages.userCreateUser} Now I changed this call to the following code-snippet, because I have to call a method to do something before the pageflow starts: | #{messages.userCreateUser} This goes together with the following jpdl-file: | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method startRegisterUser(), that´s called before jdpl starts looks like this: | @Begin(pageflow="registerUser") | public String startRegisterUser() { | System.out.println("Starting process startRegisterUser"); | | | return "next"; | } | Now I experience the following problems: 1. It seems, as if the pageflow doesn´t end properly. Although I have the -Tag in my jpdl-definition, I still get the values from the last conversation in my form, when clicking the link again after the old one has ended? Same thing if I use the @End annotation and call it within one method. Do I have to reset all objects used in my conversation manually or is there a way to invalidate them, so they don´t show up again? 2. When I click on my link and start my jpdl with the action, I get the following exception, but the pageflow works anyway. But I guess there´s a reason for it and I should solve this somehow. 14:01:26,135 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) beforePhase. | java.lang.IllegalStateException: No page context active | at org.jboss.seam.core.FacesPage.instance(FacesPage.java:87) | at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:219) | at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:51) | at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70) | at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373) | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75) | at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) | at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) | 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:156) | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) | at org.apache.coyote.http11.Http11BaseP
[jboss-user] [EJB 3.0] - ID-Handling
Hi @all, I have the following scenario: I´ve got a user-object that gets it´s ID through a @SequenceGenerator. Inside this user-object I´ve got an object VerificationCode. The ID of the VerificatinCode should be the same as the ID of the user, but the problem is, that I receive the id only while persisting, so I cannot instantiate the VerificationCode with a User-object and use it´s id with my getId()-method. One solution I found was to use the @PrePersist and do a MyVerificationObject.setId(myUserObject.getId()) in this method. But is this the way to go or is there a more elegant (object-oriented) way? Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4004773#4004773 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4004773 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Initialization of Seam Application
Gavin, thanks for your answer. Do you know of any work-around that would do in this case? Or is this simply not doable? Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002394#4002394 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002394 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Initialization of Seam Application
Hi, I have a problem accessing the properties of my seam application during startup. I´ve got the following Bean, that is started through the @Startup annotation. | @Name("commonDataHelper") | @Scope(ScopeType.APPLICATION) | @Startup | public class CommonDataHelper { | | @Logger | private Log log; | |... | | @Create | public void init() { | | } But when I try to access the following Properties I always get an exception, so I´ve got the idea, that it might not have been initialized yet. Is this assumption true, or do I have an other misunderstanding? NPE if trying to access the application: | Iterator locales = FacesContext.getCurrentInstance().getApplication().getSupportedLocales(); | Can´t receive the seam-RessourceBundle of my war, but only the one that lies in the sourcepath of my ejb-jar: ResourceBundle rb = org.jboss.seam.core.ResourceBundle.instance().getBundle(bundleName, locale); Anyone knows why? I saw, that I could add a depends-value at the @Startup-annotation. But what would be the value to depend on? Thank you Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002351#4002351 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002351 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: WrongClassException with inheritance
Thank you very much for this hint. But as far as I can see, I would have to define a DiscriminatorColumn in my superclass (AbstractBalance) from which I can decide between one of my inheritances, for every id in this table But in my case both tables (BalanceA and BalanceB) are referencing to the same id of the superclass and it is possible that either only an object of BalanceB or instances of both objects can exist. This is dependend of an existing entry in the related tables. Can someone give me an idea how to solve that? Thanks Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4001730#4001730 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001730 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - WrongClassException with inheritance
Hi, I have a problem with an inheritance-model and I´m not sure, if I´m trying to do something, that´s not possible this way. From the object-oriented point of view and the database-oriented point of view this should be possible, but it seems, as if ejb3 needs some more information. The object inheritance looks like this: | AbstractBalance | A | | | | | +-+-+ | | | |BalanceA BalanceB | an it should be realized through a InheritanceType.JOINED with the following database-tables all referencing to the same id: CREATE TABLE balance | ( | id INTEGER NOT NULL, | code_currency VARCHAR(3) NOT NULL | ); | | CREATE TABLE balance_a | ( | id INTEGER NOT NULL, | credit NUMERIC(10, 2) NOT NULL | ); | | ALTER TABLE balance_a ADD CONSTRAINT pk_balance_a | PRIMARY KEY (id); | | ALTER TABLE balance_a ADD CONSTRAINT fk__balance_a | FOREIGN KEY (id) REFERENCES balance (id) ON DELETE NO ACTION; | | CREATE TABLE balance_b | ( | id INTEGER NOT NULL, | income NUMERIC(10, 2) NOT NULL | ); | | ALTER TABLE balance_b ADD CONSTRAINT fk__balance_b | FOREIGN KEY (id) REFERENCES balance (id) ON DELETE NO ACTION; | and these annotations: | @Entity | @Table(name = "balance") | @Inheritance(strategy=InheritanceType.JOINED) | public abstract class Balance implements Serializable { | | @Id | @Column(name = "id", nullable = false) | private Integer id; | | | | @Entity | @Table(name = "balance_a") | public class BalanceA extends Balance implements Serializable { | | | | @Entity | @Table(name = "balance_b") | public class BalanceB extends Balance implements Serializable { | | | The reason for that is, that I want to define values in the balance-table, that are necessary and identical for both of the subclasses. Unfortunately I get a WrongClassException when I try to load these classes from a referenced class and have the same id´s in every table. If I remove the referencing id in balance_b, everything works fine, although BalanceB is not reference. 10:03:30,617 INFO [DefaultLoadEventListener] Error performing load command | org.hibernate.WrongClassException: Object with id: 2 was not of the specified subclass: entity.BalanceB (loaded object was of wrong class class entity.BalanceA) | at org.hibernate.loader.Loader.instanceAlreadyLoaded(Loader.java:1234) | at org.hibernate.loader.Loader.getRow(Loader.java:1186) | at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568) | at org.hibernate.loader.Loader.doQuery(Loader.java:689) | at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) | at org.hibernate.loader.Loader.loadEntity(Loader.java:1784) | at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48) | at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42) | at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2977) | at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:393) | at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:374) | at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137) | at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:193) | at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101) | at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) | at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846) | at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) | at org.hibernate.type.EntityType.resolve(EntityType.java:303) | at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116) | at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842) | Did I miss anything in the annotation or is it not possible to do it that way? Thank you very much for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3999368#3999368 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999368 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Customize validation messages
Thanks for your help! Norman, your solution worked perfectly as I wanted it to be, besides the fact that you have to use a slightly different annotation if you want to use messages fro the seam resourceBundle which caused me some confusions until I realized that fact. So if anyone else has the same problem use this syntax as an example: @Length(min=3, message="#{messages['validation.user.name.length']}") But I´d like to extend this topic a little bit, because I have some more questions about that. Unfortunately the hibernate validation were not used if the required=true attribute is missing in the jsf-tag. Although I´d say that for example a @Length(min=3) annotation also means that it should not be empty and for some reason the @NotEmpty-annotation is not supported with the current seam-release (is there a reason?). So I have to add the required="true" attribute to every input field to work with the hibernate validation. Is there also a possibility to customize the "field-is-required"-messages for every input field, so it is not the standard-message from "javax.faces.component.UIInput.REQUIRED" for every field? I saw, that sun uses a syntax like in the following code-snippet, to provide this functionality but it doesn´t seem to be a standard-jsf-tag: | ... | | Furthermore I get an error while trying to use the sun jsf-impl, whereas myfaces works perfectly. But that´s probably another topic. So is there also a solution to this problem? Thank you very much for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997877#3997877 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997877 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Customize validation messages
Hi, I´m currently doing my first steps with Seam and JSF and, as a long-time Struts-developer, I already see so many improvements in the Seam/EJB3/JSF integration. Thank you for the great work! But now I´m starting at a very basic problem: validation! The struts way of life was that you have a validate()-method where you have to validate everything and if an error occured you can assign a customized error-message to an input-field that was localized through the RessourceBundle. If I do the validation through jsf and the hibernate validation framework I get very unsexy error-messages like ""name": Value is required." if I set required = true and the field was left blank or "has to be between 3 and 2147483647 " or I get an output og my complete regexp if not left blank and the hibernate validation fails. What I would like to do is to show customized error-messages like "Please enter a valid email-adress" or "The password has to have at least 6 characters and 1 number" etc. One thing I found regarding customizing messages was redefining the properties like "javax.faces.component.UIInput.REQUIRED" in the message.properties. But this way the message cannot be customized for every single input-field. So what would be the right way to do in this case? Do I have to write my own validator and tag-library for every inputfield to archieve this (only to display different but customized messages) or is there an other - more elegant and less complex - way? Thanks for your help Thomas View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997645#3997645 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997645 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user