• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JUnit and Classpath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JUnit and Classpath


  • Subject: Re: JUnit and Classpath
  • From: Frédéric JECKER <email@hidden>
  • Date: Tue, 05 Aug 2008 10:24:17 +0200

Hi,

I digged one more day and found that this error was caused by a static initializer of one of the bundle's class.
I reordered the classpath, and now it works fine.


I'd also thank chuck for a previous post where all is clearly explained :
http://lists.apple.com/archives/webobjects-dev/2007/Nov/msg00699.html

Regards

Fred

Frédéric JECKER a écrit :

Hi list,

I made a simple Junit test case in one of my framework, which only loads a model an tries to read an EO and writes another one.
In the setUp method, I load the model, and updates its connexion dictionnary.
The test keeps on failing on the EOUtilities.createAndInsertObject, stating that a classcastexception occured.
This method returns an EOGenericRecord instead of my object (which extends EOGenericRecord).
When changing createAndInsertObject to a new() followed by an EOEditingContext(), another error comes up stating that no class description was
found for my Entity.


The "Practical Webobjects" books says that I should update the run config's classpath and add the build/.../resources/java directory.
This ends up with another error :
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.webobjects.foundation._NSUtilities._searchForClassInPackages(_NSUtilities.java:374)


at com.webobjects.foundation.NSBundle.searchForClassInBundles(NSBundle.java:1002)

at com.webobjects.foundation.NSBundle.searchAllBundlesForClassWithName(NSBundle.java:988)

at com.webobjects.foundation.NSBundle.access$300(NSBundle.java:208)
at com.webobjects.foundation.NSBundle$1._searchForClassWithName(NSBundle.java:373)


at com.webobjects.foundation._NSUtilities._classWithPartialName(_NSUtilities.java:344)

at com.webobjects.foundation._NSUtilities.classWithName(_NSUtilities.java:291)

at com.webobjects.eoaccess.EOModel._setEntityForEntityNameClassName(EOModel.java:1242)

......

It's like EO can't find the class associated to my entity (I checked typos... nothing (i use veogen/mike's templates)

Any ideas ??

Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:


This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >JUnit and Classpath (From: Frédéric JECKER <email@hidden>)

  • Prev by Date: Can I use WOMultipartIterator API in WOComponent action methods?
  • Next by Date: Re: Objects marked for delete fall into the updated objects bucket in processRecentChanges
  • Previous by thread: JUnit and Classpath
  • Next by thread: Objects marked for delete fall into the updated objects bucket in processRecentChanges
  • Index(es):
    • Date
    • Thread