You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Alan Baltazar <ac...@yahoo.com> on 2006/04/03 20:58:59 UTC

commit error with cayenne 1.1.4 ,tomcat 5 and mysql 5

hello,

  I'm running the 'cayenne-1.1.4\src\tutorials\cayenne-web-app' sample. everything works
well until I run the 'add artist,painting,gallery' pages. the problem is this, when I
enter to save new data (for an insert), i get this exception:
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling
this request.

exception 

javax.servlet.ServletException: [v.1.1.4 January 5 2006] Commit Exception
	org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause 

org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1.4 January 5 2006] Commit
Exception
	org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1275)
	org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1236)
	action.SaveGalleryAction.execute(SaveGalleryAction.java:34)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28
logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.28

ps: i can entered all complete rights for the user in mysql and was able to physically
insert directly to the mysql database. i'm only having problems inserting from thia app.

thanks,
alan


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Antwort: Re: Reengineer DB schema in PostgreSQL

Posted by Andrus Adamchik <an...@objectstyle.org>.
Excellent, I meant to ask about that. I just cross-linked CAY-402 and  
CAY-457 in Jira.

Andrus


On Apr 11, 2006, at 2:43 PM, Heiko.Erhardt@gi-de.com wrote:

> I had exactly the same problem and wrote an extension to Cayenne  
> (for 1.2
> M11), which enables custom relationship member naming and a full  
> roundtrip
> including sequence generator support.
> The patch has been submitted it as CAY-457.
> Andrus made some comments re. changes of the patch and I'm still  
> urgently
> struggling for some time to adjust the patch.
> Andrus, I didn't forget about the issue and will definately come  
> back to
> it, maybe next week. Got a hell of a lot to do at the moment...
> --
> Heiko Erhardt
>
>
> "Mike Kienenberger" <mk...@gmail.com> schrieb am 11.04.2006  
> 00:47:28:
>
>> On 4/10/06, WONDER <mm...@web.de> wrote:
>>> 1. These names are not my faivorte choose, so is it possible to  
>>> decide
>>> somewhere what name does the Relationships should be?
>>> 2. I can change the names after I get the schema from the DB. the
> problem
>>> is, I have to rename the relations after everytime I reengineer the
> schema.
>>> Its even worse. Reengineering the schema creates the same  
>>> relationships
> if I
>>> changed the name.
>>
>>> hmm! what to do?
>>
>> It's on the roadmap, although not for 1.2.
>>
>> Keep an eye on this issue, or better yet, submit patches to  
>> implement it
> :)
>>
>> http://objectstyle.org/jira/browse/CAY-402
>
>


Antwort: Re: Reengineer DB schema in PostgreSQL

Posted by He...@gi-de.com.
I had exactly the same problem and wrote an extension to Cayenne (for 1.2
M11), which enables custom relationship member naming and a full roundtrip
including sequence generator support.
The patch has been submitted it as CAY-457.
Andrus made some comments re. changes of the patch and I'm still urgently
struggling for some time to adjust the patch.
Andrus, I didn't forget about the issue and will definately come back to
it, maybe next week. Got a hell of a lot to do at the moment...
--
Heiko Erhardt


"Mike Kienenberger" <mk...@gmail.com> schrieb am 11.04.2006 00:47:28:

> On 4/10/06, WONDER <mm...@web.de> wrote:
> > 1. These names are not my faivorte choose, so is it possible to decide
> > somewhere what name does the Relationships should be?
> > 2. I can change the names after I get the schema from the DB. the
problem
> > is, I have to rename the relations after everytime I reengineer the
schema.
> > Its even worse. Reengineering the schema creates the same relationships
if I
> > changed the name.
>
> > hmm! what to do?
>
> It's on the roadmap, although not for 1.2.
>
> Keep an eye on this issue, or better yet, submit patches to implement it
:)
>
> http://objectstyle.org/jira/browse/CAY-402


Re: Reengineer DB schema in PostgreSQL

Posted by Mike Kienenberger <mk...@gmail.com>.
On 4/10/06, WONDER <mm...@web.de> wrote:
> 1. These names are not my faivorte choose, so is it possible to decide
> somewhere what name does the Relationships should be?
> 2. I can change the names after I get the schema from the DB. the problem
> is, I have to rename the relations after everytime I reengineer the schema.
> Its even worse. Reengineering the schema creates the same relationships if I
> changed the name.

> hmm! what to do?

It's on the roadmap, although not for 1.2.

Keep an eye on this issue, or better yet, submit patches to implement it :)

http://objectstyle.org/jira/browse/CAY-402

Reengineer DB schema in PostgreSQL

Posted by WONDER <mm...@web.de>.
Hello,

By importing schema from existing DB the toOne Relationship name is
"toClassName" and the toMany is "ClassNameArray"

1. These names are not my faivorte choose, so is it possible to decide
somewhere what name does the Relationships should be?
2. I can change the names after I get the schema from the DB. the problem
is, I have to rename the relations after everytime I reengineer the schema.
Its even worse. Reengineering the schema creates the same relationships if I
changed the name.

3. Ok, I accept the reality and dont change the names.
If I have a Table which hast 2 relations with another table so I get
something like "toUser" and "toUser1". and HERE I have to change the names.

What is the best way to avoid these problems?
According to, everytime I reengineer the schema, the model is not valid,
because of the to many duplicated relationships. deleting and changing the
names forces me to test almost all the application. This makes no fun :(

hmm! what to do?

thanks.


Re: [solved] Re: Cayenne.xml not found.

Posted by Mike Kienenberger <mk...@gmail.com>.
On 4/4/06, Andrus Adamchik <an...@objectstyle.org> wrote:
> I've never used J2EE packaging of WO apps, so I am not sure how its
> class loading works internally, but I would expect WO to "flatten"
> all resources into the container application ClassLoader.

>From what I can tell, it copies all of the jar files out of
Library/Frameworks/*.framework/Resources/Java/*.jar into WEB-INF/lib.

So I'd be very surprised if it added a jar file in
*.woa/Contents/Resources/Java/*.jar to the classpath!   On the other
hand, my application was written under 5.0, and failing to find a
clean upgrade path, I build a new WO 5.2.4 project, and manually
merged my 5.0 project into it, so my project might not be "standard".

Wonder,  in short, I recommend

a) copying your cayenne.xml files into the top level of your
WEB-INF/classes directory.
b) test it to make sure they're found.
c) Then try moving them into a package under classes (ie,
com.xyz.cayenne.model/*.xml)
d) Add the package classpath to the configuration:

       DefaultConfiguration conf = new DefaultConfiguration();
       conf.addClassPath("com/xyz/cayenne/model");
       Configuration.initializeSharedConfiguration(conf);

e) test to make sure they're found.

Re: [solved] Re: Cayenne.xml not found.

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Apr 4, 2006, at 6:20 PM, Mike Kienenberger wrote:

>
> You don't want to use something like this "c:/myPath/Cayenne.xml"
> because it won't work when you go to deploy your application on an
> application server.

Yep. That'll be asking for trouble.

I've never used J2EE packaging of WO apps, so I am not sure how its  
class loading works internally, but I would expect WO to "flatten"  
all resources into the container application ClassLoader. Hence  
standard Cayenne deployment should work and the presence of jars in  
the Resources/Java smells like red herring (so, yes I was wrong and  
Mike is right).

Andrus


Re: [solved] Re: Cayenne.xml not found.

Posted by WONDER <mm...@web.de>.
I agree with you, I am trying to do many stuff at once.
And this should work. particularly that the application using own framework
runs in Eclipse and on WO Server.

I belive 50% the problems on deploying an application is "something not
found".

about  appName.jar, Yes I am sure, I see the path in the output.


about :"c:/myPath/Cayenne.xml"
Yes you are also here write, i dont want to. But for testing is prity great
idea, dont you think?
As a last solution, you create the same path on your server also, and it
"should" work.

however
peaSe


----- Original Message ----- 
From: "Mike Kienenberger" <mk...@gmail.com>
To: <ca...@incubator.apache.org>
Sent: Tuesday, April 04, 2006 4:20 PM
Subject: Re: [solved] Re: Cayenne.xml not found.


On 4/4/06, WONDER <mm...@web.de> wrote:
> The application is too complicated.
> I am prity sure adding the XMLs to the jar file "should" work, but it does
> not.
> I use custom framework and the class which call the Cayenne.xml is there.

I think part of the problem is that you're trying to do too many things at
once.
If I recall, you not only want to integrate Cayenne with WebObjects,
but you are also trying to  use a package name for all of your xml
files.

I think you'd be better off getting Cayenne working with Webobjects in
the default configuration first, then trying to add the packaging of
your xml files.

I posted how you'd get the packaging to work in a previous message.
Dropping your xml files in your src directory should be all that's
needed to get them into your class package, provided your build script
then copies them over into your classes directory or jar file.

Are you sure that your appName.jar is read out of Resources/Java?   In
my WO 5.2 project, I have a WEB-INF/classes directory that I use
instead of a jar file.   Looking at my Resources/Java/*.jar file, I
see that it's empty.

You don't want to use something like this "c:/myPath/Cayenne.xml"
because it won't work when you go to deploy your application on an
application server.


Re: [solved] Re: Cayenne.xml not found.

Posted by Mike Kienenberger <mk...@gmail.com>.
On 4/4/06, WONDER <mm...@web.de> wrote:
> The application is too complicated.
> I am prity sure adding the XMLs to the jar file "should" work, but it does
> not.
> I use custom framework and the class which call the Cayenne.xml is there.

I think part of the problem is that you're trying to do too many things at once.
If I recall, you not only want to integrate Cayenne with WebObjects,
but you are also trying to  use a package name for all of your xml
files.

I think you'd be better off getting Cayenne working with Webobjects in
the default configuration first, then trying to add the packaging of
your xml files.

I posted how you'd get the packaging to work in a previous message.
Dropping your xml files in your src directory should be all that's
needed to get them into your class package, provided your build script
then copies them over into your classes directory or jar file.

Are you sure that your appName.jar is read out of Resources/Java?   In
my WO 5.2 project, I have a WEB-INF/classes directory that I use
instead of a jar file.   Looking at my Resources/Java/*.jar file, I
see that it's empty.

You don't want to use something like this "c:/myPath/Cayenne.xml"
because it won't work when you go to deploy your application on an
application server.

Re: [solved] Re: Cayenne.xml not found.

Posted by Paul Furbacher <pf...@mac.com>.
On Apr 4, 2006, at 10:02 AM, WONDER wrote:

> The solution: I added the path to the Cayenne.xml file to the  
> classpath of
> TomCat.

That is something you want to avoid like the plague.  Putting  
application
resources in the Tomcat path is very bad practice.  You really have  
to find a
better solution than that.


Paul Furbacher
http://teamb.com



[solved] Re: Cayenne.xml not found.

Posted by WONDER <mm...@web.de>.
Hello Andrus,

I tried what you suggested, sorry to say "It didnt work".

The application is too complicated.
I am prity sure adding the XMLs to the jar file "should" work, but it does
not.
I use custom framework and the class which call the Cayenne.xml is there.


        Configuration conf = Configuration.getSharedConfiguration();

        domain = conf.getDomain( domainName );


The solution: I added the path to the Cayenne.xml file to the classpath of
TomCat.

I am really fan from Cayenne. You make a great job. I have only a little
please, maybe its possible to make a last solution which always work
something like adding the full path to the application like
"c:/myPath/Cayenne.xml".

If it is not possible is also ok.

Thanks for help.

peaSakoe



----- Original Message ----- 
From: "Andrus Adamchik" <an...@objectstyle.org>
To: <ca...@incubator.apache.org>
Sent: Tuesday, April 04, 2006 3:16 PM
Subject: Re: Cayenne.xml not found.


> There are probably more elegant solutions, but here is a simple one -
> package all XML files in appName.jar.
>
> Andrus
>
>
> On Apr 4, 2006, at 4:47 PM, WONDER wrote:
>
> > Well the Structure looks like
> > ------------------------------------------------------------
> > AppName
> > +    META-INF
> > +    WEB-INF
> > +        Frameworks
> > +        lib
> > +        PhotoAlbum.woa
> > ++            Contents
> > +++                Resources
> > ++++                    Java
> > +++++                        appName.jar // this is the application
> > jar
> > file.
> > +++++                        Cayenne.xml
> > +++++                        another Cayenne.xml files.
> > +        web.xml
>
>


Re: Cayenne.xml not found.

Posted by Andrus Adamchik <an...@objectstyle.org>.
There are probably more elegant solutions, but here is a simple one -  
package all XML files in appName.jar.

Andrus


On Apr 4, 2006, at 4:47 PM, WONDER wrote:

> Well the Structure looks like
> ------------------------------------------------------------
> AppName
> +    META-INF
> +    WEB-INF
> +        Frameworks
> +        lib
> +        PhotoAlbum.woa
> ++            Contents
> +++                Resources
> ++++                    Java
> +++++                        appName.jar // this is the application  
> jar
> file.
> +++++                        Cayenne.xml
> +++++                        another Cayenne.xml files.
> +        web.xml


Cayenne.xml not found.

Posted by WONDER <mm...@web.de>.
Hello,

Primitive problem, but still cant find the correct solution,

I have a WebObjects application, use Cayenne and want to run the Application
under Tomcat under Windows.

I know how can i run WO Applications under Tomcat "without" Cayenne.

Well the Structure looks like
------------------------------------------------------------
AppName
+    META-INF
+    WEB-INF
+        Frameworks
+        lib
+        PhotoAlbum.woa
++            Contents
+++                Resources
++++                    Java
+++++                        appName.jar // this is the application jar
file.
+++++                        Cayenne.xml
+++++                        another Cayenne.xml files.
+        web.xml
  ------------------------------------------------------------ 

The same WebObjects applications runs on WebObjects Server successfully.
The log I get looks like:
====================================================
DEBUG - using domain file name: cayenne.xml
DEBUG - canInitialize started.
DEBUG - initialize starting.
DEBUG - URL not found with classloader: cayenne.xml
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
com.webobjects.jspservlet.WOServletAdaptor._applicationInit(WOServlet
Adaptor.java:415)
        at
com.webobjects.jspservlet.WOServletAdaptor.initStatics(WOServletAdapt
or.java:78)
        at
com.webobjects.jspservlet.WOServletAdaptor.init(WOServletAdaptor.java
:629)
        at javax.servlet.GenericServlet.init(GenericServlet.java:211)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1105)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:93
2)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3917)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
197)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:759)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:73
9)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)

        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)

        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698
)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472
)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1112)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:310)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)

        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)

        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442
)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:4
50)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:709
)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: com.webobjects.foundation.NSForwardException
[org.objectstyle.cayenne
.ConfigurationException] [v.1.2M12 March 23 2006] Error during Configuration
ini
tialization. [v.1.2M12 March 23 2006]
[org.objectstyle.cayenne.conf.DefaultConfi
guration] : Domain configuration file "cayenne.xml" is not found.:
<Application>
 failed instantiation. Exception thrown :
org.objectstyle.cayenne.ConfigurationException: [v.1.2M12 March 23 2006]
Error d
uring Configuration initialization. [v.1.2M12 March 23 2006]
[org.objectstyle.ca
yenne.conf.DefaultConfiguration] : Domain configuration file "cayenne.xml"
is no
t found.: [v.1.2M12 March 23 2006] Error during Configuration
initialization. [v
.1.2M12 March 23 2006] [org.objectstyle.cayenne.conf.DefaultConfiguration] :
Dom
ain configuration file "cayenne.xml" is not found.
        at
com.webobjects.foundation._NSUtilities._explainInstantiationException
(_NSUtilities.java:567)
        at
com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities
.java:581)
        at
com.webobjects.appserver.WOApplication.primeApplication(WOApplication
.java:411)
        ... 34 more
INFO - Marking servlet WOServletAdaptor as unavailable
ERROR - Servlet /PhotoAlbum threw load() exception
javax.servlet.UnavailableException: Error initializing servlet adaptor: null
        at
com.webobjects.jspservlet.WOServletAdaptor._applicationInit(WOServlet
Adaptor.java:435)
        at
com.webobjects.jspservlet.WOServletAdaptor.initStatics(WOServletAdapt
or.java:78)
        at
com.webobjects.jspservlet.WOServletAdaptor.init(WOServletAdaptor.java
:629)
        at javax.servlet.GenericServlet.init(GenericServlet.java:211)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1105)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:93
2)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3917)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
197)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:759)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:73
9)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)

        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)

        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698
)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472
)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1112)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:310)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)

        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)

        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442
)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:4
50)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:709
)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
04.04.2006 14:42:19 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
04.04.2006 14:42:19 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
====================================================
help?

Thanks.


Re: commit error with cayenne 1.1.4 ,tomcat 5 and mysql 5

Posted by Alan Baltazar <ac...@yahoo.com>.
  It's working now. Thanks!

--- Andrus Adamchik <an...@objectstyle.org> wrote:

> Cool, now I see what it is - a special table used to store generated  
> PK has not been created. In the Modeler go to "Tools -> generate  
> Database Schema" and uncheck all checkboxes except for "Create  
> Primary Key Support" and then click "generate":
> 
> http://objectstyle.org/confluence/display/CAYDOC/Generate+Primary+Key 
> +Support
> 
> Andrus
> 
> 
> On Apr 4, 2006, at 7:52 PM, Alan Baltazar wrote:
> 
> > Caused by: java.sql.SQLException: Table 'art.auto_pk_support'  
> > doesn't exist
> > 	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
> > 	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
> > 	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
> > 	at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)
> > 	at com.mysql.jdbc.Connection.execSQL(Connection.java:2917)
> > 	at com.mysql.jdbc.Statement.execute(Statement.java:529)
> > 	at org.objectstyle.cayenne.dba.mysql.MySQLPkGenerator.getPrimaryKey 
> > (MySQLPkGenerator.java:161)
> > 	at  
> > org.objectstyle.cayenne.dba.mysql.MySQLPkGenerator.pkFromDatabase 
> > (MySQLPkGenerator.java:93)
> > 	at  
> > org.objectstyle.cayenne.dba.JdbcPkGenerator.generatePkForDbEntity 
> > (JdbcPkGenerator.java:325)
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: commit error with cayenne 1.1.4 ,tomcat 5 and mysql 5

Posted by Andrus Adamchik <an...@objectstyle.org>.
Cool, now I see what it is - a special table used to store generated  
PK has not been created. In the Modeler go to "Tools -> generate  
Database Schema" and uncheck all checkboxes except for "Create  
Primary Key Support" and then click "generate":

http://objectstyle.org/confluence/display/CAYDOC/Generate+Primary+Key 
+Support

Andrus


On Apr 4, 2006, at 7:52 PM, Alan Baltazar wrote:

> Caused by: java.sql.SQLException: Table 'art.auto_pk_support'  
> doesn't exist
> 	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
> 	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
> 	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
> 	at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)
> 	at com.mysql.jdbc.Connection.execSQL(Connection.java:2917)
> 	at com.mysql.jdbc.Statement.execute(Statement.java:529)
> 	at org.objectstyle.cayenne.dba.mysql.MySQLPkGenerator.getPrimaryKey 
> (MySQLPkGenerator.java:161)
> 	at  
> org.objectstyle.cayenne.dba.mysql.MySQLPkGenerator.pkFromDatabase 
> (MySQLPkGenerator.java:93)
> 	at  
> org.objectstyle.cayenne.dba.JdbcPkGenerator.generatePkForDbEntity 
> (JdbcPkGenerator.java:325)


Re: commit error with cayenne 1.1.4 ,tomcat 5 and mysql 5

Posted by Alan Baltazar <ac...@yahoo.com>.
Hello Andrus,
  

--- Andrus Adamchik <an...@objectstyle.org> wrote:

> Hi Alan,
> 


  Yes, I can access my DB from Cayenne Modeler (as mentioned below).

> Can you access your DB from Cayenne Modeler? For instance you can go  
> to "Tools -> Reengineer Database Schema" and see if that works. Use  
> the same URL and userid/password you are using to connect from the  
> application tutorial.
> 

  Attached is the tomcat log stack trace (also the sql script slightly modified from the
  tutorial). I'm running this tutorial on winXP and mysql,tomcat with default install
(except for app install dir location). thanks for any help.

> Also - can you find the full stack trace in the tomcat logs? The one  
> you posted does not show the real cause of the error.
> 
> Andrus
> 
> 
> On Apr 3, 2006, at 10:58 PM, Alan Baltazar wrote:
> > hello,
> >
> >   I'm running the 'cayenne-1.1.4\src\tutorials\cayenne-web-app'  
> > sample. everything works
> > well until I run the 'add artist,painting,gallery' pages. the  
> > problem is this, when I
> > enter to save new data (for an insert), i get this exception:
> > HTTP Status 500 -
> >
> > ---------------------------------------------------------------------- 
> > ----------
> >
> > type Exception report
> >
> > message
> >
> > description The server encountered an internal error () that  
> > prevented it from fulfilling
> > this request.
> >
> > exception
> >
> > javax.servlet.ServletException: [v.1.1.4 January 5 2006] Commit  
> > Exception
> > 	org.apache.struts.action.RequestProcessor.processException 
> > (RequestProcessor.java:535)
> >
> > org.apache.struts.action.RequestProcessor.processActionPerform 
> > (RequestProcessor.java:433)
> > 	org.apache.struts.action.RequestProcessor.process 
> > (RequestProcessor.java:236)
> > 	org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
> > 1196)
> > 	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >
> >
> > root cause
> >
> > org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1.4 January 5  
> > 2006] Commit
> > Exception
> > 	org.objectstyle.cayenne.access.DataContext.commitChanges 
> > (DataContext.java:1275)
> > 	org.objectstyle.cayenne.access.DataContext.commitChanges 
> > (DataContext.java:1236)
> > 	action.SaveGalleryAction.execute(SaveGalleryAction.java:34)
> >
> > org.apache.struts.action.RequestProcessor.processActionPerform 
> > (RequestProcessor.java:431)
> > 	org.apache.struts.action.RequestProcessor.process 
> > (RequestProcessor.java:236)
> > 	org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
> > 1196)
> > 	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >
> >
> > note The full stack trace of the root cause is available in the  
> > Apache Tomcat/5.0.28
> > logs.
> >
> >
> > ---------------------------------------------------------------------- 
> > ----------
> >
> > Apache Tomcat/5.0.28
> >
> > ps: i can entered all complete rights for the user in mysql and was  
> > able to physically
> > insert directly to the mysql database. i'm only having problems  
> > inserting from thia app.
> >
> > thanks,
> > alan
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: commit error with cayenne 1.1.4 ,tomcat 5 and mysql 5

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Alan,

Can you access your DB from Cayenne Modeler? For instance you can go  
to "Tools -> Reengineer Database Schema" and see if that works. Use  
the same URL and userid/password you are using to connect from the  
application tutorial.

Also - can you find the full stack trace in the tomcat logs? The one  
you posted does not show the real cause of the error.

Andrus


On Apr 3, 2006, at 10:58 PM, Alan Baltazar wrote:
> hello,
>
>   I'm running the 'cayenne-1.1.4\src\tutorials\cayenne-web-app'  
> sample. everything works
> well until I run the 'add artist,painting,gallery' pages. the  
> problem is this, when I
> enter to save new data (for an insert), i get this exception:
> HTTP Status 500 -
>
> ---------------------------------------------------------------------- 
> ----------
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that  
> prevented it from fulfilling
> this request.
>
> exception
>
> javax.servlet.ServletException: [v.1.1.4 January 5 2006] Commit  
> Exception
> 	org.apache.struts.action.RequestProcessor.processException 
> (RequestProcessor.java:535)
>
> org.apache.struts.action.RequestProcessor.processActionPerform 
> (RequestProcessor.java:433)
> 	org.apache.struts.action.RequestProcessor.process 
> (RequestProcessor.java:236)
> 	org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
> 1196)
> 	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>
> root cause
>
> org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1.4 January 5  
> 2006] Commit
> Exception
> 	org.objectstyle.cayenne.access.DataContext.commitChanges 
> (DataContext.java:1275)
> 	org.objectstyle.cayenne.access.DataContext.commitChanges 
> (DataContext.java:1236)
> 	action.SaveGalleryAction.execute(SaveGalleryAction.java:34)
>
> org.apache.struts.action.RequestProcessor.processActionPerform 
> (RequestProcessor.java:431)
> 	org.apache.struts.action.RequestProcessor.process 
> (RequestProcessor.java:236)
> 	org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
> 1196)
> 	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>
> note The full stack trace of the root cause is available in the  
> Apache Tomcat/5.0.28
> logs.
>
>
> ---------------------------------------------------------------------- 
> ----------
>
> Apache Tomcat/5.0.28
>
> ps: i can entered all complete rights for the user in mysql and was  
> able to physically
> insert directly to the mysql database. i'm only having problems  
> inserting from thia app.
>
> thanks,
> alan