You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by farmer2008 <ee...@ncf.ca> on 2008/11/18 18:16:13 UTC

s1: get Class object

In my project with struts 1.3.5, Class object can only be created via
anInstance.getClass(). If I use Class.forName(...) or .class, I get
java.lang.NoClassDefFoundError: <class name>. Is it a struts issue? Is there
a way we still can use .class syntax to get a Class object?

Thanks.
-- 
View this message in context: http://www.nabble.com/s1%3A-get-Class-object-tp20564120p20564120.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s1: get Class object

Posted by farmer2008 <ee...@ncf.ca>.
Yes.

I guess the issue is related to ClassLoader so I enforce to use system class
loader like this:

try {
   Class cls = Class.forName("...", true,
ClassLoader.getSystemClassLoader());
} catch (...) {}

but still failed. Since I'm using eclipse 3, is there a setting of class
loader in eclipse?

Thanks.


Mead Lai wrote:
> 
> Do you create an object In the struts Action?
> or others, i.e formBean?
> 
> On Wed, Nov 19, 2008 at 1:16 AM, farmer2008 <ee...@ncf.ca> wrote:
> 
>>
>> In my project with struts 1.3.5, Class object can only be created via
>> anInstance.getClass(). If I use Class.forName(...) or .class, I get
>> java.lang.NoClassDefFoundError: <class name>. Is it a struts issue? Is
>> there
>> a way we still can use .class syntax to get a Class object?
>>
>> Thanks.
>> --
>> View this message in context:
>> http://www.nabble.com/s1%3A-get-Class-object-tp20564120p20564120.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> BestRegards,
> Mead
> http://yayisoft.com
> 
> Lily Tomlin  - "The trouble with the rat race is that even if you win,
> you're still a rat."
> 
> 

-- 
View this message in context: http://www.nabble.com/s1%3A-get-Class-object-tp20564120p20587297.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s1: get Class object

Posted by Mead Lai <la...@gmail.com>.
Do you create an object In the struts Action?
or others, i.e formBean?

On Wed, Nov 19, 2008 at 1:16 AM, farmer2008 <ee...@ncf.ca> wrote:

>
> In my project with struts 1.3.5, Class object can only be created via
> anInstance.getClass(). If I use Class.forName(...) or .class, I get
> java.lang.NoClassDefFoundError: <class name>. Is it a struts issue? Is
> there
> a way we still can use .class syntax to get a Class object?
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/s1%3A-get-Class-object-tp20564120p20564120.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
BestRegards,
Mead
http://yayisoft.com

Lily Tomlin  - "The trouble with the rat race is that even if you win,
you're still a rat."