RE: WOUnit testing with partial entities

2013-08-19 Thread Martin B
I get the same stacktrace but in my case I get the error when starting up my 
application and sometimes at Runtime, which makes it even worst.  As Paul said 
below, it works well in development, but the problems appears randomly as soon 
as I deploy on linux (CentOS).  I have been look for a solution to this for 
weeks, any help would be appreciated.
Thanks!
Martin

> Subject: Re: WOUnit testing with partial entities
> From: pa...@logicsquad.net
> Date: Sat, 17 Aug 2013 20:59:57 +0930
> To: hpra...@gmail.com
> CC: webobjects-dev@lists.apple.com
> 
> Hi Henrique,
> 
> On 02/08/2013, at 9:08 AM, Henrique Prange  wrote:
> 
> > Good to hear.
> > 
> > I'm trying to solve another problem that seems related to the EOF 
> > initialization. I'm going to release a new version of WOUnit during the 
> > weekend (solving the other problem or not).
> 
> Just out of interest, what was the other problem you were having with EOF 
> initialisation?  I've updated to that 1.3-SNAPSHOT build across a range of 
> projects, and while it fixes the issue with partial entities, _some_ tests 
> that were passing under 1.2 are now failing, and it seems to be during EO 
> initialisation, for example setting up @Dummy EOs.  Worse, everything is fine 
> in development, the tests are only failing once they hit the Jenkins build 
> server, which makes it awful to debug.
> 
> Here's an example stack trace at the point of failure, for what it's worth.  
> I'm a bit stumped.  Can you see anything meaningful?
> 
>[junit] Testcase: 
> testToString(net.logicsquad.lssurvey.model.SurveyInstanceTest):  Caused an 
> ERROR
>[junit] java.lang.reflect.InvocationTargetException
>[junit] com.webobjects.foundation.NSForwardException 
> [java.lang.reflect.InvocationTargetException] 
> null:java.lang.reflect.InvocationTargetException
>[junit]at 
> com.webobjects.foundation._NSUtilities._explainInstantiationException(_NSUtilities.java:626)
>[junit]at 
> com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:665)
>[junit]at 
> com.webobjects.eoaccess.EOEntityClassDescription.createInstanceWithEditingContext(EOEntityClassDescription.java:242)
>[junit]at 
> com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:216)
>[junit]at 
> com.wounit.rules.MockEditingContext.createSavedObject(MockEditingContext.java:177)
>[junit]at 
> com.wounit.rules.MockEditingContext$DummyFacade.create(MockEditingContext.java:83)
>[junit]at 
> com.wounit.rules.AnnotationProcessor.createEOForType(AnnotationProcessor.java:49)
>[junit]at 
> com.wounit.rules.AnnotationProcessor.initializeObject(AnnotationProcessor.java:172)
>[junit]at 
> com.wounit.rules.AnnotationProcessor.process(AnnotationProcessor.java:205)
>[junit]at 
> com.wounit.rules.MockEditingContext.before(MockEditingContext.java:149)
>[junit]at 
> com.wounit.rules.AbstractEditingContextRule$1.evaluate(AbstractEditingContextRule.java:160)
>[junit] Caused by: java.lang.reflect.InvocationTargetException
>[junit]at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:532)
>[junit]at 
> com.webobjects.foundation._NSUtilities.instantiateObjectWithConstructor(_NSUtilities.java:659)
>[junit] Caused by: java.lang.NullPointerException
>[junit]at 
> com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
>[junit]at 
> com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
>[junit]at 
> com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
>[junit]at 
> com.webobjects.eoaccess.EOAttribute.(EOAttribute.java:998)
>[junit]at 
> com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
>[junit]at 
> com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789)
>[junit]at 
> com.webobjects.eoaccess.EOEntity.classProperties(EOEntity.java:1098)
>[junit]at 
> com.webobjects.eoaccess.EOEntity._propertyDictionaryInitializer(EOEntity.java:3321)
>[junit]at 
> com.webobjects.eoaccess.EOEntity._newDictionaryForProperties(EOEntity.java:3667)
>[junit]at 
> com.webobjects.eoaccess.EOEntityClassDescription._newDictionaryForProperties(EOEntityClassDescription.java:88)
>[junit]at 
> com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:111)
>[junit]at 
> com.webobjects.eocontrol.EOGenericRecord.__setClassDescription(EOGenericRecord.java:100)
>[junit]at 
> com.webobjects.eocontrol.EOGenericRecord.(EOGenericRecord.java:73)
>[junit]at 
> er.extensions.eof.ERXGenericRecord.(ERXGenericRecord.java:102)
>[junit]at 
> net.logicsquad.webobjects.core.eof.LSGenericRecord.(LSGenericRecord.java:54)
>[junit]at 
> net.logicsquad.lssurvey.model.survey._Survey.(_Survey.java:15)
>[junit]at 
> net.logicsquad.lssurvey.model.survey.Survey.(Survey.java:491)
>[

RE: createPrototypeCache NullPointerException

2013-07-30 Thread Martin B



Thanks Fabian,
I'm currently looking at both files, trying to compare them.  The thing is that 
the Maven configuration file includes a lot more jars in the classpath that our 
previous configuration (like JavaWOJSPServlet and stuff like that) so I guess I 
will try to exclude a few things I don't need and see if it changes anything.
Martin

> Subject: Re: createPrototypeCache NullPointerException
> From: lists.fab...@e-lumo.com
> Date: Mon, 29 Jul 2013 22:00:55 +0200
> CC: syrinx2...@msn.com
> To: webobjects-dev@lists.apple.com
> 
> Hi Martin,
> 
> Have you compared the classpath files of the ant- vs maven-built apps? If 
> you're deploying on unix: "YourApp.woa/Contents/UNIX/UNIXClassPath.txt"
> 
> Fabian
> 
> Am 29.07.2013 um 21:20 schrieb Martin B:
> 
> > Hi everybody,
> > 
> > I have a few Wonder applications that were deployed with Maven recently 
> > which seem to be crashing randomly.  Some are of these applications are 
> > completely new, but others have been running for years (deployed with ANT) 
> > without such problem.  The stacktrace looks like this:
> > 
> > 21951 [main] WARN NSLog  - A fatal exception occurred: null
> > [2013-7-29 14:59:28 EDT]  java.lang.NullPointerException
> > at 
> > com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
> > at 
> > com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
> > at 
> > com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
> > at com.webobjects.eoaccess.EOAttribute.(EOAttribute.java:367)
> > at com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
> > at com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789)
> > at 
> > com.webobjects.eoaccess.EOEntity.primaryKeyAttributes(EOEntity.java:1315)
> > at 
> > er.rest.ERXEORestDelegate.__hasNumericPrimaryKeys(ERXEORestDelegate.java:33)
> > at 
> > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:542)
> > at 
> > er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:519)
> > at com.oaciq.pfco.serveur.Application.initREST(Application.java:34)
> > at com.oaciq.pfco.serveur.Application.(Application.java:26)
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> > at 
> > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> > at 
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> > at java.lang.Class.newInstance0(Class.java:355)
> > at java.lang.Class.newInstance(Class.java:308)
> > at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
> > at er.extensions.appserver.ERXApplication.main(ERXApplication.java:821)
> > at com.oaciq.pfco.serveur.Application.main(Application.java:21)
> > 
> > I have tried many different things but I cannot find a solution.  This is 
> > driving me NUTS!  Hints anyone?
> > 
> > Thank you.
> > 
> > Martin
> > 
> > ___
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/webobjects-dev/lists.fabian%40e-lumo.com
> > 
> > This email sent to lists.fab...@e-lumo.com
> 

   ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

createPrototypeCache NullPointerException

2013-07-29 Thread Martin B
Hi everybody,

I have a few Wonder applications that were deployed with Maven recently which 
seem to be crashing randomly.  Some are of these applications are completely 
new, but others have been running for years (deployed with ANT) without such 
problem.  The stacktrace looks like this:

21951 [main] WARN NSLog  - A fatal exception occurred: null
[2013-7-29 14:59:28 EDT]  java.lang.NullPointerException
at com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:631)
at com.webobjects.eoaccess.EOModel.prototypeAttributeNamed(EOModel.java:699)
at 
com.webobjects.eoaccess.ERXModel.prototypeAttributeNamed(ERXModel.java:315)
at com.webobjects.eoaccess.EOAttribute.(EOAttribute.java:367)
at com.webobjects.eoaccess.EOEntity.attributes(EOEntity.java:816)
at com.webobjects.eoaccess.EOEntity.attributeNamed(EOEntity.java:789)
at com.webobjects.eoaccess.EOEntity.primaryKeyAttributes(EOEntity.java:1315)
at 
er.rest.ERXEORestDelegate.__hasNumericPrimaryKeys(ERXEORestDelegate.java:33)
at 
er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:542)
at 
er.rest.routes.ERXRouteRequestHandler.addDefaultRoutes(ERXRouteRequestHandler.java:519)
at com.oaciq.pfco.serveur.Application.initREST(Application.java:34)
at com.oaciq.pfco.serveur.Application.(Application.java:26)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
at er.extensions.appserver.ERXApplication.main(ERXApplication.java:821)
at com.oaciq.pfco.serveur.Application.main(Application.java:21)

I have tried many different things but I cannot find a solution.  This is 
driving me NUTS!  Hints anyone?

Thank you.

Martin

   ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

RE: Barcode example

2013-05-14 Thread Martin B
Hi,
Zxing (https://code.google.com/p/zxing/) allows you to read and write barcodes. 
 Here is a simple example of a barcode writer using zxing.  I hope this can 
help.
public static BufferedImage generateBarcode(String text, int widthInPixels, int 
heightInPixels, BarcodeFormat barcodeType) {BitMatrix bitMatrix;
Writer writer;  switch (barcodeType) {  case CODE_39:   
writer = new Code39Writer();break;  case 
CODE_128:  writer = new Code128Writer();   
break;  case QR_CODE:   writer = new QRCodeWriter();
break;  default:throw new 
RuntimeException("Unknown type or not supported.");   }
try {   bitMatrix = writer.encode(text, barcodeType, 
widthInPixels, heightInPixels, null);
} catch (WriterException e) {   throw new 
RuntimeException("Error during bacode generation", e);}
BufferedImage barcodeImage = 
MatrixToImageWriter.toBufferedImage(bitMatrix);
return barcodeImage;}
Martin
> Subject: Re: Barcode example
> From: rgur...@smarthealth.com
> Date: Mon, 13 May 2013 10:46:27 -0700
> To: jbea...@gmail.com
> CC: webobjects-dev@lists.apple.com
> 
> You need to specify the type of barcode you plan on using.
> 
> On May 12, 2013, at 11:19 PM, Jake Bearkley wrote:
> 
> > 
> > Hi All
> > 
> > Does anyone have any code snippets or examples to show a barcode being 
> > generated and printed
> > 
> > And then a barcode reader used to input into their application?
> > 
> > Thanks in advance
> > Bearko
> > ___
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
> > 
> > This email sent to rgur...@smarthealth.com
> 
> 
>  ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/syrinx2002%40msn.com
> 
> This email sent to syrinx2...@msn.com
  
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Creating a WO Maven project

2013-04-19 Thread Martin B
Hi Hugi,
I have to agree with you about WO not being maven friendly, but with a few 
tweaks and minor adjustments it's definitely possible.  I've migrated a bunch 
of old WO applications that were running on ant successfully.  The only problem 
I still have to solve is Eclipse debugging with Maven, but that's more like 
M2Eclipse issue.
That being said, if you need help I will be at WOWODC in a few months, maybe I 
could share some tricks with you (who whoever would be interested).
Martin

> Subject: Re: Creating a WO Maven project
> From: h...@karlmenn.is
> Date: Thu, 18 Apr 2013 18:46:00 +
> To: list...@dakri.com
> CC: webobjects-dev@lists.apple.com
> 
> FWIW I use Maven (and more recently, Gradle) for everything except WO. WO 
> hates Maven and the more influential WO-folks hate Maven too, so currently 
> it's just easier to use Ant.
> 
> - hugi
> 
> 
> 
> On 18.4.2013, at 17:02, Faizel Dakri  wrote:
> 
> > I believe the Wonder projects have customized pom.xml files that specify 
> > the sourceDirectory explicitly. But this is sort of going against the maven 
> > standard. There was an old page on the wiki that touched on this:
> > 
> > http://wiki.wocommunity.org/display/documentation/Maven+Kicking+the+tyres+without+changing+your+project+structure
> > 
> > F
> > 
> > On 2013-Apr-18, at 11:25 AM, Pascal Robert  wrote:
> > 
> >> So, no way to have fluffy bunny with Maven? How it's working for Wonder 
> >> then?
> >> 
> >>> The documentation needs……(drum roll)….
> >>> updating…
> >>> 
> >>> Use the command line (make an alias, you won't remember it) :
> >>> 
> >>> mvn archetype:generate -DarchetypeCatalog=local 
> >>> 
> >>> This assumes you have the catalog archetype-catalog.xml in ~/.m2
> >>> 
> >>> If so you see:
> >>> 
> >>> [INFO] No archetype defined. Using maven-archetype-quickstart 
> >>> (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
> >>> Choose archetype:
> >>> 1: local -> org.objectstyle.woproject.maven2:erxapplication-archetype 
> >>> (Wonder Application Archetype)
> >>> 2: local -> org.objectstyle.woproject.maven2:erxapplication-d2w-archetype 
> >>> (Wonder D2W Application Archetype)
> >>> 3: local -> 
> >>> org.objectstyle.woproject.maven2:erxapplication-servlet-archetype (Wonder 
> >>> Servlet Application Archetype)
> >>> 4: local -> 
> >>> org.objectstyle.woproject.maven2:partial-woapplication-servlet-archetype 
> >>> (Partial WebObjects Servlet Application Archetype)
> >>> 5: local -> org.objectstyle.woproject.maven2:woapplication-archetype 
> >>> (WebObjects Application Archetype)
> >>> 6: local -> 
> >>> org.objectstyle.woproject.maven2:woapplication-servlet-archetype 
> >>> (WebObjects Servlet Application Archetype)
> >>> 7: local -> org.objectstyle.woproject.maven2:woframework-archetype 
> >>> (WebObjects Framework Archetype)
> >>> Choose a number or apply filter (format: [groupId:]artifactId, case 
> >>> sensitive contains): : 
> >>> 
> >>> 
> >>> Pick a number, and an application is created--no eclipse!
> >>> 
> >>> Now import it into eclipse. But is maven layout, not fluffy bunny. You 
> >>> can override the standard locations src/, but then you are deviating from 
> >>> the uber pom. You must specify where the sources are. 
> >>> 
> >>> 
> >>> On Apr 9, 2013, at 9:28 AM, Pascal Robert wrote:
> >>> 
>  Ok, so I'm trying to drink the Maven koolaid, but you are not helping. 
>  Somes pages about Maven on the wiki talks about creating projects by 
>  command line, so about using archetypes in WOLips, but those archetypes 
>  are not in WOLips.
>  
>  So, what are the steps to create a Maven project with the "Fluffy Bunny" 
>  layout in WOLips?
>  ___
>  Do not post admin requests to the list. They will be ignored.
>  Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>  Help/Unsubscribe/Update your Subscription:
>  https://lists.apple.com/mailman/options/webobjects-dev/gsbrown%40umich.edu
>  
>  This email sent to gsbr...@umich.edu
> >>> 
> >>> 
> >>> Greg Brown
> >>> gsbr...@umich.edu
> >>> 
> >>> 
> >>> 
> >>> --
> >>> gsbr...@umich.edu
> >> 
> >> 
> >> ___
> >> Do not post admin requests to the list. They will be ignored.
> >> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> >> Help/Unsubscribe/Update your Subscription:
> >> https://lists.apple.com/mailman/options/webobjects-dev/listfez%40dakri.com
> >> 
> >> This email sent to list...@dakri.com
> > 
> > 
> > ___
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/webobjects-dev/hugi%40karlmenn.is
> > 
> > This email sent to h...@karlmenn.is
> 
> 
>  ___
> Do not post admin reques

FW: [ANN] WOUnit 1.2.2

2013-04-17 Thread Martin B
Hi Michael,

If maven is already installed on you machine, you can easily compile the code 
from the command line by typing the following in the root directory of the 
WOUnit project:
mvn clean package
Then you will be able to retrieve the jar from the "target" subfolder and add 
it to your Eclipse.  I think the only other requirements is that you need junit 
to be present in your classpath.
That's it!
Martin
P.S.: Another solution would be to start using Maven to build your project.  
It's a very useful tool, although it doesn't seem to be very popular in the WO 
community.

> Date: Mon, 15 Apr 2013 16:01:17 -0700
> From: mh...@desertsky.com
> To: webobjects-dev@lists.apple.com
> Subject: Re: [ANN] WOUnit 1.2.2
> 
> Hi Henrique:
> 
> I cloned the wounit git repository and added it to my Eclipse workspace 
> but now I am stuck. I see a bunch of build errors. The JRE is also 
> "hardcoded" to Java 1.5. Can I use Java 1.6? Are there any instructions 
> on how to convert the project to a non-maven project? Or are there any 
> instructions on what I have todo to get wounit to build via maven within 
> Eclipse?
> 
> Michael
> 
> On 4/14/2013 4:02 PM, Henrique Prange wrote:
> > The WOCommunity team is pleased to announce the release of WOUnit 1.2.2.
> > This release includes fixes for bugs reported by the community.
> >
> > The WOUnit framework contains a set of utilities for testing WebObjects
> > applications using JUnit 4.7 or later capabilities. See the WOUnit
> > website for more information:
> >
> > http://hprange.github.com/wounit/
> >
> > Maven users should specify the version in your project's configuration:
> >
> > 
> >  com.wounit
> >  wounit
> >  1.2.2
> > 
> >
> > Non Maven users have to download the wounit-1.2.2.jar:
> >
> > http://maven.wocommunity.org/service/local/repositories/releases/content/com/wounit/wounit/1.2.2/wounit-1.2.2.jar
> >
> > Release Notes - WOUnit - Version 1.2.2
> >
> > ** Bug Fixes
> > * An exception in the cleanup code hide the original exception in
> > failing test cases
> >
> > Enjoy,
> >
> > Henrique
> >
> >
> >   ___
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/webobjects-dev/mhast%40desertsky.com
> >
> > This email sent to mh...@desertsky.com
> >
> 
> -- 
> Tel: (602) 279-4600 ext: 635
> Desert Sky Software: www.desertsky.com
>  Specializing in the Development and Hosting of
>  e-Business Applications.
>  ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/syrinx2002%40msn.com
> 
> This email sent to syrinx2...@msn.com

  
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com