Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 13 Dec 2009 03:39:14 -0000 Issue 8959

user-digest-help

2009-12-12


Author LoginPost Reply

user Digest 13 Dec 2009 03:39:14 -0000 Issue 8959

Topics (messages 204207 through 204230):

Struts 1.0 and Spring?
 204207 by: Stephen Turner
 204208 by: Paul Benedict
 204209 by: Stephen Turner
 204214 by: Paul Benedict

Why <s:actionmessage /> did not show action message?
 204210 by: Emi Lu
 204211 by: Eduard Neuwirt
 204213 by: Emi Lu

Authorization technique
 204212 by: nani2ratna

Re: Struts 2 Result + GWT
 204215 by: Zheng, Hong

"specified DSN contains an architecture mismatch"
 204216 by: Todd Grigsby
 204217 by: Musachy Barroso
 204218 by: Martin Gainty
 204220 by: Todd Grigsby
 204225 by: Wes Wannemacher

select tag problem
 204219 by: Nguyen Xuan Son
 204223 by: Pawe³ Wielgus

Problem with jQuery DataTables plugin working with Struts2 AJAX
 204221 by: DustFrog

Struts2 Architecture - 2.0.14 and 2.1.8
 204222 by: Jayson Joseph Chacko
 204224 by: Donato Pirozzi

struts bug, session object bug? pls help
 204226 by: john lee

struts bug? session object bug? pls help
 204227 by: john lee

ognl method lookup failure
 204228 by: Dale Newfield
 204229 by: Musachy Barroso
 204230 by: Martin Gainty

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------


Attachment: user_204207.ezm (zipped)
I maintain a Struts 1.0 app and need to make some changes. While I'm
working on the app, I'm wondering if there's any chance I could integrate
Spring into the app, to manage Struts action classes. I found a plugin for
Struts 1.1, but I don't want to upgrade the Struts version at this point.

Thanks,
Steve




Attachment: user_204208.ezm (zipped)
Have you looked at the Spring API for its Struts support?

On Fri, Dec 11, 2009 at 12:13 PM, Stephen Turner <sturner@(protected):
> I maintain a Struts 1.0 app and need to make some changes. While I'm working
> on the app, I'm wondering if there's any chance I could integrate Spring
> into the app, to manage Struts action classes. I found a plugin for Struts
> 1.1, but I don't want to upgrade the Struts version at this point.
>
> Thanks,
> Steve
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204209.ezm (zipped)
On Fri, 11 Dec 2009 13:26:46 -0500, Paul Benedict <pbenedict@(protected)>
wrote:

> Have you looked at the Spring API for its Struts support?
>

All I've seen in the Spring code refers to Struts 1.1

Steve

> On Fri, Dec 11, 2009 at 12:13 PM, Stephen Turner <sturner@(protected):
>> I maintain a Struts 1.0 app and need to make some changes. While I'm
>> working
>> on the app, I'm wondering if there's any chance I could integrate Spring
>> into the app, to manage Struts action classes. I found a plugin for
>> Struts
>> 1.1, but I don't want to upgrade the Struts version at this point.
>>
>> Thanks,
>> Steve
>>
--
Stephen Turner
Senior Programmer/Analyst - SAIS
MIT IS&T


Attachment: user_204214.ezm (zipped)
1.1 should be backwards compatible with 1.0. Have you thought of upgrading?

On Fri, Dec 11, 2009 at 12:39 PM, Stephen Turner <sturner@(protected):
> On Fri, 11 Dec 2009 13:26:46 -0500, Paul Benedict <pbenedict@(protected)>
> wrote:
>
>> Have you looked at the Spring API for its Struts support?
>>
>
> All I've seen in the Spring code refers to Struts 1.1
>
> Steve
>
>> On Fri, Dec 11, 2009 at 12:13 PM, Stephen Turner <sturner@(protected):
>>>
>>> I maintain a Struts 1.0 app and need to make some changes. While I'm
>>> working
>>> on the app, I'm wondering if there's any chance I could integrate Spring
>>> into the app, to manage Struts action classes. I found a plugin for
>>> Struts
>>> 1.1, but I don't want to upgrade the Struts version at this point.
>>>
>>> Thanks,
>>> Steve
>>>
> --
> Stephen Turner
> Senior Programmer/Analyst - SAIS
> MIT IS&T
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204210.ezm (zipped)
Good afternoon,

With struts2.1.81, in action class: addActionMessage("Success!");

in JSP, display <s:actionmessage />.


But the success message never show up? Any clues?


Thanks a lot!
--
Lu Ying


Attachment: user_204211.ezm (zipped)
Did you send your success message from the action ?
Emi Lu schrieb:
> Good afternoon,
>
> With struts2.1.81, in action class: addActionMessage("Success!");
>
> in JSP, display <s:actionmessage />.
>
>
> But the success message never show up? Any clues?
>
>
> Thanks a lot!
> --
> Lu Ying
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>



Attachment: user_204213.ezm (zipped)
Hi Eduard,

> Did you send your success message from the action ?

(1) In action1 (a1.java):
  addActionMessage("Success!");

(2) through tiles action1 -> action2 (a2.java)

(3) from action2 -> final jsp
  <s:actionmessage />

if from (1) to (3) directly, it will be shown.

But from (1) to (2) to (3), it doesn't show, why?

--
Ying





>> Good afternoon,
>>
>> With struts2.1.81, in action class: addActionMessage("Success!");
>>
>> in JSP, display <s:actionmessage />.
>>
>>
>> But the success message never show up? Any clues?
>>
>>
>> Thanks a lot!
>> --
>> Lu Ying
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)



Attachment: user_204212.ezm (zipped)

Hi,

We are developing one application with struts2, spring, spring security,
ldap and Ibatis.

Anybody implemented Authorization from ldap??

Please give me a nice resource to implement ldap authorisation and
authentication with spring security.

Thanks
RS
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204215.ezm (zipped)
Hi Alex,

It seems we have to hard-code JSP path in Java files using Convention
plugin. That might make code change a bit difficult later...

Hong

-----Original Message-----
From: Alex Siman [mailto:aleksandr.siman@(protected)]
Sent: Friday, December 11, 2009 4:20 AM
To: user@(protected)
Subject: Re: Struts 2 Result + GWT


Maybe just use Struts 2 Convention plugin? It will allow you to reuse
Java
constants in Struts 2 and GWT code.

package gwtapp.server.action;
import static gwtapp.client.consts.StrutsLocations;
@Results({
 @Result(
   name = Action.SUCCESS,
   location = REGISTRATION_CONFIRMATION
 )
})
class RegistrationAction {...}


package gwtapp.client.consts;
class StrutsLocations {
 public static final String REGISTRATION_CONFIRMATION =
   "/jsp/registration_confirmation.jsp";
}


package gwtapp.client.widget;
import static gwtapp.client.consts.StrutsLocations;
class SomeWidget {
 String nextStrutsLocation = REGISTRATION_CONFIRMATION;
}

Zheng, Hong wrote:
>
> Hi all,
>
> I have been struggling with this problem for a few months now. I am
> using GWT with Struts 2 on my website. Following is the configuration
> for the registration page:
>
> <action name="register" class="com....RegistrationAction">
>  <result name="input">/jsp/registration.jsp</result>
>  <result
> name="success">/jsp/registration_confirmation.jsp</result>
> </action>
>
> registration.jsp contains a form coded using GWT. After
> RegistrationAction receives and processes data from the form, it sends
> back a JSON string. If everything is good, JSON will contain a
> "redirect" property that points to
"/jsp/registration_confirmation.jsp".
> When GWT codes sees this "redirect" property in returned JSON, it will
> redirect browser to the new page accordingly.
>
> The issue here is that I don't want to hard-code
> "/jsp/registration_confirmation.jsp" again in my RegistrationAction
> class, because I already defined that in struts.xml and that's where
it
> should be defined. Yet, I still need to pass that URL to GWT for
> redirection. Is there a way in Struts 2 that would translate a result
> name("success") to the corresponding result
> value("/jsp/registration_confirmation.jsp")?
>
> Many thanks!
> Hong Zheng
>
> P.S. I am aware that one solution would be to define another Action,
> such as RegistrationConfirmationAction. But that's not really a very
> elegant solution.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
http://old.nabble.com/Struts-2-Result-%2B-GWT-tp26735858p26741060.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


Attachment: user_204216.ezm (zipped)

Configuration:
 Windows 7 64 bit
 Tomcat 6
 Struts 2
 MySQL 5.1.36 for Win64
 MySQL ODBC 5.1 Driver 5.01.06.00

I've created a valid ODBC alias that I can see from other Windows native
applications with no problem. When I attempt the following:

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.sql.Connection;

...

  Context context = new InitialContext();
  DataSource ds =
(DataSource)context.lookup("java:/comp/env/jdbc/odbc/tgecorp");
  Connection conn = datasource.getConnection();

...

The last line throws an exception with the following message: "The
specified DSN contains an architecture mismatch between the Driver and
Application."

I reinstalled the driver, redefined the System DSN's in the ODBC
administrator, and I still get the same message. Anybody have any idea
how to fix this?

Todd


Attachment: user_204217.ezm (zipped)
O_o

On Fri, Dec 11, 2009 at 3:01 PM, Todd Grigsby <strutsuser@(protected):
>
> Configuration:
>  Windows 7 64 bit
>  Tomcat 6
>  Struts 2
>  MySQL 5.1.36 for Win64
>  MySQL ODBC 5.1 Driver 5.01.06.00
>
> I've created a valid ODBC alias that I can see from other Windows native
> applications with no problem.  When I attempt the following:
>
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.naming.NamingException;
> import javax.sql.DataSource;
> import java.sql.Connection;
>
> ...
>
>   Context context = new InitialContext();
>   DataSource ds =
> (DataSource)context.lookup("java:/comp/env/jdbc/odbc/tgecorp");
>   Connection conn = datasource.getConnection();
>
> ...
>
> The last line throws an exception with the following message:  "The
> specified DSN contains an architecture mismatch between the Driver and
> Application."
>
> I reinstalled the driver, redefined the System DSN's in the ODBC
> administrator, and I still get the same message.  Anybody have any idea how
> to fix this?
>
> Todd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204218.ezm (zipped)

you're using InitialContext to lookup a DataSource registered to JNDI registry

Martin Gainty
______________________________________________
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Ez az
üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Fri, 11 Dec 2009 15:46:56 -0800
> Subject: Re: "specified DSN contains an architecture mismatch"
> From: musachy@(protected)
> To: user@(protected)
>
> O_o
>
> On Fri, Dec 11, 2009 at 3:01 PM, Todd Grigsby <strutsuser@(protected):
> >
> > Configuration:
> > Windows 7 64 bit
> > Tomcat 6
> > Struts 2
> > MySQL 5.1.36 for Win64
> > MySQL ODBC 5.1 Driver 5.01.06.00
> >
> > I've created a valid ODBC alias that I can see from other Windows native
> > applications with no problem. When I attempt the following:
> >
> > import javax.naming.Context;
> > import javax.naming.InitialContext;
> > import javax.naming.NamingException;
> > import javax.sql.DataSource;
> > import java.sql.Connection;
> >
> > ...
> >
> >  Context context = new InitialContext();
> >  DataSource ds =
> > (DataSource)context.lookup("java:/comp/env/jdbc/odbc/tgecorp");
> >  Connection conn = datasource.getConnection();
> >
> > ...
> >
> > The last line throws an exception with the following message: "The
> > specified DSN contains an architecture mismatch between the Driver and
> > Application."
> >
> > I reinstalled the driver, redefined the System DSN's in the ODBC
> > administrator, and I still get the same message. Anybody have any idea how
> > to fix this?
> >
> > Todd
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
           
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/

Attachment: user_204220.ezm (zipped)

Yes, thank you, I know that. My question has to do with the
architecture mismatch. All the documentation I've seen on this
indicates that there is a 32-bit/64-bit issue, but I'll be darned if I
know which piece is at fault. Given the versions of the various parts,
does anyone have any idea what I need to do to be able to talk to MySQL?

TG

Martin Gainty wrote:
> you're using InitialContext to lookup a DataSource registered to JNDI registry
>
> Martin Gainty
>  
>>>  Context context = new InitialContext();
>>>  DataSource ds =
>>> (DataSource)context.lookup("java:/comp/env/jdbc/odbc/tgecorp");
>>>  Connection conn = datasource.getConnection();
>>>
>>> ...
>>>
>>> The last line throws an exception with the following message: "The
>>> specified DSN contains an architecture mismatch between the Driver and
>>> Application."
>>>    



Attachment: user_204225.ezm (zipped)
Why use odbc? Mysql has a top notch jdbc driver.

On 12/11/09, Todd Grigsby <strutsuser@(protected):
>
> Yes, thank you, I know that. My question has to do with the
> architecture mismatch. All the documentation I've seen on this
> indicates that there is a 32-bit/64-bit issue, but I'll be darned if I
> know which piece is at fault. Given the versions of the various parts,
> does anyone have any idea what I need to do to be able to talk to MySQL?
>
> TG
>
> Martin Gainty wrote:
>> you're using InitialContext to lookup a DataSource registered to JNDI
>> registry
>>
>> Martin Gainty
>>
>>>>  Context context = new InitialContext();
>>>>  DataSource ds =
>>>> (DataSource)context.lookup("java:/comp/env/jdbc/odbc/tgecorp");
>>>>  Connection conn = datasource.getConnection();
>>>>
>>>> ...
>>>>
>>>> The last line throws an exception with the following message: "The
>>>> specified DSN contains an architecture mismatch between the Driver and
>>>> Application."
>>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!


Attachment: user_204219.ezm (zipped)
dear all
in JSP file i have
<s:select label="mainCategory" name="mainCategory"
    list="mainCategory" listKey="id" listValue="name"
value="%{mainCategory.{id}}" required="true" />
in struts.xml file i have
<action name="add" class="com.baibai.action.C0032_AddAction">
<result name="success">/C0031_List.jsp</result>
<result name="input">/C0032_Add.jsp</result>
</action>
in Java file i have
public List<DropDownList> getMainCategory() {
List<DropDownList> ls = null;
DropDownList dr = null;
dr.setId(0);
dr.setName("--please select one of these--");
ls.add(dr);
return ls;
}
but the error appear
tag 'select', field 'list', name 'mainCategory': The requested list key
'mainCategory' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]

do you have any suggestion

--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email   : nr0003xx@(protected)
Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
=======================================================================

Attachment: user_204223.ezm (zipped)
Hi Nguyen,
if You would be using eclipse or idea You would have never hit such a
problem, so i encourage You to install and use one and not care about
such problems any more.
And the problem is NPE in line:
dr.setId(0);
Check your logs to see it.

Best greetings,
Pawel Wielgus.

2009/12/12, Nguyen Xuan Son <yamacom@(protected)>:
> dear all
> in JSP file i have
> <s:select label="mainCategory" name="mainCategory"
>     list="mainCategory" listKey="id" listValue="name"
> value="%{mainCategory.{id}}" required="true" />
> in struts.xml file i have
> <action name="add" class="com.baibai.action.C0032_AddAction">
> <result name="success">/C0031_List.jsp</result>
> <result name="input">/C0032_Add.jsp</result>
> </action>
> in Java file i have
> public List<DropDownList> getMainCategory() {
> List<DropDownList> ls = null;
> DropDownList dr = null;
> dr.setId(0);
> dr.setName("--please select one of these--");
> ls.add(dr);
> return ls;
> }
> but the error appear
> tag 'select', field 'list', name 'mainCategory': The requested list key
> 'mainCategory' could not be resolved as a
> collection/array/map/enumeration/iterator type. Example: people or
> people.{name} - [unknown location]
>
> do you have any suggestion
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add     : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
> Rien, Room 103
> Tel/Fax : 81-(0)90-3976 2246
> Email   : nr0003xx@(protected)
> Mobile  : 81-(0)90-3976 2246       URL : http://www.ritsumei.jp
> =======================================================================
>


Attachment: user_204221.ezm (zipped)

I have a page where the search criteria is at the top and below it is the
results display. For displaying the results, I'm using the <s:div> tag to
make an AJAX call to retrieve results and display them on the same page.

To display the table results, I'm using the jQuery plugin, DataTables, which
works fine with other pages when the result is a completely new page;
however, it does not work for AJAX results...at least I can't get it to
work.

I've even tried placing the jQuery code in the JSP page that contains the
table, but still doesn't work.

Does anyone else use this combination, and has anyone experienced this same
problem? How do you fix it? If this is not the right forum for this, then
I apologize and request some direction where this needs to be posted.

BTW, I'm using Struts 2.0.14 and DataTables 1.5.5
(http://www.datatables.net).

Thanks in advance.
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204222.ezm (zipped)
Hi,

Is there any key architectural changes between 2.0.14 and 2.1.8? Or does
the key concepts remain the same?

Thanks,
Jayson

Attachment: user_204224.ezm (zipped)
Hi Jayson,

I have upgraded version of struts for my project (from 2.0.14 to 2.1.8), and
for my personal experience I think that key concepts and base architecture
aspects are the same. For my experience version 2.1.8 is more stable, better
performance (first observations from users) ...

Into update there are a troubles, only if you use dojo intensely into your
application, because dojo plugin is deprecated and not supported for future
versions (infact dojo plugin is a wrapper of an old version dojo toolkit). I
have decided to remove referance to dojo plugin and use directly dojo
toolkit.

You can have information on differences between the versions at

http://struts.apache.org/2.1.8.1/docs/migration-guide.html

Donato


2009/12/12 Jayson Joseph Chacko <jaysonjc@(protected)>

> Hi,
>
> Is there any key architectural changes between 2.0.14 and 2.1.8? Or does
> the key concepts remain the same?
>
> Thanks,
> Jayson
>

Attachment: user_204226.ezm (zipped)
 
I have the same serious problem that is similar to an old thread
http://marc.info/?l=struts-user&m=121234554714110&w=2
 
I use session object to manage user data for my company's e-commerce site, from time to time,specially when have high web access traffic, the session data could overlap, and from different user object. It is very frustrated, because it not happen always, but once a while, but serious problem, i do not know it is bug for strusts or not.
 
public ActionForward execute(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response
                               ) throws Exception
{
HttpSession session=request.getSession();
UserInfoForm uif, t_uif;
Boolean check_cookie=false;
String login=null;
if (session==null) {
        session=request.getSession(true);
        check_cookie=true;
   }
else {
          uif=(UserInfoForm) session.getAttribute(BeanNames.USERINFO);
          if (uif==null || uif.getLogin_id()==null ||uif.getLogin_id().equals("Visit") )       
             check_cookie=true;
         }
 
if (check_cookie) {
        t_uif=new UserInfoForm();
        uif.setLogin_id("Visit");
        session.setAttribute(BeanNames.USERINFO,uif);
        Cookie theCookie=null;uif.setLogin_id("Visit");
        Cookie cookieList[]=request.getCookies();
        if (cookieList!=null) {
           for (int i=0; i<cookieList.length;i++) {
               theCookie=cookieList[i];
               if ( theCookie.getName().equals("XXX") )           /* XXX=company name */
                  login=theCookie.getValue();
               }
           if (login==null)
             t_uif=null;
           else
             t_uif=security_service.ask(login);      /* to access db, to verify user info ...*/
           if (t_uif==null)
              t_uif.setLogin_id("Visit");
           session.setAttribute(BeanNames.USERINFO,t_uif);
           }
    }
 
uif=(UserInfoForm) session.getAttribute(BeanNames.USERINFO);
 
.....
 
average once a month or when have heavy web traffic, the 'USERINFO' session object could be overlap with wrong customer info.
 
please give me any clue, tks in advance
 
john
 
 
 



Attachment: user_204227.ezm (zipped)
I have the same serious problem that is similar to an old thread
http://marc.info/?l=struts-user&m=121234554714110&w=2
 
I use session object to manage user data for my company's e-commerce site, from time to time,specially when have high web access traffic, the session data could overlap, and from different user object. It is very frustrated, because it not happen always, but once a while, but serious problem, i do not know it is bug for strusts or not.
 
public ActionForward execute(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response
                               ) throws Exception
{
HttpSession session=request.getSession();
UserInfoForm uif, t_uif;
Boolean check_cookie=false;
String login=null;
if (session==null) {
        session=request.getSession(true);
        check_cookie=true;
   }
else {
          uif=(UserInfoForm) session.getAttribute(BeanNames.USERINFO);
          if (uif==null || uif.getLogin_id()==null ||uif.getLogin_id().equals("Visit") )       
             check_cookie=true;
         }
 
if (check_cookie) {
        t_uif=new UserInfoForm();
        uif.setLogin_id("Visit");
        session.setAttribute(BeanNames.USERINFO,uif);
        Cookie theCookie=null;uif.setLogin_id("Visit");
        Cookie cookieList[]=request.getCookies();
        if (cookieList!=null) {
           for (int i=0; i<cookieList.length;i++) {
               theCookie=cookieList[i];
               if ( theCookie.getName().equals("XXX") )           /* XXX=company name */
                  login=theCookie.getValue();
               }
           if (login==null)
             t_uif=null;
           else
             t_uif=security_service.ask(login);      /* to access db, to verify user info ...*/
           if (t_uif==null)
              t_uif.setLogin_id("Visit");
           session.setAttribute(BeanNames.USERINFO,t_uif);
           }
    }
 
uif=(UserInfoForm) session.getAttribute(BeanNames.USERINFO);
 
....
 
average once a month or when have heavy web traffic, the 'USERINFO' session object could be overlap with wrong customer info.
 
please give me any clue, tks in advance
 
john



Attachment: user_204228.ezm (zipped)
Often when I'm stumped writing a detailed "help!" message leads me to
the bug and I never have to send it. This time I was not so lucky, and
since I've already wasted two days on this I was hoping someone here
might have an idea to get me out of the weeds.

I've got an abstract class "Comment" and a bunch of concrete subclasses
thereof. I've got a "displayComment.tag" file that calls itself
recursively to display a tree of comments. Among other things this
checks the extant subscriptions on the comment in question and displays
various subscribe/unsubscribe buttons as appropriate.

Mostly this works. There are a couple concrete subclasses of Comment
that break in a bizarre way, and I've been stuck on this for two days,
so I'm hoping someone here might have a suggestion.

I go through the normal annoying dance to push ognl accessible objects
into jstl-el accessible locations, passing those as attributes into the
.tag file and then set them inside the tag into a namespace accessible
from ognl: (yes, I tried with #attr, too--same behavior)

inside the .tag:
<%@(protected)"
type="mumble.model.User" rtexprvalue="true"%>
<%@(protected)"
type="mumble.model.Comment" rtexprvalue="true"%>

<c:set var="currentUserInTag" scope="request" value="${currentUser}"/>
<c:set var="commentInTag" scope="request" value="${commentToDisplay}"/>

Simple tests: <s:property value="%{#request.currentUserInTag.class}"/>
and <s:property value="%{#request.commentInTag.class}"/> show the
appropriate (concrete) classes.

Whereas in most instances this OGNL logic works:
#request.commentInTag.isUserSubscribedViaEmail(#request.currentUserInTag)

for these two specific concrete classes (due I believe to
struts.ognl.logMissingProperties=true) it results in a log entry:
Could not find method
[#request.commentInTag.isUserSubscribedViaEmail(#request.currentUserInTag)]

I am able to interrogate the object and find the expected methods:
<s:property value="%{#request.commentInTag.class.methods.{?
#this.name=='isUserSubscribedViaEmail'}[0]}"/> results in "public
boolean
mumble.model.CommunityFunItem.isUserSubscribedViaEmail(mumble.model.User)

but I'm also unable to get further with that: <s:property
value="%{#request.commentInTag.class.methods.{?
#this.name=='isUserSubscribedViaEmail'}[0].invoke(#request.commentInTag,#request.currentUserInTag)}"/>
results in the log entry: Could not find method
[#request.commentInTag.class.methods.{?
#this.name=='isUserSubscribedViaEmail'}[0].invoke(#request.commentInTag,#request.currentUserInTag)]

Maybe related: if I try to access the Class method "Method
getMethod(String name, Class... parameterTypes)" directly to get the
right one (instead of getting all of them and looking for one with the
right name) I end up with this log message:

Caught an exception while evaluating expression
'#request.commentInTag.class.getMethod('isUserSubscribedViaEmail',#request.currentUserInTag.class)'
against value stack
java.lang.IllegalArgumentException: java.lang.ClassCastException@(protected)
     at sun.reflect.GeneratedMethodAccessor1387.invoke(Unknown Source)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke (Method.java:585)
     at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:851)


Again, this works with some concrete subclasses of Comment, but not
others. There are no substantial differences between them as far as I
can tell. Any ideas/leads/suggestions/suppositions welcome.

I'm using struts 2.1.8.1, ognl 2.7.3, yes I have javassist-3.8.1.jar in
WEB-INF/lib. Running under glassfish if that matters.

-Dale


Attachment: user_204229.ezm (zipped)
I would suggest to put a breakpoint in XWorkMethodAccessor.callMethod
and see why it is not finding it.

musachy

On Sat, Dec 12, 2009 at 1:44 PM, Dale Newfield <dale@(protected):
> Often when I'm stumped writing a detailed "help!" message leads me to the
> bug and I never have to send it.  This time I was not so lucky, and since
> I've already wasted two days on this I was hoping someone here might have an
> idea to get me out of the weeds.
>
> I've got an abstract class "Comment" and a bunch of concrete subclasses
> thereof.  I've got a "displayComment.tag" file that calls itself recursively
> to display a tree of comments.  Among other things this checks the extant
> subscriptions on the comment in question and displays various
> subscribe/unsubscribe buttons as appropriate.
>
> Mostly this works.  There are a couple concrete subclasses of Comment that
> break in a bizarre way, and I've been stuck on this for two days, so I'm
> hoping someone here might have a suggestion.
>
> I go through the normal annoying dance to push ognl accessible objects into
> jstl-el accessible locations, passing those as attributes into the .tag file
> and then set them inside the tag into a namespace accessible from ognl:
>  (yes, I tried with #attr, too--same behavior)
>
> inside the .tag:
> <%@(protected)"
> rtexprvalue="true"%>
> <%@(protected)"
> type="mumble.model.Comment" rtexprvalue="true"%>
>
> <c:set var="currentUserInTag" scope="request" value="${currentUser}"/>
> <c:set var="commentInTag" scope="request" value="${commentToDisplay}"/>
>
> Simple tests:  <s:property value="%{#request.currentUserInTag.class}"/> and
> <s:property value="%{#request.commentInTag.class}"/> show the appropriate
> (concrete) classes.
>
> Whereas in most instances this OGNL logic works:
> #request.commentInTag.isUserSubscribedViaEmail(#request.currentUserInTag)
>
> for these two specific concrete classes (due I believe to
> struts.ognl.logMissingProperties=true) it results in a log entry:
> Could not find method
> [#request.commentInTag.isUserSubscribedViaEmail(#request.currentUserInTag)]
>
> I am able to interrogate the object and find the expected methods:
> <s:property value="%{#request.commentInTag.class.methods.{?
> #this.name=='isUserSubscribedViaEmail'}[0]}"/> results in "public boolean
> mumble.model.CommunityFunItem.isUserSubscribedViaEmail(mumble.model.User)
>
> but I'm also unable to get further with that: <s:property
> value="%{#request.commentInTag.class.methods.{?
> #this.name=='isUserSubscribedViaEmail'}[0].invoke(#request.commentInTag,#request.currentUserInTag)}"/>
> results in the log entry:  Could not find method
> [#request.commentInTag.class.methods.{?
> #this.name=='isUserSubscribedViaEmail'}[0].invoke(#request.commentInTag,#request.currentUserInTag)]
>
> Maybe related: if I try to access the Class method "Method getMethod(String
> name, Class... parameterTypes)" directly to get the right one (instead of
> getting all of them and looking for one with the right name) I end up with
> this log message:
>
> Caught an exception while evaluating expression
> '#request.commentInTag.class.getMethod('isUserSubscribedViaEmail',#request.currentUserInTag.class)'
> against value stack
> java.lang.IllegalArgumentException: java.lang.ClassCastException@(protected)
>        at sun.reflect.GeneratedMethodAccessor1387.invoke(Unknown Source)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke (Method.java:585)
>        at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:851)
>
>
> Again, this works with some concrete subclasses of Comment, but not others.
>  There are no substantial differences between them as far as I can tell.
>  Any ideas/leads/suggestions/suppositions welcome.
>
> I'm using struts 2.1.8.1, ognl 2.7.3, yes I have javassist-3.8.1.jar in
> WEB-INF/lib.  Running under glassfish if that matters.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204230.ezm (zipped)

yeah..the problem starts here
http://www.docjar.com/html/api/sun/reflect/DelegatingMethodAccessorImpl.java.html
 30  /** Delegates its invocation to another MethodAccessorImpl and can
 31     change its delegate at run time. */
 32  
 33  class DelegatingMethodAccessorImpl extends MethodAccessorImpl {
 34     private MethodAccessorImpl delegate;
 35  
 36     DelegatingMethodAccessorImpl(MethodAccessorImpl delegate) {
 37       setDelegate(delegate);
 38     }
 39  
 40     public Object invoke(Object obj, Object[] args)
 41       throws IllegalArgumentException, InvocationTargetException
 42     {
 43       return delegate.invoke(obj, args);
 44     }
either the MethodAccessorImpl delegate is incorrect
or the method is 'inaccessible' or is incorrect

to verify method if you have the context try this testcase from com.opensymphony.xwork2.util.reflection.ReflectionContext.java

  public static boolean isDenyMethodExecution(Map<String, Object> context) {
    return getBooleanProperty(ReflectionContextState.DENY_METHOD_EXECUTION, context);
  }

a simpler testcase would be
<%
try
{commentInTag.getClass().getMethod("isUserSubscribedViaEmail",currentUserInTag.getClass());
}
catch(NoSuchMethodException nsme)
{
System.err.println("NoSuchMethodException produced message = "+nsme.getMessage());
}
catch(SecurityException sec_exp)
{
System.err.println("SecurityException produced message "+sec_exp.getMessage());
}
%>

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#getMethod%28java.lang.String,%20java.lang.Class
hth
Martin Gainty
______________________________________________
standard caveats apply



> Date: Sat, 12 Dec 2009 16:51:30 -0800
> Subject: Re: ognl method lookup failure
> From: musachy@(protected)
> To: user@(protected)
>
> I would suggest to put a breakpoint in XWorkMethodAccessor.callMethod
> and see why it is not finding it.
>
> musachy
>
> On Sat, Dec 12, 2009 at 1:44 PM, Dale Newfield <dale@(protected):
> > Often when I'm stumped writing a detailed "help!" message leads me to the
> > bug and I never have to send it. This time I was not so lucky, and since
> > I've already wasted two days on this I was hoping someone here might have an
> > idea to get me out of the weeds.
> >
> > I've got an abstract class "Comment" and a bunch of concrete subclasses
> > thereof. I've got a "displayComment.tag" file that calls itself recursively
> > to display a tree of comments. Among other things this checks the extant
> > subscriptions on the comment in question and displays various
> > subscribe/unsubscribe buttons as appropriate.
> >
> > Mostly this works. There are a couple concrete subclasses of Comment that
> > break in a bizarre way, and I've been stuck on this for two days, so I'm
> > hoping someone here might have a suggestion.
> >
> > I go through the normal annoying dance to push ognl accessible objects into
> > jstl-el accessible locations, passing those as attributes into the .tag file
> > and then set them inside the tag into a namespace accessible from ognl:
> > (yes, I tried with #attr, too--same behavior)
> >
> > inside the .tag:
> > <%@(protected)"
> > rtexprvalue="true"%>
> > <%@(protected)"
> > type="mumble.model.Comment" rtexprvalue="true"%>
> >
> > <c:set var="currentUserInTag" scope="request" value="${currentUser}"/>
> > <c:set var="commentInTag" scope="request" value="${commentToDisplay}"/>
> >
> > Simple tests: <s:property value="%{#request.currentUserInTag.class}"/> and
> > <s:property value="%{#request.commentInTag.class}"/> show the appropriate
> > (concrete) classes.
> >
> > Whereas in most instances this OGNL logic works:
> > #request.commentInTag.isUserSubscribedViaEmail(#request.currentUserInTag)
> >
> > for these two specific concrete classes (due I believe to
> > struts.ognl.logMissingProperties=true) it results in a log entry:
> > Could not find method
> > [#request.commentInTag.isUserSubscribedViaEmail(#request.currentUserInTag)]
> >
> > I am able to interrogate the object and find the expected methods:
> > <s:property value="%{#request.commentInTag.class.methods.{?
> > #this.name=='isUserSubscribedViaEmail'}[0]}"/> results in "public boolean
> > mumble.model.CommunityFunItem.isUserSubscribedViaEmail(mumble.model.User)
> >
> > but I'm also unable to get further with that: <s:property
> > value="%{#request.commentInTag.class.methods.{?
> > #this.name=='isUserSubscribedViaEmail'}[0].invoke(#request.commentInTag,#request.currentUserInTag)}"/>
> > results in the log entry: Could not find method
> > [#request.commentInTag.class.methods.{?
> > #this.name=='isUserSubscribedViaEmail'}[0].invoke(#request.commentInTag,#request.currentUserInTag)]
> >
> > Maybe related: if I try to access the Class method "Method getMethod(String
> > name, Class... parameterTypes)" directly to get the right one (instead of
> > getting all of them and looking for one with the right name) I end up with
> > this log message:
> >
> > Caught an exception while evaluating expression
> > '#request.commentInTag.class.getMethod('isUserSubscribedViaEmail',#request.currentUserInTag.class)'
> > against value stack
> > java.lang.IllegalArgumentException: java.lang.ClassCastException@(protected)
> >     at sun.reflect.GeneratedMethodAccessor1387.invoke(Unknown Source)
> >     at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
> >     at java.lang.reflect.Method.invoke (Method.java:585)
> >     at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:851)
> >
> >
> > Again, this works with some concrete subclasses of Comment, but not others.
> > There are no substantial differences between them as far as I can tell.
> > Any ideas/leads/suggestions/suppositions welcome.
> >
> > I'm using struts 2.1.8.1, ognl 2.7.3, yes I have javassist-3.8.1.jar in
> > WEB-INF/lib. Running under glassfish if that matters.
> >
> > -Dale
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
           
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/
©2008 gg3721.com - Jax Systems, LLC, U.S.A.