I am glad you got this working, as investigating it fully may take time.
> It doesn't seem like I should have to go through all these hoops when I'm
> using maven to manage my dependencies for me.
Agreed. And I don't think it has anything to do with Maven or Cayenne. On the
surface looks like
I'm using glassfish 3.1.2. I have managed to get this working though.
What I ended up doing was explicitly putting the velocity jar file in my
domains/domain1/lib folder under glassfish . This then resulted in a new class
loader exception about commons.lang.StringUtils. So I put commons-lang-2.
SQLTemplate backend relies on Velocity. EJBQLQuery backend relies on
SQLTemplate. No other queries rely on Velocity or SQLTemplate, and Java class
loading is lazy. So Velocity is likely the culprit.
So which Glassfish version do you have? Maybe I can try a basic test in an
isolated environment
OK. One more level down the rabbit hole now…
now that I have velocity seemingly loading, I get this in the stack trace:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
org.apache.cayenne.access.jdbc.SQLTemplateProcessor
at
org.apache.cayenne.access.jdbc.SQLTemplateAction.
Like I said, the easiest solution is to put some of the example code I
sent you in place so that it dumps out the full list of resources
found on the classpath at the time of the error.
It might even be something weird and unexpected that causes the problem.
For example, running my j2ee apps insi
I verified that velocity-1.6.3.jar is in my WAR file, and after deploying my
app it is sitting in the WEB-INF/lib directory as well. This was as I expected.
If glass fish is somehow loading a different one I don't know where it would be
coming from. I did do a search through every jar and war f
My first guess would be that you have more than one velocity jar files
in the classpath.
I guess a second possibility is that you have no velocity jar files in
the classpath.
We have an in-house findClass.jsp (backed by a ClassPath bean) which
we use for problems like this to identify all definiti
Hi Rick,
First thing to check is that you have velocity-1.6.3.jar in your .war under
WEB-INF/lib/
If you do, then we need to look for a conflicting velocity.jar under Glassfish
and discuss what we can do about it.
Andrus
On Apr 16, 2013, at 8:38 AM, Rick Bonnett wrote:
> I'm trying to use
I'm trying to use SQLTemplate queries and running into a strange problem. This
snippet works fine if I run it in a plain Java application, but fails if I then
use it within a web service running under Glassfish.
In both cases I am using the same cayenne metadata files. I have also noticed
the sa