You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Jeremyau <ja...@gmail.com> on 2012/06/05 18:56:24 UTC

Deploying Pet-catalog

Hi,

I'm trying to deploy the JEE6
https://github.com/tikalk/jee6-pet-catalog-sample pet-catalog example  on
TomEE plus. 
So I create the war file with maven and I deploy it on webapps. Everything
is ok, it works well.

But, when I change the name of the war file to "ROOT" and deploy it to TomEE
plus server, I've got an weird error:

SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path
[] threw exception [javax.el.ELException: Error reading 'pagingInfo' on type
controller.Catalog] with root cause
java.lang.NullPointerException
	at controller.Catalog.getItemCount(Catalog.java:77)
	at controller.Catalog.getPagingInfo(Catalog.java:37)
	at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
...

I looked for the reason of this error but nothing found... I guess there is
something to change in the web.xml file but I can't figure out what.

Any help is welcome!

Thanks


--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
You're more than welcome!

Thanks for your help (especially Romain) and your great work! 

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655858.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Hey,

that's looks great.
Thanks for sharing.

May be we can add and entry on our examples page.
Any thoughts?

JLouis

2012/6/26 Jeremyau <ja...@gmail.com>

> Hi,
>
> Here is the source updated of the pet-catalog application for Tomee if some
> people are interested:
> https://github.com/Stackato-Apps/pet-catalog/tree/stackato
>
> Jeremy
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655815.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Hi,

Here is the source updated of the pet-catalog application for Tomee if some
people are interested:
https://github.com/Stackato-Apps/pet-catalog/tree/stackato

Jeremy

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655815.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Ok it works well! I did some small changes. (Annotation, JTA...)

Thanks Romain!

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655597.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i'll try again but i did almost the same thing this afternoon

- Romain


2012/6/8 Jeremyau <ja...@gmail.com>

> Ok so after several tests, it actually seems the problem comes from my
> managedBean.
>
> I've got a managedBean named catalog:
> @ManagedBean
> @SessionScoped
> public class Catalog
>
> And I call it in my view:
> ...action="#{catalog.prev}"...
>
> But it's null. I've added a trace in my Catalog.java:
>    public String prev() {
>        System.out.println("Call of prev function");
>        reset(false);
>        getPagingInfo().previousPage();
>        return "list";
>    }
>
> But nothing appears in the catalina.out.
>
> Also, you told me that there is a bug fixed on the trunk. I've tried, same
> issue.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655527.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

RE: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Ok so after several tests, it actually seems the problem comes from my
managedBean. 

I've got a managedBean named catalog:
@ManagedBean
@SessionScoped
public class Catalog

And I call it in my view:
...action="#{catalog.prev}"...

But it's null. I've added a trace in my Catalog.java:
    public String prev() {
    	System.out.println("Call of prev function");
        reset(false);
        getPagingInfo().previousPage();
        return "list";
    }

But nothing appears in the catalina.out.

Also, you told me that there is a bug fixed on the trunk. I've tried, same
issue.

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655527.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

RE: Deploying Pet-catalog

Posted by Robin <ro...@gmail.com>.
How may I be removed from this mailing list

-----Original Message-----
From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com] 
Sent: Thursday, June 07, 2012 7:20 PM
To: users@openejb.apache.org
Subject: Re: Deploying Pet-catalog

what did mean "empty database"?

no tables? -> look <property name="openjpa.jdbc.SynchronizeMappings" value=
"buildSchema(ForeignKeys=true)"/> (or other values)

- Romain


2012/6/8 Jeremyau <ja...@gmail.com>

> Here, it is:
>
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.ConfigurationFactory
> configureApplication
> INFO: Configuring enterprise application:
> /home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig deploy
> INFO: Configuring PersistenceUnit(name=catalogPU) Jun 07, 2012 3:56:55 
> PM org.apache.openejb.config.AutoConfig
> logAutoCreateResource
> INFO: Auto-creating a Resource with id 'jdbc/petcatalogNonJta' of type 
> 'DataSource for 'catalogPU'.
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig deploy
> INFO: Configuring Service(id=jdbc/petcatalogNonJta, type=Resource,
> provider-id=jdbc/petcatalog)
> Jun 07, 2012 3:56:55 PM org.apache.openejb.assembler.classic.Assembler
> createRecipe
> INFO: Creating Resource(id=jdbc/petcatalogNonJta)
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig
> setNonJtaDataSource
> INFO: Adjusting PersistenceUnit catalogPU <non-jta-data-source> to 
> Resource ID 'jdbc/petcatalogNonJta' from 'null'
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AppInfoBuilder build
> INFO: Enterprise application
> "/home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT"
> loaded.
> Jun 07, 2012 3:56:55 PM org.apache.openejb.assembler.classic.Assembler
> createApplication
> INFO: Assembling app:
> /home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT
> Jun 07, 2012 3:56:55 PM org.apache.bval.jsr303.ConfigurationImpl
> parseValidationXml
> INFO: ignoreXmlConfiguration == true
>
> Let me know if it's not enough.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p46
> 55494.html Sent from the OpenEJB User mailing list archive at 
> Nabble.com.
>


Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
what did mean "empty database"?

no tables? -> look <property name="openjpa.jdbc.SynchronizeMappings" value=
"buildSchema(ForeignKeys=true)"/> (or other values)

- Romain


2012/6/8 Jeremyau <ja...@gmail.com>

> Here, it is:
>
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.ConfigurationFactory
> configureApplication
> INFO: Configuring enterprise application:
> /home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig deploy
> INFO: Configuring PersistenceUnit(name=catalogPU)
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig
> logAutoCreateResource
> INFO: Auto-creating a Resource with id 'jdbc/petcatalogNonJta' of type
> 'DataSource for 'catalogPU'.
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig deploy
> INFO: Configuring Service(id=jdbc/petcatalogNonJta, type=Resource,
> provider-id=jdbc/petcatalog)
> Jun 07, 2012 3:56:55 PM org.apache.openejb.assembler.classic.Assembler
> createRecipe
> INFO: Creating Resource(id=jdbc/petcatalogNonJta)
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig
> setNonJtaDataSource
> INFO: Adjusting PersistenceUnit catalogPU <non-jta-data-source> to Resource
> ID 'jdbc/petcatalogNonJta' from 'null'
> Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AppInfoBuilder build
> INFO: Enterprise application
> "/home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT"
> loaded.
> Jun 07, 2012 3:56:55 PM org.apache.openejb.assembler.classic.Assembler
> createApplication
> INFO: Assembling app:
> /home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT
> Jun 07, 2012 3:56:55 PM org.apache.bval.jsr303.ConfigurationImpl
> parseValidationXml
> INFO: ignoreXmlConfiguration == true
>
> Let me know if it's not enough.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655494.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Here, it is:

Jun 07, 2012 3:56:55 PM org.apache.openejb.config.ConfigurationFactory
configureApplication
INFO: Configuring enterprise application:
/home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT
Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig deploy
INFO: Configuring PersistenceUnit(name=catalogPU)
Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig
logAutoCreateResource
INFO: Auto-creating a Resource with id 'jdbc/petcatalogNonJta' of type
'DataSource for 'catalogPU'.
Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig deploy
INFO: Configuring Service(id=jdbc/petcatalogNonJta, type=Resource,
provider-id=jdbc/petcatalog)
Jun 07, 2012 3:56:55 PM org.apache.openejb.assembler.classic.Assembler
createRecipe
INFO: Creating Resource(id=jdbc/petcatalogNonJta)
Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AutoConfig
setNonJtaDataSource
INFO: Adjusting PersistenceUnit catalogPU <non-jta-data-source> to Resource
ID 'jdbc/petcatalogNonJta' from 'null'
Jun 07, 2012 3:56:55 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application
"/home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT"
loaded.
Jun 07, 2012 3:56:55 PM org.apache.openejb.assembler.classic.Assembler
createApplication
INFO: Assembling app:
/home/jeremya/Documents/Tomcat/apache-tomee-plus-1.0.0/webapps/ROOT
Jun 07, 2012 3:56:55 PM org.apache.bval.jsr303.ConfigurationImpl
parseValidationXml
INFO: ignoreXmlConfiguration == true

Let me know if it's not enough.

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655494.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi. META-INF/resources.xml can be enough to define a datasource.

Can tou share your logs?
Le 7 juin 2012 23:01, "Jeremyau" <ja...@gmail.com> a écrit :

> Ok, I'm still trying to make it work. Now I'm working on the persistence
> side.
>
> So I've defined a resource in tomee.xml. I've added the
> mysql-connectors.jar
> in the tomee lib directory.
> ...
> <Resource id="jdbc/petcatalog" type="DataSource">
>  JdbcDriver com.mysql.jdbc.Driver
>  JdbcUrl jdbc:mysql://localhost:3306/test?autoReconnect=true
>  UserName root
>  Password root
>  JtaManaged true
> </Resource>
> ...
> *First question*: Is it possible to define the tomee.xml in my project?
> Therefore, I could add mysql-connectors dependency to my project instead of
> adding it in the tomee server.
>
> Then, I've also defined the persistence.xml
> ...
>  <persistence-unit name="catalogPU" transaction-type="JTA">
>    <jta-data-source>jdbc/petcatalog</jta-data-source>
>    <class>model.Item</class>
>    <properties/>
>  </persistence-unit>
> ...
> And finally, my entity manager:
> ...
>    @PersistenceContext(unitName = "catalogPU")
>    private EntityManager em;
> ...
> Unfortunately, nothing happens... It seems my application does not access
> to
> the database for some reason.  The application is started but it is just
> empty.
>
> Where am I wrong?
>
> Thanks.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655492.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Ok, I'm still trying to make it work. Now I'm working on the persistence
side.

So I've defined a resource in tomee.xml. I've added the mysql-connectors.jar
in the tomee lib directory.
...
<Resource id="jdbc/petcatalog" type="DataSource">
  JdbcDriver com.mysql.jdbc.Driver
  JdbcUrl jdbc:mysql://localhost:3306/test?autoReconnect=true 
  UserName root
  Password root
  JtaManaged true
</Resource>
...
*First question*: Is it possible to define the tomee.xml in my project?
Therefore, I could add mysql-connectors dependency to my project instead of
adding it in the tomee server.

Then, I've also defined the persistence.xml
...
  <persistence-unit name="catalogPU" transaction-type="JTA">
    <jta-data-source>jdbc/petcatalog</jta-data-source>
    <class>model.Item</class>
    <properties/>
  </persistence-unit>
...
And finally, my entity manager:
...
    @PersistenceContext(unitName = "catalogPU")
    private EntityManager em;
...
Unfortunately, nothing happens... It seems my application does not access to
the database for some reason.  The application is started but it is just
empty.

Where am I wrong?

Thanks.

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655492.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
To say "i put everythink in xml DD, dont scan my app"
Le 7 juin 2012 04:33, "José Luis Cetina" <ma...@gmail.com> a écrit :

> The attribute metadata-complete="true" is for what?
> El 06/06/2012 18:31, "Jeremyau" <ja...@gmail.com> escribió:
>
> > It works !!!!!!!!! You were right. I missed metadata-complete="true" in
> > web.xml.
> >
> > Thanks so much Romain. That's awesome!
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655468.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: Deploying Pet-catalog

Posted by José Luis Cetina <ma...@gmail.com>.
The attribute metadata-complete="true" is for what?
El 06/06/2012 18:31, "Jeremyau" <ja...@gmail.com> escribió:

> It works !!!!!!!!! You were right. I missed metadata-complete="true" in
> web.xml.
>
> Thanks so much Romain. That's awesome!
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655468.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
It works !!!!!!!!! You were right. I missed metadata-complete="true" in
web.xml.

Thanks so much Romain. That's awesome!

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655468.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Thank you for your answer.

I did the same and I still have the same issue...

I just changed:

  <persistence-unit name="catalogPU" transaction-type="JTA">
    <jta-data-source>jdbc/petcatalog</jta-data-source>

    <property name="openjpa.jdbc.SynchronizeMappings" 
value="buildSchema(ForeignKeys=true)"/> 
  </persistence-unit>

And I got :

"user lacks privilege or object not found"

I guess I forgot something but I can't figure out what. As the error is
about privilege, maybe it's about tomcat-user.xml?

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655467.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
just retried,

to be able to test i just added

<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>

to your persistence.xml

but it works as ROOT webapps

here my steps
1) co your repo
2) mvn package
3) rm ROOT from tomee
4) mv catalog.war to ROOT.war in webapps folder of tomee

- Romain


2012/6/7 Romain Manni-Bucau <rm...@gmail.com>

> is metadata-complete="true" in the ROOT/WEB-INF/web.xml?
>
> - Romain
>
>
>
> 2012/6/7 Jeremyau <ja...@gmail.com>
>
>> Ok so I git co the tomee trunk and build it with maven. Everything is ok,
>> I've got my zip file with tomee plus.
>>
>> I repeat the same step:
>> 1. Delete the ROOT folder in webapp
>> 2. Deploy my application (I've deployed 2 wars: ROOT.war and catalog.war
>> which both contain pet-catalog application)
>> 3. I run the tomee server
>>
>> localhost:8080/catalog => OK
>> localhost:8080 => Error
>>
>> javax.servlet.ServletException: javax.el.ELException: Error reading
>> 'items'
>> on type controller.Catalog
>>        javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)
>>
>> root cause
>>
>> org.apache.myfaces.view.facelets.el.ContextAwareELException:
>> javax.el.ELException: Error reading 'items' on type controller.Catalog
>>
>>
>> org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:104)
>>
>>  javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:246)
>>
>> ...
>>
>> javax.ejb.EJBException: The bean encountered a non-application exception;
>> nested exception is:
>>        <openjpa-2.2.0-r422266:1244990 fatal general error>
>> org.apache.openjpa.persistence.PersistenceException: user lacks privilege
>> or
>> object not found: ITEM {SELECT t0.id, t0.address_id, t0.description,
>> t0.imagethumburl, t0.imageurl, t0.name, t0.price, t0.product_id FROM
>> item t0
>> ORDER BY 1 LIMIT ?} [code=-5501, state=42501]
>> FailedObject: select object(o) from Item as o [java.lang.String]
>>
>>
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:368)
>>
>>
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:288)
>>
>>  controller.ItemFacade$LocalBeanProxy.findRange(controller/ItemFacade.java)
>>
>>
>> So it's so weird. Why does it work only if the application name is
>> different
>> than ROOT? It seems the tomee behaviour is different for the ROOT folder.
>>
>> Any idea? I have also tried with the tomee plugin  (maven tomee:run) and
>> it
>> works well. So, according to me, the problem does not come from the
>> application. Do you think so?
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655460.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
is metadata-complete="true" in the ROOT/WEB-INF/web.xml?

- Romain


2012/6/7 Jeremyau <ja...@gmail.com>

> Ok so I git co the tomee trunk and build it with maven. Everything is ok,
> I've got my zip file with tomee plus.
>
> I repeat the same step:
> 1. Delete the ROOT folder in webapp
> 2. Deploy my application (I've deployed 2 wars: ROOT.war and catalog.war
> which both contain pet-catalog application)
> 3. I run the tomee server
>
> localhost:8080/catalog => OK
> localhost:8080 => Error
>
> javax.servlet.ServletException: javax.el.ELException: Error reading 'items'
> on type controller.Catalog
>        javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)
>
> root cause
>
> org.apache.myfaces.view.facelets.el.ContextAwareELException:
> javax.el.ELException: Error reading 'items' on type controller.Catalog
>
>
> org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:104)
>
>  javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:246)
>
> ...
>
> javax.ejb.EJBException: The bean encountered a non-application exception;
> nested exception is:
>        <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: user lacks privilege
> or
> object not found: ITEM {SELECT t0.id, t0.address_id, t0.description,
> t0.imagethumburl, t0.imageurl, t0.name, t0.price, t0.product_id FROM item
> t0
> ORDER BY 1 LIMIT ?} [code=-5501, state=42501]
> FailedObject: select object(o) from Item as o [java.lang.String]
>
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:368)
>
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:288)
>
>  controller.ItemFacade$LocalBeanProxy.findRange(controller/ItemFacade.java)
>
>
> So it's so weird. Why does it work only if the application name is
> different
> than ROOT? It seems the tomee behaviour is different for the ROOT folder.
>
> Any idea? I have also tried with the tomee plugin  (maven tomee:run) and it
> works well. So, according to me, the problem does not come from the
> application. Do you think so?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655460.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Ok so I git co the tomee trunk and build it with maven. Everything is ok,
I've got my zip file with tomee plus.

I repeat the same step:
1. Delete the ROOT folder in webapp
2. Deploy my application (I've deployed 2 wars: ROOT.war and catalog.war
which both contain pet-catalog application)
3. I run the tomee server

localhost:8080/catalog => OK
localhost:8080 => Error

javax.servlet.ServletException: javax.el.ELException: Error reading 'items'
on type controller.Catalog
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)

root cause

org.apache.myfaces.view.facelets.el.ContextAwareELException:
javax.el.ELException: Error reading 'items' on type controller.Catalog

org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:104)
	javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:246)

...

javax.ejb.EJBException: The bean encountered a non-application exception;
nested exception is: 
	<openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: user lacks privilege or
object not found: ITEM {SELECT t0.id, t0.address_id, t0.description,
t0.imagethumburl, t0.imageurl, t0.name, t0.price, t0.product_id FROM item t0
ORDER BY 1 LIMIT ?} [code=-5501, state=42501]
FailedObject: select object(o) from Item as o [java.lang.String]

org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:368)

org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:288)
	controller.ItemFacade$LocalBeanProxy.findRange(controller/ItemFacade.java)


So it's so weird. Why does it work only if the application name is different
than ROOT? It seems the tomee behaviour is different for the ROOT folder.

Any idea? I have also tried with the tomee plugin  (maven tomee:run) and it
works well. So, according to me, the problem does not come from the
application. Do you think so?

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655460.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
isn't the snapshot usable for you?

- Romain


2012/6/6 Jeremyau <ja...@gmail.com>

> Oh I see. So how can I proceed to patch my Tomee server?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655437.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Oh I see. So how can I proceed to patch my Tomee server?

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655437.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
sorry i dont open the code again (a bit busy) but if catalogue is a
managedbean there is an issue fixed on trunk in tomee 1.0.0

- Romain


2012/6/5 Jeremyau <ja...@gmail.com>

> Yes, you're right. This is what I did but unfortunately, there is still the
> same issue.
>
> I delete the ROOT folder.
> I copy paste my ROOT.war.
> I start the server.
> TomEE deploy my ROOT.war and create a ROOT folder.
> Still the same error.
>
> I'm not familiar with EJB and JEE6 but it seems the error comes from
> Catalog.java:
>    @EJB
>    private ItemFacade itemFacade;
>
> itemFacade is null.
>
> Any idea? Thanks for your help!
> Jeremy
> PS: If i deploy the war with a different name than 'ROOT' (like test.war,
> catalog.war or whatever), then it works.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655428.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Yes, you're right. This is what I did but unfortunately, there is still the
same issue. 

I delete the ROOT folder.
I copy paste my ROOT.war.
I start the server.
TomEE deploy my ROOT.war and create a ROOT folder.
Still the same error.

I'm not familiar with EJB and JEE6 but it seems the error comes from
Catalog.java:
    @EJB
    private ItemFacade itemFacade;

itemFacade is null.

Any idea? Thanks for your help!
Jeremy
PS: If i deploy the war with a different name than 'ROOT' (like test.war,
catalog.war or whatever), then it works.

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655428.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
ROOT folder should already exist i guess, delete it before starting

- Romain


2012/6/5 Jeremyau <ja...@gmail.com>

> I copied pasted my ROOT.war to the webapp folder.* (Sorry)
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655425.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
I copied pasted my ROOT.war to the webapp folder.* (Sorry)

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655425.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Jeremyau <ja...@gmail.com>.
Thanks for your quick response Romain!

Well, it's really weird because 

I just downloaded 
http://mirror.csclub.uwaterloo.ca/apache/openejb/openejb-4.0.0/apache-tomee-1.0.0-plus.tar.gz
Apache TomEE Plus  1.0. 
I git clone  https://github.com/tikalk/jee6-pet-catalog-sample pet-catalog
project . 
I "mvn clean package'. (I just changed the version of the maven-war-plugin
to 2.2)
I renamed the war to "ROOT.war".
I deleted the default ROOT folder in the webapp folder.
I copied past my ROOT.war.
I ./bin/catalina.sh start.
And finally, localhost:8080 and I still got this error.

Did I do something wrong? Did you do the same? Please, let me know.

Thank you,
Jeremy

--
View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655424.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Deploying Pet-catalog

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

i had no issues on trunk

- Romain


2012/6/5 Jeremyau <ja...@gmail.com>

> Hi,
>
> I'm trying to deploy the JEE6
> https://github.com/tikalk/jee6-pet-catalog-sample pet-catalog example  on
> TomEE plus.
> So I create the war file with maven and I deploy it on webapps. Everything
> is ok, it works well.
>
> But, when I change the name of the war file to "ROOT" and deploy it to
> TomEE
> plus server, I've got an weird error:
>
> SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path
> [] threw exception [javax.el.ELException: Error reading 'pagingInfo' on
> type
> controller.Catalog] with root cause
> java.lang.NullPointerException
>        at controller.Catalog.getItemCount(Catalog.java:77)
>        at controller.Catalog.getPagingInfo(Catalog.java:37)
>        at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:601)
> ...
>
> I looked for the reason of this error but nothing found... I guess there is
> something to change in the web.xml file but I can't figure out what.
>
> Any help is welcome!
>
> Thanks
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>