Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Struts 2 seems to be broke due to reflection limitations
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
TimDalton  
View profile  
 More options Apr 8, 2:13 pm
From: TimDalton <dalto...@charter.net>
Date: Wed, 8 Apr 2009 11:13:50 -0700 (PDT)
Local: Wed, Apr 8 2009 2:13 pm
Subject: Struts 2 seems to be broke due to reflection limitations
Earlier I tried get a simple Struts 2 application running under GAE/J
and hit a IllegalAccessError when try to set a property on the Action
POJO. Apparently, the restrictions on reflection is preventing Struts
2 from working.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Max Ross  
View profile  
 More options Apr 8, 2:17 pm
From: Max Ross <maxr+appeng...@google.com>
Date: Wed, 8 Apr 2009 11:17:25 -0700
Local: Wed, Apr 8 2009 2:17 pm
Subject: Re: [google-appengine-java] Struts 2 seems to be broke due to reflection limitations

Can you please post the exception?  You should be able to reflect on pretty
much any class you upload with your app.

Thanks,
Max


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dalto...@charter.net  
View profile  
 More options Apr 8, 3:34 pm
From: <dalto...@charter.net>
Date: Wed, 8 Apr 2009 12:34:08 -0700
Local: Wed, Apr 8 2009 3:34 pm
Subject: Re: [google-appengine-java] Re: Struts 2 seems to be broke due to reflection limitations
I am running locally using the Eclipse plugins. The first exception I
get is:

WARNING: Caught OgnlException while setting property 'location' on type
'org.apache.struts2.dispatcher.ServletDispatcherResult'.
java.lang.IllegalAccessException: Method [public void
org.apache.struts2.dispatcher.StrutsResultSupport.setLocation(java.lang.Str ing)]
cannot be accessed.
   at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:508)
   at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:812)

When I try to invoke an action directly I get:

SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'name' on 'class com.ociweb.gaestruts2.HelloAction: Error
setting expression 'name' with value '[Ljava.lang.String;@24de7d'

package com.ociweb.gaestruts2;

import com.opensymphony.xwork2.ActionSupport;

public class HelloAction extends ActionSupport {
   private String name;
       private String backwardsName;

   public String execute() {
       int nameLen = name.length();
       StringBuffer sb = new StringBuffer(nameLen);
       char[] nameArray = name.toCharArray();
       for (int i = 0; i < nameLen; i++) {
           sb.append(nameArray[nameLen - i - 1]);
       }
       backwardsName = sb.toString();
       return SUCCESS;
   }

   public void setName(String name) {
       this.name = name;
   }

   public String getName() {
       return name;
   }

   public String getBackwardsName() {
       return backwardsName;
   }

}

Earlier, I saw a message regarding an IllegalAccessException trying to
invoke setName on an HelloAction object. I'm certain that is the
underlying exception in the in the message above. I have the Struts 2
jar and dependencies under the /war/WEB-INF/lib directory. Please let me
know if you need more info.

Thanks,
Tim

---- Max Ross <maxr+appeng...@google.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Max Ross  
View profile  
 More options Apr 8, 4:33 pm
From: Max Ross <maxr+appeng...@google.com>
Date: Wed, 8 Apr 2009 13:33:42 -0700
Local: Wed, Apr 8 2009 4:33 pm
Subject: Re: [google-appengine-java] Re: Struts 2 seems to be broke due to reflection limitations

Two things for you to try:

1) Try deploying your app to prod and see if you get the same exception.
There are a couple of areas where the local environment and the prod
environment do things a little bit differently.

2) Run your app locally with
--jvm_flag="-Djava.security.debug=access,failure" and send us the output.
This should make it pretty clear what check is failing.

Thanks,
Max


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dalto...@charter.net  
View profile  
 More options Apr 8, 5:27 pm
From: <dalto...@charter.net>
Date: Wed, 8 Apr 2009 14:27:01 -0700
Local: Wed, Apr 8 2009 5:27 pm
Subject: Re: [google-appengine-java] Re: Struts 2 seems to be broke due to reflection limitations
I deployed to production and still has problems with IllegalAccessExceptions. I've posted a log and zipped version of the Eclipse 3.4 project:

http://sites.google.com/site/compulsiontocode/gaestruts2/gaestruts2.log
http://sites.google.com/site/compulsiontocode/gaestruts2/gaestruts2.zip

Thanks,
Tim

---- Max Ross <maxr+appeng...@google.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Max Ross  
View profile  
(1 user)  More options Apr 8, 9:36 pm
From: Max Ross <maxr+appeng...@google.com>
Date: Wed, 8 Apr 2009 18:36:34 -0700
Local: Wed, Apr 8 2009 9:36 pm
Subject: Re: [google-appengine-java] Re: Struts 2 seems to be broke due to reflection limitations

The issue seems to be that Ognl expects OgnlInvokePermission to be granted,
and since it isn't, the reflection call fails (Ognl checs for this perm
before every reflection call it makes).  Let me see if we can find a
workaround for you.

Max


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dalto...@charter.net  
View profile  
(1 user)  More options Apr 9, 4:04 pm
From: <dalto...@charter.net>
Date: Thu, 9 Apr 2009 13:04:43 -0700
Local: Thurs, Apr 9 2009 4:04 pm
Subject: Re: [google-appengine-java] Re: Struts 2 seems to be broke due to reflection limitations
The Strut2 community has posted a workaround detailed here:

http://www.nabble.com/Google-App-Engine-support--td22972179.html

It involves creating a servlet context listener that invokes OgnlRuntime.setSecurityManager(null). I've incorporating such changes and have deployed to gaestruts2.appspot.com.

Code snippet for Listener:

package com.ociweb.gaestruts2;

// imports

public class InitListener implements ServletContextListener, HttpSessionListener, HttpSessionAttributeListener {

    public InitListener()  {
    }

    public void contextInitialized(ServletContextEvent sce)  {
        OgnlRuntime.setSecurityManager(null);
    }
    // ... all other methods stubbed out to do nothing

}

Added to web.xml:

<listener>
        <listener-class>com.ociweb.gaestruts2.InitListener</listener-class>
</listener>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[google-appengine-java] Re: Struts 2 seems to be broke due to reflection limitations" by Max Ross
Max Ross  
View profile  
 More options Apr 9, 4:08 pm
From: Max Ross <maxr+appeng...@google.com>
Date: Thu, 9 Apr 2009 13:08:34 -0700
Local: Thurs, Apr 9 2009 4:08 pm
Subject: Re: [appengine-java] Re: [google-appengine-java] Re: Struts 2 seems to be broke due to reflection limitations

Nice!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Struts 2 seems to be broke due to reflection limitations" by zhuzohe.net
zhuzohe.net  
View profile  
 More options Apr 16, 9:57 pm
From: "zhuzohe.net" <zhuo...@gmail.com>
Date: Thu, 16 Apr 2009 18:57:15 -0700 (PDT)
Local: Thurs, Apr 16 2009 9:57 pm
Subject: Re: Struts 2 seems to be broke due to reflection limitations
Good! My struts2 is ok!

On Apr 10, 4:04 am, <dalto...@charter.net> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google