[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3915) RESTEasy GET request: java.lang.RuntimeException: Bad arguments passed to public java.lang.String method
by Viggo Navarsete (JIRA)
RESTEasy GET request: java.lang.RuntimeException: Bad arguments passed to public java.lang.String method
---------------------------------------------------------------------------------------------------------
Key: JBSEAM-3915
URL: https://jira.jboss.org/jira/browse/JBSEAM-3915
Project: Seam
Issue Type: Bug
Environment: JDK 1.6
Jboss 5.0.0.GA for JDK 1.6
Seam 2.1.1.GA
Reporter: Viggo Navarsete
Deploying the attached project and going to the following url: http://localhost:8080/app-cci-seam/seam/resource/rest/gqiResource/getShel...
results in the following stacktrace:
09:00:03,046 ERROR [STDERR] java.lang.RuntimeException: Bad arguments passed to public java.lang.String com.tracetracker.cci.session.GqiResourceBean.getShelfLife(java.lang.String,java.lang.String) ( arg1, arg2
09:00:03,047 ERROR [STDERR] at org.resteasy.MethodInjectorImpl.invoke(MethodInjectorImpl.java:133)
09:00:03,047 ERROR [STDERR] at org.resteasy.ResourceMethod.invoke(ResourceMethod.java:162)
09:00:03,047 ERROR [STDERR] at org.resteasy.ResourceMethod.invoke(ResourceMethod.java:134)
09:00:03,047 ERROR [STDERR] at org.resteasy.Dispatcher.invoke(Dispatcher.java:161)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.resteasy.ResteasyResourceAdapter$1.process(ResteasyResourceAdapter.java:127)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.resteasy.ResteasyResourceAdapter.getResource(ResteasyResourceAdapter.java:71)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
09:00:03,047 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
09:00:03,047 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
09:00:03,047 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
09:00:03,047 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
09:00:03,047 ERROR [STDERR] at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
09:00:03,048 ERROR [STDERR] at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
09:00:03,048 ERROR [STDERR] at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
09:00:03,048 ERROR [STDERR] at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
09:00:03,048 ERROR [STDERR] at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
09:00:03,048 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
09:00:03,048 ERROR [STDERR] at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
09:00:03,048 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
09:00:03,048 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
09:00:03,048 ERROR [STDERR] at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:00:03,048 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
09:00:03,048 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
09:00:03,048 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
09:00:03,048 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
09:00:03,048 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
09:00:03,048 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
09:00:03,049 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
09:00:03,049 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
09:00:03,049 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
09:00:03,049 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
09:00:03,049 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
09:00:03,049 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
09:00:03,049 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
09:00:03,049 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
09:00:03,049 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:00:03,049 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
09:00:03,049 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
09:00:03,049 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
09:00:03,049 ERROR [STDERR] at org.resteasy.MethodInjectorImpl.invoke(MethodInjectorImpl.java:72)
09:00:03,049 ERROR [STDERR] ... 50 more
The interface for the RESTEasy webservice is com.tracetracker.cci.GqiResource
The implementation is com.tracetracker.cci.GqiResourceBean
I have tried to change the parameter types resulting in the same error. It looks the argumentss are not handlet corectly for GET requests.
--
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
15 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3947) Seam PersistentPermissionResolver do not recognizes roles created by RunAsOperation when checking 'hasPermission' method
by douglas carvalho (JIRA)
Seam PersistentPermissionResolver do not recognizes roles created by RunAsOperation when checking 'hasPermission' method
------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-3947
URL: https://jira.jboss.org/jira/browse/JBSEAM-3947
Project: Seam
Issue Type: Bug
Components: Security
Affects Versions: 2.1.1.GA
Environment: Any
Reporter: douglas carvalho
When trying to register a new user by using persistent permission utilities of seam, we use RunAsOperation:
new RunAsOperation() {
public void execute() {
identityManager.createUser(user.getUsername(), user.getPassword());
identityManager.grantRole(user.getUsername(), "user");
}
}.addRole("admin").run();
RunAsOperation class adds the role "admin" to a SimpleGroup and put it in subject property. Then it calls run(), wich one calls runAs() in current session identity object. This one, by itself, get the Principal object from the RunAsOperation object passed as parameter. Since the RunAsOperation was just constructed, it 'principal's name is NULL. Execute() method we created calls createUser, wich one calls, before anything, the hasPermission() method from PersistentPermissionResolver.
In hasPermission() method of PersistentPermissionResolver, it gets the name of the current principal:
" String username = identity.getPrincipal().getName(); "
Since we are in the context execution of the RunAsOperation, as I sayd the getPrincipal().getName() returns NULL.
Now username is NULL.
A bit more forward, we have an iterator, passing by each of the permissions got from the database with the specified target and action.
The problem comes at exacly here:
It only checks the permission for the user got from the Principal. And since the real role asked to be the owner of the security checking is in 'subject' property of the identity, inside of a SimpleGroup, as a member of this one, and not in the 'principal' property, the seam code do the check over a NULL recipient, resulting in a NullPointerException.
if (permission.getRecipient() instanceof SimplePrincipal && username.equals(permission.getRecipient().getName())){
iter.remove();
break;
}
I modified some code to fix that:
for (Permission permission : permissions) {
try {
for (Principal grupo : identity.getSubject().getPrincipals()) {
if (grupo instanceof SimpleGroup) {
SimpleGroup grupoSimples = (SimpleGroup) grupo;
if (grupoSimples.isMember(new SimplePrincipal(permission.getRecipient().getName()))) {
return true;
}
}
}
if (permission.getRecipient() instanceof SimplePrincipal && username.equals(permission.getRecipient().getName())) {
return true;
}
if (permission.getRecipient() instanceof Role) {
Role role = (Role) permission.getRecipient();
if (role.isConditional()) {
RuleBasedPermissionResolver resolver = RuleBasedPermissionResolver.instance();
if (resolver.checkConditionalRole(role.getName(), target, action))
return true;
} else if (identity.hasRole(role.getName())) {
return true;
}
}
} catch (NullPointerException e) {
// Log or do something
}
}
--
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
15 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3652) Major reentrancy problem with "Page Scope" components and injection/disinjection
by Denis Forveille (JIRA)
Major reentrancy problem with "Page Scope" components and injection/disinjection
--------------------------------------------------------------------------------
Key: JBSEAM-3652
URL: https://jira.jboss.org/jira/browse/JBSEAM-3652
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.0.GA, 2.0.3.CR1, 2.0.2.SP1
Environment: WebSphere v6.1.0.17 in POJO Mode
Reporter: Denis Forveille
Priority: Blocker
This bug is very similar to the JBSEAM-3295 bug, but for "Page Scope" components this time
Under stress, we have random NPE, "conversation expired" and other strange eroors from time to time in production
This is due to a flaw in the "BijectionInterceptor" class and it is quite easy to reproduce
On a facelets page, we have a datatable with a list of h:commadLink, teh first page of a classic "list entities/showDetail" scheme. The controleur that manages the list is in "Page Scope"
When the user clics on one of the link, then quickly clic on another link, another one etc... without waiting for the detail view to show up, we have two concurrent request addressed to the same Page Scope component (Verified by putting traces in the BijectionInterceptor class)
In BijectionInterceptor, in that case, counter == 2 after line 77 meaning there is two concurrent thread running: the current thread + another one currently "using" the component
The counter will be decrease for the first time on line 82, then a second time on line 129 and so, disinjection will occur on line 134. This occurs while there is another thread "using" the component, causing random NPE and other errors!!!!
In fact this will happen each time counter >1, ie there is more than one "concurrent" request on the same component
This alleviate some questions:-
- is this normal that 2 (or more) concurrent request from the same user/conversation/page acces the same page scope component concurrently (I thought seam was taking care of this and was serializing such requests...
- is this normal that on line 88, components are outjected, only when the last concurrent "user" of the component exits the interceptor and not when each request "eixts" the interceptor?
--
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
15 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3845) NullPointerException in org.jboss.seam.exception.Exceptions.parse
by Ond?ej Žižka (JIRA)
NullPointerException in org.jboss.seam.exception.Exceptions.parse
-----------------------------------------------------------------
Key: JBSEAM-3845
URL: https://jira.jboss.org/jira/browse/JBSEAM-3845
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.0.SP1
Environment: JBoss EAP 4.3.0 default, JSFUnit, run using Cactus ServletTestRunner
Reporter: Ond?ej Žižka
Seam throws a NPE when I run a JSFUnit test case. The test may be fault, but at least the NPE should be handled.
Full stack trace:
-------------------------------------------------------
15:11:11,933 ERROR [BaseXMLFilter] Exception in the filter chain
javax.servlet.ServletException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.exception.exceptions
at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:126)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
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.servlet.SeamFilter.doFilter(SeamFilter.java:158)
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:173)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.exception.exceptions
at org.jboss.seam.Component.newInstance(Component.java:2096)
at org.jboss.seam.Component.getInstance(Component.java:1978)
at org.jboss.seam.Component.getInstance(Component.java:1957)
at org.jboss.seam.Component.getInstance(Component.java:1951)
at org.jboss.seam.Component.getInstance(Component.java:1924)
at org.jboss.seam.Component.getInstance(Component.java:1919)
at org.jboss.seam.exception.Exceptions.instance(Exceptions.java:256)
at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:114)
... 31 more
Caused by: java.lang.NullPointerException
at org.jboss.seam.exception.Exceptions.parse(Exceptions.java:195)
at org.jboss.seam.exception.Exceptions.initialize(Exceptions.java:119)
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:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
at org.jboss.seam.Component.callComponentMethod(Component.java:2201)
at org.jboss.seam.Component.callCreateMethod(Component.java:2124)
at org.jboss.seam.Component.newInstance(Component.java:2084)
... 38 more
--
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
15 years, 9 months