error in contract: package javax.persistence does not exist - invalid classpath?

88 views
Skip to first unread message

petark...@gmail.com

unread,
Jan 22, 2019, 6:31:36 PM1/22/19
to cofoja
Hello,

I'm having trouble with building (and thus running) the contracts via Eclipse. I have setup eclipse with the following parameters:

com.google.java.contract.classoutput:        %PROJECT.DIR%/bin

com.google.java.contract.classpath:         %PROJECT.DIR%/lib/cofoja-1.3-20160207.jar

com.google.java.contract.sourcepath:       %PROJECT.DIR%/src/java


Build yields the following errors:

null
org.eclipse.jdt.apt.pluggable.core
Info
Wed Jan 23 00:26:41 CET 2019
error in contract: package org.primefaces.model does not exist


or the same with javax.persistence, or missing Entity symbols (from Hybernate). I know that I have setup the basic stuff correctly, because a Test.java inside src/java/CofojaTest in the same project runs the checks properly (and throws exceptions when needed).

This got me thinking that my classpath is not right (in the annotation processor settings) but I'm unable to resolve it.

Any help is highly appreciated!

Thank you kindly,
Petar



petark...@gmail.com

unread,
Jan 22, 2019, 7:01:52 PM1/22/19
to cofoja
As it usually goes, after attempting for hours and hours, just 10 minutes after posting the question - I've figured it out.

My com.google.java.contract.classpath now has absolute paths to all dependent .jars, separated by semi-colons. I now have proper .contract files as well.

example, if anyone else ever has the same issue. it's ugly, but it works:

D:\temp_jar\cofoja-1.3-20160207.jar;D:\temp_jar\primefaces-6.0.jar;D:\temp_jar\javax.persistence.jar;D:\temp_jar\javax.faces.jar;D:\temp_jar\hibernate-core-5.2.11.Final.jar;D:\temp_jar\javax.inject.jar

Regards,
Petar

Bharat Jayaraman

unread,
Jan 23, 2019, 9:03:42 AM1/23/19
to cof...@googlegroups.com
Hi Peter,

Sorry for the delayed reply, but glad you figured it out.  

Attached are notes that I made on installing CoFoJa -- which has not been easy under JDK 1.8.

Best,
Bharat
===




--
You received this message because you are subscribed to the Google Groups "cofoja" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cofoja+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
CoFoJa_Installation.pdf
Reply all
Reply to author
Forward
0 new messages