On 4 Nov 2012, at 03:42, Leon Wu wrote:

> OK, I made it up and running with ant build. But, I have questions and
> errors.
> Question: after Ant deploy-webapp, the property in widgetserver.properties,
> widget.persistence.manager.dbtype, is empty. How can I make it to mysql?

Not sure - It should just copy it over from your working directory without 
changing it.

> Error: the error message is ERROR Batch:75 - A request has been denied as a
> potential CSRF attack. and there is a popup in the browser says: seesion
> error.

See "Why do I get a dialog box saying "session error" when I try to view my 
widget?" in http://incubator.apache.org/wookie/docs/faq.html


> 
> Thank you.
> 
> On Sat, Nov 3, 2012 at 10:27 PM, Leon Wu <[email protected]> wrote:
> 
>> After working around the issue, I found I cannot fix it. It might
>> be caused by OpenJPA Eclipse plugin enhancer. I am going to use Ant for
>> build and deploy.
>> 
>> Scott, is there any guide for using Ant? The first thing I am thinking was
>> how to tell Ant the location of the Tomcat?
>> 
>> Thank you.
>> 
>> 
>> On Sat, Nov 3, 2012 at 7:47 PM, Leon Wu <[email protected]> wrote:
>> 
>>> Thank you for the quick response, Scott.
>>> 
>>> After googling, OpenJPA has a eclipse plugin and it does the enhancement
>>> for me (http://openjpa.apache.org/openjpaeclipseinstallation.html).
>>> Following the steps from that link, the problem is fixed.
>>> Now, I am face another problem.
>>> 
>>> 03.11.2012 19:45:34 ERROR
>>> [org.apache.wookie.beans.jpa.JPAPersistenceManager.findWidgetByGuid():638]
>>> Unexpected exception: <openjpa-2.0.0-r422266:935683 nonfatal user error>
>>> org.apache.openjpa.persistence.ArgumentException: An error occurred
>>> while parsing the query filter "SELECT w FROM Widget w WHERE w.guid =
>>> :guid". Error message: The name "Widget" is not a recognized entity or
>>> identifier. Perhaps you meant WidgetImpl, which is a close match. Known
>>> entity names: [LicenseImpl, OAuthTokenImpl, SharedDataImpl, NameImpl,
>>> PreferenceDefaultImpl, LocalizedBeanImpl, DescriptionImpl, AuthorImpl,
>>> WidgetIconImpl, WidgetImpl, ParticipantImpl, PreferenceImpl,
>>> WidgetInstanceImpl, FeatureImpl, StartFileImpl, ParamImpl]
>>> 
>>> <openjpa-2.0.0-r422266:935683 nonfatal user error>
>>> org.apache.openjpa.persistence.ArgumentException: An error occurred
>>> while parsing the query filter "SELECT w FROM Widget w WHERE w.guid =
>>> :guid". Error message: The name "Widget" is not a recognized entity or
>>> identifier. Perhaps you meant WidgetImpl, which is a close match. Known
>>> entity names: [LicenseImpl, OAuthTokenImpl, SharedDataImpl, NameImpl,
>>> PreferenceDefaultImpl, LocalizedBeanImpl, DescriptionImpl, AuthorImpl,
>>> WidgetIconImpl, WidgetImpl, ParticipantImpl, PreferenceImpl,
>>> WidgetInstanceImpl, FeatureImpl, StartFileImpl, ParamImpl]
>>> 
>>> at
>>> org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(
>>> AbstractExpressionBuilder.java:119)
>>> 
>>> at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(
>>> JPQLExpressionBuilder.java:194)
>>> 
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(
>>> JPQLExpressionBuilder.java:167)
>>> 
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(
>>> JPQLExpressionBuilder.java:242)
>>> 
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(
>>> JPQLExpressionBuilder.java:212)
>>> 
>>> at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(
>>> JPQLExpressionBuilder.java:205)
>>> 
>>> at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$200(
>>> JPQLExpressionBuilder.java:81)
>>> 
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(
>>> JPQLExpressionBuilder.java:2387)
>>> 
>>> at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:61)
>>> 
>>> at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(
>>> ExpressionStoreQuery.java:154)
>>> 
>>> at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:671)
>>> 
>>> at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(
>>> QueryImpl.java:652)
>>> 
>>> at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(
>>> QueryImpl.java:618)
>>> 
>>> at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(
>>> QueryImpl.java:680)
>>> 
>>> at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:587)
>>> 
>>> at org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery(
>>> EntityManagerImpl.java:1027)
>>> 
>>> at org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery(
>>> EntityManagerImpl.java:100)
>>> 
>>> at org.apache.wookie.beans.jpa.JPAPersistenceManager.findWidgetByGuid(
>>> JPAPersistenceManager.java:629)
>>> 
>>> at org.apache.wookie.beans.util.PersistenceManagerFactory.initialize(
>>> PersistenceManagerFactory.java:85)
>>> 
>>> at org.apache.wookie.server.ContextListener.contextInitialized(
>>> ContextListener.java:110)
>>> 
>>> at org.apache.catalina.core.StandardContext.listenerStart(
>>> StandardContext.java:4791)
>>> 
>>> at org.apache.catalina.core.StandardContext.startInternal(
>>> StandardContext.java:5285)
>>> 
>>> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>>> 
>>> at org.apache.catalina.core.ContainerBase.addChildInternal(
>>> ContainerBase.java:901)
>>> 
>>> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877
>>> )
>>> 
>>> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
>>> 
>>> at org.apache.catalina.startup.HostConfig.deployDescriptor(
>>> HostConfig.java:650)
>>> 
>>> at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(
>>> HostConfig.java:1582)
>>> 
>>> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439
>>> )
>>> 
>>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>>> 
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>> 
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>>> ThreadPoolExecutor.java:886)
>>> 
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>>> ThreadPoolExecutor.java:908)
>>> 
>>> at java.lang.Thread.run(Thread.java:680)
>>> 
>>> Nov 3, 2012 7:45:34 PM org.apache.catalina.core.StandardContext
>>> listenerStart
>>> 
>>> SEVERE: Exception sending context initialized event to listener instance
>>> of class org.apache.wookie.server.ContextListener
>>> 
>>> <openjpa-2.0.0-r422266:935683 fatal user error>
>>> org.apache.openjpa.persistence.InvalidStateException: The field "guid"
>>> of instance "org.apache.wookie.beans.jpa.impl.WidgetImpl@3f4a0fe1"
>>> contained a null value; the metadata for this field specifies that nulls
>>> are illegal.
>>> 
>>> at org.apache.openjpa.kernel.SingleFieldManager.preFlush(
>>> SingleFieldManager.java:553)
>>> 
>>> at org.apache.openjpa.kernel.SingleFieldManager.preFlush(
>>> SingleFieldManager.java:491)
>>> 
>>> at org.apache.openjpa.kernel.StateManagerImpl.preFlush(
>>> StateManagerImpl.java:2957)
>>> 
>>> at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:40)
>>> 
>>> at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(
>>> StateManagerImpl.java:1047)
>>> 
>>> at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2077)
>>> 
>>> at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2037)
>>> 
>>> at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(
>>> BrokerImpl.java:1955)
>>> 
>>> at org.apache.openjpa.kernel.LocalManagedRuntime.commit(
>>> LocalManagedRuntime.java:81)
>>> 
>>> at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1479)
>>> 
>>> at org.apache.openjpa.kernel.DelegatingBroker.commit(
>>> DelegatingBroker.java:925)
>>> 
>>> at org.apache.openjpa.persistence.EntityManagerImpl.commit(
>>> EntityManagerImpl.java:559)
>>> 
>>> at org.apache.wookie.beans.jpa.JPAPersistenceManager.commit(
>>> JPAPersistenceManager.java:340)
>>> 
>>> at org.apache.wookie.beans.util.PersistenceManagerFactory.initialize(
>>> PersistenceManagerFactory.java:138)
>>> 
>>> at org.apache.wookie.server.ContextListener.contextInitialized(
>>> ContextListener.java:110)
>>> 
>>> at org.apache.catalina.core.StandardContext.listenerStart(
>>> StandardContext.java:4791)
>>> 
>>> at org.apache.catalina.core.StandardContext.startInternal(
>>> StandardContext.java:5285)
>>> 
>>> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>>> 
>>> at org.apache.catalina.core.ContainerBase.addChildInternal(
>>> ContainerBase.java:901)
>>> 
>>> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877
>>> )
>>> 
>>> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
>>> 
>>> at org.apache.catalina.startup.HostConfig.deployDescriptor(
>>> HostConfig.java:650)
>>> 
>>> at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(
>>> HostConfig.java:1582)
>>> 
>>> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439
>>> )
>>> 
>>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>>> 
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>> 
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>>> ThreadPoolExecutor.java:886)
>>> 
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>>> ThreadPoolExecutor.java:908)
>>> 
>>> at java.lang.Thread.run(Thread.java:680)
>>> 
>>> Nov 3, 2012 7:45:34 PM org.apache.catalina.core.StandardContext
>>> startInternal
>>> 
>>> SEVERE: Error listenerStart
>>> 
>>> 
>>> On Sat, Nov 3, 2012 at 7:23 PM, Scott Wilson <
>>> [email protected]> wrote:
>>> 
>>>> On 3 Nov 2012, at 22:18, Leon Wu wrote:
>>>> 
>>>>> This is the first time of dealing with javaagent and just do the
>>>> exception
>>>>> asks.
>>>>> I am just doing the classical way to run the wookie in Eclipse -
>>>> importing
>>>>> wookie, adding it to the Tomcat server and starting the Tomcat.
>>>>> Should I use ant build to get the wookie.war and put the war in Tomcat?
>>>> 
>>>> That would probably be easier - I've never tried running it directly out
>>>> of Eclipse using the Tomcat before - I presume this is the Eclipse web
>>>> toolkit?
>>>> 
>>>> There is an ant task specifically for building and deploying Wookie
>>>> using Tomcat (or similar):
>>>> 
>>>> ant deploy-webapp
>>>> 
>>>> ... which will deploy it to wherever servletEngine.webapp.dir  in
>>>> build.properties is set to.
>>>> 
>>>>> 
>>>>> 
>>>>> On Sat, Nov 3, 2012 at 2:26 PM, Scott Wilson <
>>>> [email protected]
>>>>>> wrote:
>>>>> 
>>>>>> 
>>>>>> On 3 Nov 2012, at 15:32, Leon Wu wrote:
>>>>>> 
>>>>>>> Thank you, Scott. It was missmatch issue.
>>>>>>> But, I got another problem. I added javaagent but still got this
>>>> error.
>>>>>> 
>>>>>> I don't really know anything about Javaagent; the bean enhancement is
>>>> done
>>>>>> automatically by OpenJPA during the Ant build and compile process.
>>>>>> 
>>>>>>> <openjpa-2.0.0-r422266:935683 nonfatal user error>
>>>>>>> org.apache.openjpa.util.UserException: This configuration disallows
>>>>>> runtime
>>>>>>> optimization, but the following listed types were not enhanced at
>>>> build
>>>>>>> time or at class load time with a javaagent: "
>>>>>>> org.apache.wookie.beans.jpa.impl.ParamImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.FeatureImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.WidgetIconImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.PreferenceDefaultImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.OAuthTokenImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.LocalizedBeanImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.WidgetInstanceImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.WidgetImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.ParticipantImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.DescriptionImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.PreferenceImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.SharedDataImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.AuthorImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.LicenseImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.NameImpl
>>>>>>> org.apache.wookie.beans.jpa.impl.StartFileImpl".
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Fri, Nov 2, 2012 at 5:33 AM, Scott Wilson <
>>>>>> [email protected]
>>>>>>>> wrote:
>>>>>>> 
>>>>>>>> On 2 Nov 2012, at 00:45, Leon Wu wrote:
>>>>>>>> 
>>>>>>>>> Hi Scott,
>>>>>>>>> 
>>>>>>>>> You are exactly right. By step by step debugging, I found that my
>>>>>>>>> context.xml is configured with derby db stuff and it found the
>>>>>> datasource
>>>>>>>>> after I changed it to mysql parameters.
>>>>>>>>> However, it hits another problem. The Tomcat is hang on over there
>>>> for
>>>>>> a
>>>>>>>>> while and throws almost the same exceptions.
>>>>>>>>> By tracing down to the problem, it happens in JPAPersistenceManager
>>>>>> (line
>>>>>>>>> 293) when it tries to create the entity manager.
>>>>>>>>>     entityManager = entityManagerFactory.createEntityManager();
>>>>>>>>> 
>>>>>>>>> and the actual exception is thrown by DataSourceFactory of openjpa
>>>>>>>> package
>>>>>>>>> (line 239)
>>>>>>>>>     if (!factory2)
>>>>>>>>>          conn = ds.getConnection(conf.getConnectionUserName(),
>>>> conf
>>>>>>>>>                     .getConnectionPassword());
>>>>>>>>>     else
>>>>>>>>> 
>>>>>>>>> conf.getConnectionUserName and getConnectionPassword return null.
>>>> I may
>>>>>>>> not
>>>>>>>>> know if it is correct or not.
>>>>>>>> 
>>>>>>>> The main thing to check is that your database name, database user
>>>> name
>>>>>> and
>>>>>>>> database password set in your conf/wookie.xml match your actual
>>>> MySQL
>>>>>> set
>>>>>>>> up.
>>>>>>>> 
>>>>>>>>> But after a step further, it hangs on there
>>>>>>>>> and runtime exception stack is below. It might be the issue with
>>>>>> openjpa
>>>>>>>>> config but I don't know how to do that.
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> Actually this looks more like a driver problem. Do you have more
>>>> than
>>>>>> one
>>>>>>>> MySQL connector jar on your classpath?
>>>>>>>> 
>>>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>>> 
>> 

Reply via email to