[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3851) Seam reflection has lower access than Java reflection
by Gabriel Goïc (JIRA)
Seam reflection has lower access than Java reflection
-----------------------------------------------------
Key: JBSEAM-3851
URL: https://jira.jboss.org/jira/browse/JBSEAM-3851
Project: Seam
Issue Type: Bug
Affects Versions: 2.0.2.SP1
Environment: Jboss Embedded, Java 5
Reporter: Gabriel Goïc
This simple class is to be unit-tested, the SeamTest way:
@Name("hibean")
public class HiSayerBean {
public HiSayerBean () {
}
protected void sayHi(){
System.out.println("hello");
}
}
All tests occur in the SeamTest framework:
new ComponentTest() {
@Override
protected void testComponents() throws Exception {
//test code
}
}.run();
Using Java Reflection - works:
HiSayerBean impl = new HiSayerBean();
Method m = impl.getClass().getDeclaredMethod("sayHi");
m.setAccessible(true);
m.invoke(impl);
Using Java Reflection with Seam - fails:
HiSayerBean impl = (HiSayerBean) getInstance("hibean");
Method m = impl.getClass().getDeclaredMethod("sayHi");
m.setAccessible(true);
m.invoke(impl);
Error log:
java.lang.reflect.InvocationTargetException
(...)
Caused by: java.lang.IllegalAccessException: Class org.jboss.seam.util.Reflections can not access a member of class HiSayerBean with modifiers "protected"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.reflect.Method.invoke(Method.java:578)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
at HiSayerBean_$$_javassist_0.sayHi(HiSayerBean_$$_javassist_0.java)
... 29 more
So, using Seam gives me a lower capacity to access methods in a reflected class than with raw Java. I'm not sure if it's a bug or a feature request though. But it would be nice to be granted to do this in unit-testing.
Please note that access to a private method in the same way than above works with Java but produces a java.lang.NoSuchMethodException with Seam.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3901) Conversation id is always propagated on redirects
by Preben Ludviksen (JIRA)
Conversation id is always propagated on redirects
-------------------------------------------------
Key: JBSEAM-3901
URL: https://jira.jboss.org/jira/browse/JBSEAM-3901
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.1.GA
Reporter: Preben Ludviksen
According to the documentation, propagation of conversation id's on redirects is controlled by the redirect-filter:
http://docs.jboss.com/seam/2.1.1.GA/reference/en-US/html/configuration.ht...
However, the id propagates even if the filter is swithced off in components.xml:
<web:redirect-filter disabled="true" installed="false"/>
When redirecting using pages.xml:
<page view-id="/login.xhtml">
<navigation>
<rule if-outcome="success">
<redirect view-id="/servers.xhtml" />
</rule>
</navigation>
</page>
According to the Seam user Peter Hilton in the referenced forum thread:
"The <redirect/> results in a call to org.jboss.seam.faces.FacesManager.redirect(String viewId, Map<String, Object> parameters, boolean includeConversationId)
This is called from the following code in org.jboss.seam.faces.Navigator which sets includeConversationId to true:
FacesManager.instance().redirect(viewId, parameters, true);"
The propagation should be possible to disable, for use cases where you don't really rely on conversations, and don't want to clutter the URL. I have also posted a feature request to allow disabling of the propagation on a per-redirect basis.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3753) SeamResourceBundle.getBundle(String baseName) fails to return correct message based on Locale
by Samuel Mendenhall (JIRA)
SeamResourceBundle.getBundle(String baseName) fails to return correct message based on Locale
---------------------------------------------------------------------------------------------
Key: JBSEAM-3753
URL: https://jira.jboss.org/jira/browse/JBSEAM-3753
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.1.CR1, 2.0.3.CR1, 2.0.2.SP1
Reporter: Samuel Mendenhall
When specifying the Locale directly, everything works as expected, when not, the default locale is used, which is incorrect. Ex.
log.info("SeamResourceBundle.getBundle w/o passing Local: " + SeamResourceBundle.getBundle("ECISConfig").getString("ecis.hello"));
log.info("SeamResourceBundle.getBundle w passing Local: " + SeamResourceBundle.getBundle("ECISConfig", LocaleSelector.instance().getLocale()).getString("ecis.hello"));
Produces:
15:08:45,438 INFO [TestAction] SeamResourceBundle.getBundle w/o passing Local: Hello from ECISConfig_en.properties
15:08:45,439 INFO [TestAction] SeamResourceBundle.getBundle w passing Local: Hello from ECISConfig_en_US_tmwa.properties
When both should be saying "Hello from ECISConfig_en_US_tmwa.properties" because the locale and resource bundle are defined in components.xml as:
<international:locale-selector locale-string="en_US_tmwa" />
<core:resource-loader>
<core:bundle-names>
<value>messages</value>
<value>ECISConfig</value>
</core:bundle-names>
</core:resource-loader>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3898) Transaction not rolled back by Work if exception is thrown during UTTransaction.begin
by Clint Popetz (JIRA)
Transaction not rolled back by Work if exception is thrown during UTTransaction.begin
-------------------------------------------------------------------------------------
Key: JBSEAM-3898
URL: https://jira.jboss.org/jira/browse/JBSEAM-3898
Project: Seam
Issue Type: Bug
Components: Core
Reporter: Clint Popetz
Attachments: Work.java.diff
The Work class doesn't rollback if an exception is thrown during
UTTransaction.begin(), which can happen if getSynchronizations().afterTransactionBegin() dies.
This can happen in an EJB3 environment, even though the method on EjbSynchronizations does nothing, because EjbSynchronizations is a SFSB, and for example there are classloading bugs for SFSBs in Quartz threads, which lead to
spurious exceptions. When using jta, this means the tx for the async thread is left open, and eventually times out, but is never rolled back. When subsequent async jobs use that thread, all tx operations will fail because the tx exists but is aborted.
I think that the try block should start before the call to begin().
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3900) error in creating seam entity
by Thiru Neela (JIRA)
error in creating seam entity
-----------------------------
Key: JBSEAM-3900
URL: https://jira.jboss.org/jira/browse/JBSEAM-3900
Project: Seam
Issue Type: Task
Components: Seam Text
Affects Versions: 2.0.1.GA
Reporter: Thiru Neela
Fix For: 2.0.1.GA
Hi !
I am creating one single seam-entity, but the code is not created completly
my table has the following fields (tid,tname,date1,Id),
the seam generated code as follows
package org.domain.hi.entity;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.Version;
import org.hibernate.validator.Length;
@Entity
public class Tramsactopm1 implements Serializable {
//seam-gen attributes (you should probably edit these)
private Long id;
private Integer version;
private String name;
//add additional entity attributes
//seam-gen attribute getters/setters with annotations (you probably should edit)
@Id @GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Version
public Integer getVersion() {
return version;
}
private void setVersion(Integer version) {
this.version = version;
}
@Length(max=20)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
my question is why is not creating complete code for all the fileds
cany any one help to solve this problem
thanks in advance
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 2 months