[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2764) Factory method does not create objects properly
by Bogdan Minciu (JIRA)
Factory method does not create objects properly
-----------------------------------------------
Key: JBSEAM-2764
URL: http://jira.jboss.com/jira/browse/JBSEAM-2764
Project: JBoss Seam
Issue Type: Bug
Components: EJB3
Affects Versions: 2.0.1.GA
Reporter: Bogdan Minciu
Hello,
It seems that my @Factory method is recognizing the created objects only in its command block. I have this class:
@Stateful
@Name("xtw")
@Scope(ScopeType.SESSION)
@AutoCreate
public class XTextSessionWrapper implements LocalXTextSessionWrapper {
...
@In(required=false, create=true)
@Out
private XLanguage activeLanguage;
public String getText(String identifier) {
log.info("getText(1): identifier= #0, activeLanguage= #1", identifier, getActiveLanguage());
XTextEntry xte = xTextEntryDAO.findXTextEntry(identifier, getActiveLanguage());
log.info("getText(2): identifier= #0, activeLanguage= #1", identifier, getActiveLanguage());
xte.getXtext();
}
@Factory(value="activeLanguage", autoCreate=true)
public void initActiveLanguage() {
XLanguage xl = xLanguageDAO.findXLanguageByIdentifier("ro");
log.info("initActiveLanguage(1): activeLanguage initialized to #0", xl.getIdentifier());
setActiveLanguage(xl);
log.info("initActiveLanguage(1): activeLanguage initialized to #0", getActiveLanguage().getIdentifier());
}
public XLanguage getActiveLanguage() {
return activeLanguage;
}
public void setActiveLanguage(XLanguage activeLanguage) {
this.activeLanguage = activeLanguage;
}
...
}
And i am calling the getText() method. The method calling is as expected:
1. the injected activeLanguage is detecting that it has a null value,
2. the initActiveLanguage() factory method is called
3. then the getText() method is continuing its execution.
But, the problem is that when the application exists the @Factory method block, the created objects: activeLanguage is lost and reported again as null.
Here is the output:
12:43:48,203 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,203 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] getText(1): identifier= com.brit.xcms.cms.Category.12.name, activeLanguage= null
12:43:49,234 INFO [XTextSessionWrapper] getText(2): identifier= com.brit.xcms.cms.Category.12.name, activeLanguage= null
Where did I went wrong? Why is the activeLanguage factoried value lost when i leave the initActiveLanguage() method?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] Created: (SEAMPERSIST-55) @Transactional annotation on @SessionScoped bean fails on cluster
by Marek Schmidt (JIRA)
@Transactional annotation on @SessionScoped bean fails on cluster
-----------------------------------------------------------------
Key: SEAMPERSIST-55
URL: https://issues.jboss.org/browse/SEAMPERSIST-55
Project: Seam Persistence
Issue Type: Bug
Affects Versions: 3.0.0.Final
Environment: JBoss AS 6.1 SNAPSHOT, mod_jk
Reporter: Marek Schmidt
Assignee: Stuart Douglas
Fix For: Future
a session containing a @Transactional @SessionScoped bean fails to replicate with
{quote}
[org.infinispan.interceptors.InvocationContextInterceptor] (ajp-127.0.1.1-8009-2) Execution error: : org.infinispan.CacheException: java.lang.RuntimeException: Failure to marshal arguments(s)
at org.infinispan.util.Util.rewrapAsCacheException(Util.java:477) [:4.2.0.FINAL]
at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:123) [:4.2.0.FINAL]
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:399) [:4.2.0.FINAL]
...
Caused by: java.lang.RuntimeException: Failure to marshal argument(s)
at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$ReplicationTask.marshallCall(CommandAwareRpcDispatcher.java:243) [:4.2.0.FINAL]
at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher$ReplicationTask.call(CommandAwareRpcDispatcher.java:270) [:4.2.0.FINAL]
at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommands(CommandAwareRpcDispatcher.java:121) [:4.2.0.FINAL]
... 76 more
Caused by: org.infinispan.CacheException: Unable to marshall value AtomicHashMap{delegate=org.infinispan.util.FastCopyHashMap@32ed99af}
at org.infinispan.marshall.MarshalledValue.serialize(MarshalledValue.java:100) [:4.2.0.FINAL]
at org.infinispan.marshall.MarshalledValue.getRaw(MarshalledValue.java:156) [:4.2.0.FINAL]
at org.infinispan.marshall.MarshalledValue$Externalizer.writeObject(MarshalledValue.java:248) [:4.2.0.FINAL]
...
Caused by: java.io.NotSerializableException: org.jboss.seam.transaction.DefaultSeamTransaction
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) [:1.6.0_24]
{quote}
No that in this environment, the workaround for SEAMPERSIST-49 doesn't help.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] Created: (SEAMPERSIST-49) Seam Persistence Fails in clustered environment
by Thomas Andraschko (JIRA)
Seam Persistence Fails in clustered environment
-----------------------------------------------
Key: SEAMPERSIST-49
URL: https://issues.jboss.org/browse/SEAMPERSIST-49
Project: Seam Persistence
Issue Type: Bug
Affects Versions: 3.0.0.Final
Environment: Tomcat 7.0.14 with memchached session manager, Myfaces 2.0.5, Weld 1.1.2-SNAPSHOT, Persistence 3.0.0.Final, Faces 3.0.1.Final, XML Config 3.0.0.Final, Hibernate 3.6.4
Reporter: Thomas Andraschko
Priority: Critical
Session replication fails when using Seam Persistence.
Following exceptions occurs:
WARNING: Cannot serialize session attribute org.jboss.weld.context.http.HttpSessionContext#org.jboss.weld.bean-flat-ManagedBean-TestController[@javax.enterprise.context.SessionScoped()@javax.inject.Named(value=)]{TestController.userDao[@javax.inject.Inject()];TestController.newUser[@org.jboss.seam.transaction.Transactional(value=REQUIRED)@org.jboss.seam.transaction.TransactionalInterceptorBinding()]();TestController.post[(a)javax.annotation.PostConstruct()]();} for session 488BDFEE2194D758C7B76C6E60E6BD5E-n2
java.io.NotSerializableException: org.jboss.seam.transaction.TransactionExtension
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at java.util.ArrayList.writeObject(ArrayList.java:570)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422)
at java.util.Collections$SynchronizedCollection.writeObject(Collections.java:1602)
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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at de.javakaffee.web.msm.JavaSerializationTranscoder.writeAttributes(JavaSerializationTranscoder.java:143)
at de.javakaffee.web.msm.JavaSerializationTranscoder.serializeAttributes(JavaSerializationTranscoder.java:106)
at de.javakaffee.web.msm.TranscoderService.serializeAttributes(TranscoderService.java:138)
at de.javakaffee.web.msm.BackupSessionTask.serializeAttributes(BackupSessionTask.java:177)
at de.javakaffee.web.msm.BackupSessionTask.call(BackupSessionTask.java:111)
at de.javakaffee.web.msm.BackupSessionTask.call(BackupSessionTask.java:48)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Why is it stored in the session? Can it be made serializable?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[JBoss JIRA] Created: (SEAMXML-25) Introduce s:values tag
by Jozef Hartinger (JIRA)
Introduce s:values tag
----------------------
Key: SEAMXML-25
URL: https://issues.jboss.org/browse/SEAMXML-25
Project: Seam Config
Issue Type: Feature Request
Affects Versions: 3.0.0.Beta1
Reporter: Jozef Hartinger
Priority: Minor
Currently, it is quite verbose to populate a collection with configured object instances using the XML module.
For example:
Foo is a class having a collection (bars) of Bars
<e:Foo>
<e:bars>
<s:value>
<e:Bar id="1"/>
</s:value>
<s:value>
<e:Bar id="2"/>
</s:value>
<s:value>
<e:Bar id="3"/>
</s:value>
<s:value>
<e:Bar id="4"/>
</s:value>
</e:bars>
</e:Foo>
If the s:values tag is introduced, it'll make the configuration less verbose
<e:Foo>
<e:bars>
<s:values>
<e:Bar id="1"/>
<e:Bar id="2"/>
<e:Bar id="3"/>
<e:Bar id="4"/>
</s:values>
</e:bars>
</e:Foo>
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months