Account Options

  1. Sign in
Google Groups Home
« Groups Home
ClassNotFoundException
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
  8 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
 
zvika...@gmail.com  
View profile  
 More options May 18 2009, 8:15 am
From: zvika...@gmail.com
Date: Mon, 18 May 2009 05:15:16 -0700 (PDT)
Local: Mon, May 18 2009 8:15 am
Subject: ClassNotFoundException
I have a class A that contains a reference to another class B.

Calling TwoLattes.createMarshaller with class A fails with
ClassNotFoundException thrown for the nested class B.

Code is running in application server and both classes A & B are in
the same location. What might be the source of the problem?

thanks


 
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.
Pascal-Louis Perez  
View profile  
 More options May 18 2009, 1:20 pm
From: Pascal-Louis Perez <pascallouispe...@gmail.com>
Date: Mon, 18 May 2009 10:20:39 -0700
Local: Mon, May 18 2009 1:20 pm
Subject: Re: ClassNotFoundException
Would you have some sample code? Is this fully reproducible or intermittent?

PL

On Mon, May 18, 2009 at 5:15 AM,  <zvika...@gmail.com> wrote:

> I have a class A that contains a reference to another class B.

> Calling TwoLattes.createMarshaller with class A fails with
> ClassNotFoundException thrown for the nested class B.

> Code is running in application server and both classes A & B are in
> the same location. What might be the source of the problem?

> thanks

--
Play, Learn, Earn - www.kaChing.com

 
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.
zvika...@gmail.com  
View profile  
 More options May 19 2009, 2:28 am
From: zvika...@gmail.com
Date: Mon, 18 May 2009 23:28:15 -0700 (PDT)
Local: Tues, May 19 2009 2:28 am
Subject: Re: ClassNotFoundException

Classes are below.
I'd also like to point out that after changing the followings in
EntitySignatureVisitor

        ClassLoader loader = Thread.currentThread
().getContextClassLoader(); //Added
        Class<?> c = Class.forName(className.replace('/',
'.'),false,loader);  // Added

//        Class<?> c = Class.forName(className.replace('/', '.'));

the problem has disappeared.

Class A is:
 @com.twolattes.json.Entity
 public class ShoppingCartView  implements java.io.Serializable,
java.lang.Cloneable {
     @com.twolattes.json.Value
     (name = "shoppingCartId", optional = true)
     private java.lang.String m_ShoppingCartId;
     @com.twolattes.json.Value
     (name = "totalOc", optional = true)
     private java.lang.Double m_TotalOc;
     @com.twolattes.json.Value
     (name = "shoppingCartItems", optional = true)
     private
com.amdocs.css.core.order.shoppingcart.ShoppingCartItemView[]
m_ShoppingCartItems;
 }

Class B is:
 @com.twolattes.json.Entity
 public class ShoppingCartItemView  implements java.io.Serializable,
java.lang.Cloneable {
     @com.twolattes.json.Value
     (name = "shoppingCartItemId", optional = true)
     private java.lang.String m_ShoppingCartItemId;
     @com.twolattes.json.Value
     (name = "quantity", optional = true)
     private java.lang.Integer m_Quantity;
     @com.twolattes.json.Value
     (name = "oc", optional = true)
     private java.lang.Double m_Oc;
     @com.twolattes.json.Value
     (name = "isConfigure", optional = true)
     private java.lang.Boolean m_IsConfigure;
 }

On May 18, 8:20 pm, Pascal-Louis Perez <pascallouispe...@gmail.com>
wrote:


 
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.
Pascal-Louis Perez  
View profile  
 More options May 19 2009, 2:48 am
From: Pascal-Louis Perez <pascallouispe...@gmail.com>
Date: Mon, 18 May 2009 23:48:44 -0700
Local: Tues, May 19 2009 2:48 am
Subject: Re: ClassNotFoundException
Based on your fix, it seams that the class loader which loaded the
EntitySignatureVisitor (I suppose the json jar?), is unable to find
ShoppingCartItemView. It would be interesting to know what is the
class path on which the JsonMarshaller is loaded, as well as the
classpath of the ShoppingCartItemView.

Since things work with the context class loader (the one that was used
to create the current thread) it means that your class loaders are
somewhat isolated from each other (very normal in a web app context).

It might be wise for the JsonMarshaller to allow passing the class
loader to be used, something like

  TwoLattes.createMarshaller(Foo.class, myClassLoader);

this way it would be easy to override the default behavior.

Does that sound reasnnable?

PL

--
Play, Learn, Earn - www.kaChing.com

 
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.
zvika...@gmail.com  
View profile  
 More options May 20 2009, 8:36 am
From: zvika...@gmail.com
Date: Wed, 20 May 2009 05:36:03 -0700 (PDT)
Local: Wed, May 20 2009 8:36 am
Subject: Re: ClassNotFoundException
Yes, it'll be helpfull. It requires changes to the library, right?

I'm still puzzled regrading how the containing class was loaded while
the nested class has not.

On May 19, 9:48 am, Pascal-Louis Perez <pascallouispe...@gmail.com>
wrote:


 
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.
Pascal-Louis Perez  
View profile  
 More options Jun 4 2009, 9:37 am
From: Pascal-Louis Perez <pascallouispe...@gmail.com>
Date: Thu, 4 Jun 2009 06:37:32 -0700
Local: Thurs, Jun 4 2009 9:37 am
Subject: Re: ClassNotFoundException
It does, yes.

It is hard to say without knowing the code, but it is feasible that
the outer class is loaded by the framework but the inner class is
never referenced prior to the JM accessing it. The JVM has no notion
of inner classes, it is pure syntactic sugar offered by Java and so it
is absolutely feasible to load an outer class without loading the
inner class.

PL

--
Play, Learn, Earn - www.kaChing.com

 
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.
zvika...@gmail.com  
View profile  
 More options Jun 7 2009, 9:36 am
From: zvika...@gmail.com
Date: Sun, 7 Jun 2009 06:36:40 -0700 (PDT)
Local: Sun, Jun 7 2009 9:36 am
Subject: Re: ClassNotFoundException
Do you think the fix will be part of the next version?

Actually the two classes are defined in separate files and one class
simply references the other.

On Jun 4, 4:37 pm, Pascal-Louis Perez <pascallouispe...@gmail.com>
wrote:


 
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.
Pascal-Louis Perez  
View profile  
 More options Jun 7 2009, 4:08 pm
From: Pascal-Louis Perez <pascallouispe...@gmail.com>
Date: Sun, 7 Jun 2009 13:08:14 -0700
Local: Sun, Jun 7 2009 4:08 pm
Subject: Re: ClassNotFoundException
The best way to ensure that, is to submit a patch.

It might make it, yes. But the issue 2 and 20 have higher priority.

PL

--
Play, Learn, Earn - www.kaChing.com

 
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 »