You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Humberto Hernandez Torres <hh...@itweb.com.mx> on 2002/07/05 17:44:14 UTC

RE: A solution: tdk2.2, pgsql, newapp: error when trying to updat e the rdf table

A few days ago we comented about this problem. I think the solution would be
to change ValueParser and/or BaseValueParser to handle both NumberKey
versions.
--
  Humberto
  

-----Original Message-----
From: Akmal Sarhan [mailto:akmal_sarhan@hotmail.com]
Sent: Friday, July 05, 2002 6:08 AM
To: turbine-user@jakarta.apache.org
Subject: Re: A solution: tdk2.2, pgsql, newapp: error when trying to
update the rdf table



My solution of the problem was only to use intake, I am really happy with 
it,the decoupled version of course ;-)

regards
Akmal

>From: Wolfgang Schur <ws...@ibvag.com>
>Reply-To: "Turbine Users List" <tu...@jakarta.apache.org>
>To: Turbine Users List <tu...@jakarta.apache.org>
>Subject: A solution: tdk2.2, pgsql, newapp: error when trying to update the

>rdf table
>Date: Fri, 05 Jul 2002 09:43:59 +0200
>
>Yes, that seems to be the problem.
>Changing doUpdate() to the following avoids the setProperties method and
>circumvents the NumberKey issue.
>
>
>public void doUpdate(RunData data, Context context)
>    throws Exception
>    {
>         Rdf entry = new Rdf();
>         entry.setRdfId(new NumberKey
>(data.getParameters().getString("rdfid")));
>         entry.setTitle(data.getParameters().getString ("title"));
>         entry.setUrl(data.getParameters().getString ("url"));
>         entry.setAuthor(data.getParameters().getString ("author"));
>         entry.setDept(data.getParameters().getString ("dept"));
>         entry.setBody(data.getParameters().getString ("body"));
>         //data.getParameters().setProperties(entry);
>         entry.setModified(true);
>         entry.setNew(false);
>         entry.save();
>     }
>
>To fix the problem alltogether, I think the imports in
>BaseValueParser.java (in the turbine package) need to be changed from
>org.apache.turbine.om.NumberKey to org.apache.torque.om.NumberKey.
>
>Cheers Wolfgang
>
>Akmal Sarhan wrote:
>>
>>if I am not mistaken, the only problem here is
>>org.apache.torque.om.NumberKey , which is a problem of the actual
>>version of turbine that is using both the decoupled and the coupled
>>version of torque.
>>
>>so you are trying to insert the NumberKey of the decoupled and turbine
>>is expecting its own :(
>>
>>regards
>>Akmal
>>
>>>From: daniel robinson <dr...@dnai.com>
>>>Reply-To: dan@drob.org
>>>To: Turbine Users List <tu...@jakarta.apache.org>
>>>Subject: Re: tdk2.2, pgsql, newapp: error when trying to update the
>>>rdf table
>>>Date: Thu, 04 Jul 2002 10:55:36 -0700
>>>
>>>Wolfgang,
>>>
>>>Hi.  I believe that this is a well known error with the definition of
>>>the fields types for PostgreSQL.  You can check the how-to-PostgreSQL,
>>>however the instructions there call for patching the CVS version.  I was
>>>able to find the correct values in the mail archives and cut and paste
>>>into the PostgreSQL config. file.  I don't have time right now to get
>>>this together :(, but I will later today when I have a moment and post
>>>it.
>>>
>>>Dan
>>>
>>>
>>>
>>>Wolfgang Schur wrote:
>>>
>>>>Hi,
>>>>has anyone else experienced an exception when trying to update the rdf
>>>>table in the example app? Adding/updating users works fine, also
>>>>adding rdf records works. Only rdf Update gives this error. Seems that
>>>>this is a known error (see the hint in FluxUserForm.vm, line 80).
>>>>Passing a record id via hidden form elements seems not to work.
>>>>Is any solution for this known?
>>>>Best regards
>>>>Wolfgang
>>>>
>>>>-------------------------------------------------------
>>>>Here the stack trace:
>>>>
>>>>Horrible Exception: java.lang.reflect.InvocationTargetException
>>>>     at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
>>>>     at
>>>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
>>>>
>>>>
>>>>     at java.lang.reflect.Method.invoke(Method.java:324)
>>>>     at
>>>>org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(Veloc
ityActionEvent.java:166)
>>>>
>>>>
>>>>     at
>>>>org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityAct
ionEvent.java:114)
>>>>
>>>>
>>>>     at
>>>>org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction
.java:114)
>>>>
>>>>
>>>>     at
>>>>org.apache.turbine.modules.actions.VelocitySecureAction.perform(Velocity
SecureAction.java:100)
>>>>
>>>>
>>>>     at
>>>>org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
>>>>     at
>>>>org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:14
3)
>>>>
>>>>
>>>>     at org.apache.turbine.modules.Page.build(Page.java:90)
>>>>     at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:123)
>>>>     at org.apache.turbine.Turbine.doGet(Turbine.java:577)
>>>>     at org.apache.turbine.Turbine.doPost(Turbine.java:667)
>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>>>     at
>>>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:243)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>>>>     at
>>>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:190)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:475)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>>>>     at
>>>>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
7)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:170)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468
)
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>>>>     at
>>>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>>>>     at
>>>>org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
ava:1017)
>>>>
>>>>
>>>>     at
>>>>org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
1115)
>>>>
>>>>
>>>>     at java.lang.Thread.run(Thread.java:536)
>>>>Caused by: java.lang.Exception: property rdfId is of unsupported type
>>>>class org.apache.torque.om.NumberKey
>>>>     at
>>>>org.apache.turbine.util.parser.BaseValueParser.setProperty(BaseValuePars
er.java:1371)
>>>>
>>>>
>>>>     at
>>>>org.apache.turbine.util.parser.BaseValueParser.setProperties(BaseValuePa
rser.java:1225)
>>>>
>>>>
>>>>     at org.mycompany.newapp.modules.actions.SQL.doUpdate(SQL.java:102)
>>>>     ... 47 more
>>>>
>>>>
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>><ma...@jakarta.apache.org>
>>>For additional commands, e-mail:
>>><ma...@jakarta.apache.org>
>>>
>>
>>
>>
>>
>>_________________________________________________________________
>>Send and receive Hotmail on your mobile device: http://mobile.msn.com
>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>>
>
>
>
>--
>****************************************************
>IBV Internet Business Ventures AG
>Wolfgang Schur              Tel: ++49-69-857007-20
>Pirazzistrasse 12 A         Fax: ++49-69-857007-22
>D-63067 Offenbach           Email: wschur@ibvag.com
>Germany
>****************************************************
>
>
>--
>To unsubscribe, e-mail:   
><ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>
>




_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: tdk2.2, decoupled torque, mysql problem

Posted by Michael Young <pr...@yahoo.com>.
i've found a workaround, but i don't think that's
right. before i call item.doInsert(), i call
item.setNew(false). This works, but my item really is
new. Can someone shed some light?


--- "shh... ." <pr...@yahoo.com> wrote:
> I'm trying to insert a row, but for some reason
> torque
> is not inserting a value for the primary key. The
> schema and source code are below. It seems that
> ItemPeer builds a Criteria internally, but
> item_number
> is not added to criteria because item.isNew() ==
> true;
> Is this expected behavior?
> 
> <database name="shopper">
>   <table name="item" idMethod="native">
>     <column name="item_number" 
> 		size="255"
> 		required="true" 
> 		primaryKey="true"
> 		type="VARCHAR"/>
>     ...
>     ...
>    </table>
> </database>
> 
> Item item = new Item();
> item.setItemNumber("12345");
> ItemPeer.doInsert(item);
> 
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


tdk2.2, decoupled torque, mysql problem

Posted by "shh... ." <pr...@yahoo.com>.
I'm trying to insert a row, but for some reason torque
is not inserting a value for the primary key. The
schema and source code are below. It seems that
ItemPeer builds a Criteria internally, but item_number
is not added to criteria because item.isNew() == true;
Is this expected behavior?

<database name="shopper">
  <table name="item" idMethod="native">
    <column name="item_number" 
		size="255"
		required="true" 
		primaryKey="true"
		type="VARCHAR"/>
    ...
    ...
   </table>
</database>

Item item = new Item();
item.setItemNumber("12345");
ItemPeer.doInsert(item);





__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>