You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by kalgik <ko...@yahoo.gr> on 2012/04/24 11:12:21 UTC

Problem deploying REST Examples on Eclipse

Hello everybody.
I tried to deploy the "REST Example with Application" on Eclipse Indigo.
Here the steps I followed:
First of all,  I installed TomEEplus  
http://www.apache.org/dyn/closer.cgi/openejb/4.0.0-beta-2/apache-tomee-1.0.0-beta-2-plus.zip
http://www.apache.org/dyn/closer.cgi/openejb/4.0.0-beta-2/apache-tomee-1.0.0-beta-2-plus.zip 
. I moved all the jar files from webapps\tomee\lib to
apache-tomee-plus-1.0.0\lib folder (it was written as suggestion in JIRA).
Then, I select Web->Dynamic Web Project, I set "Dynamic web module_version"=
3 and leave it to “Default Configuration for TomEE plus” on Eclipse. I
successfully built the project but when I run it on the server I receive the
following excpetion:
24 Απρ 2012 11:39:30 πμ org.apache.myfaces.webapp.AbstractFacesInitializer
initFaces
SEVERE: An error occured while initializing MyFaces: null
java.lang.NullPointerException
	at
org.apache.tomee.myfaces.TomEEAnnotationProvider.getAnnotatedClasses(TomEEAnnotationProvider.java:41)
	at
org.apache.myfaces.config.annotation.AnnotationConfigurator.createFacesConfig(AnnotationConfigurator.java:90)

Do I have I do more settings and where? Shall I add JSF and JSTL libraries?
Is the right way to test the REST examples in Eclipse as above?

Regards,
kalgik


--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4582815.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by David Blevins <da...@gmail.com>.
Moving the libraries doesn't work with beta-2, but I did do some hacking on that just Saturday for the coming 1.0.0 binaries.

Is it possible you can try this set of binaries?

  http://people.apache.org/~dblevins/staging-081/openejb-4.0.0/

Keep in mind those will likely not be the actual 1.0.0 binaries that are released, so when TomEE 1.0.0 comes out make sure you download the official binaries.


-David

On Apr 24, 2012, at 2:12 AM, kalgik wrote:

> Hello everybody.
> I tried to deploy the "REST Example with Application" on Eclipse Indigo.
> Here the steps I followed:
> First of all,  I installed TomEEplus  
> http://www.apache.org/dyn/closer.cgi/openejb/4.0.0-beta-2/apache-tomee-1.0.0-beta-2-plus.zip
> http://www.apache.org/dyn/closer.cgi/openejb/4.0.0-beta-2/apache-tomee-1.0.0-beta-2-plus.zip 
> . I moved all the jar files from webapps\tomee\lib to
> apache-tomee-plus-1.0.0\lib folder (it was written as suggestion in JIRA).
> Then, I select Web->Dynamic Web Project, I set "Dynamic web module_version"=
> 3 and leave it to “Default Configuration for TomEE plus” on Eclipse. I
> successfully built the project but when I run it on the server I receive the
> following excpetion:
> 24 Απρ 2012 11:39:30 πμ org.apache.myfaces.webapp.AbstractFacesInitializer
> initFaces
> SEVERE: An error occured while initializing MyFaces: null
> java.lang.NullPointerException
> 	at
> org.apache.tomee.myfaces.TomEEAnnotationProvider.getAnnotatedClasses(TomEEAnnotationProvider.java:41)
> 	at
> org.apache.myfaces.config.annotation.AnnotationConfigurator.createFacesConfig(AnnotationConfigurator.java:90)
> 
> Do I have I do more settings and where? Shall I add JSF and JSTL libraries?
> Is the right way to test the REST examples in Eclipse as above?
> 
> Regards,
> kalgik
> 
> 
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4582815.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Problem deploying REST Examples on Eclipse

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

the differences between embedded (unit test) and tomee will be:
0) the packaging will be war instead of jar
1) persistence.xml will go in WEB-INF instead of META-INF

Note: if you take the jar built from this project and put in in <some app
folder>/WEB-INF/lib it shouldn't be far to work in tomee directly ;)

It seems for you maven is blocking, what would you expect? If it is ant i
think running mvn ant:ant should create a build.xml

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/11/14 Jerome <il...@3ds.com>

> Hi guys,
>
> I'm looking for a straigthforward example with REST and TomEE, linked to a
> database.
> I saw your romain but it's with maven, I guess we can run this without
> maven
> or struts.
>
> Kind of ejb project which is called by rest.
> The example  REST on EJB
> <http://openejb.apache.org/examples-trunk/rest-on-ejb/README.html>   is
> quite good, but it's a unit test, I don't get how to make it works in real
> (from a webbrowser).
>
> Anyone has a simple sample of that ?
>
> Thx
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4658594.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by Jerome <il...@3ds.com>.
Hi guys,

I'm looking for a straigthforward example with REST and TomEE, linked to a
database.
I saw your romain but it's with maven, I guess we can run this without maven
or struts.

Kind of ejb project which is called by rest.
The example  REST on EJB
<http://openejb.apache.org/examples-trunk/rest-on-ejb/README.html>   is
quite good, but it's a unit test, I don't get how to make it works in real
(from a webbrowser).

Anyone has a simple sample of that ?

Thx



--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4658594.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
The Eclipse embedded browser had a lot of problems. I receive exceptions if I
used it.
I was relied on it too much.

The paths are working properly from outside browsers (IE, FireFox, Chrome).

kalgik

--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4607989.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i probably missed sthg,

for the test i just copied/pasted the url which appeared in the logs.

for me it was http://localhost:8080/testwebapp/restws/rest-prefix/ejb/ and
http://localhost:8080/testwebapp/restws/rest-prefix/pojo/

- Romain


2012/5/3 kalgik <ko...@yahoo.gr>

> The SimpleRESTEJB can be tested from he browser and you can see the result
> of
> its method by clicking the ejb() method.
> Can I also see the result of the SimpleRESTPojo (pojo() )?
>
> kalgik
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4606244.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
The SimpleRESTEJB can be tested from he browser and you can see the result of
its method by clicking the ejb() method.
Can I also see the result of the SimpleRESTPojo (pojo() )?

kalgik



--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4606244.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
what do you mean?

- Romain


2012/5/3 kalgik <ko...@yahoo.gr>

> It is ok for me also.
>
> Another question:
> How can I test the pojo part from the browser?
>
> kalgik
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4606101.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
It is ok for me also.

Another question:
How can I test the pojo part from the browser?

kalgik


--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4606101.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
here the project i used:
http://www.2shared.com/file/okCVfypb/openEJBExample3.html (that's a maven
one: mvn package to create the war)

here the war precompiled:
http://www.2shared.com/file/EFv8AQsM/foo-11-SNAPSHOT.html

works fine with the 1.0.0 for me

- Romain


2012/5/3 kalgik <ko...@yahoo.gr>

> By the "in the spec it is mentionned that's the correct way to define the
> application class for a servlet container and that the container can use
> other way to discover it." Do I have to do something more which I missed
> it?
>
> Using the web.xml you wrote to me I still receive the same exception
> ""java.lang.NullPointerException
>        sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>       java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>          ..................
>        ...................."
>
> The artifact does not start or contain the word openEJB.
> Unfortunately, I cannot deploy it.
>
> kalgik
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605787.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
By the "in the spec it is mentionned that's the correct way to define the 
application class for a servlet container and that the container can use 
other way to discover it." Do I have to do something more which I missed it?

Using the web.xml you wrote to me I still receive the same exception
""java.lang.NullPointerException 
        sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) 
       java.lang.ClassLoader.loadClass(ClassLoader.java:248) 
         ..................
        ...................."
 
The artifact does not start or contain the word openEJB.
Unfortunately, I cannot deploy it.

kalgik




--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605787.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
in the spec it is mentionned that's the correct way to define the
application class for a servlet container and that the container can use
other way to discover it.

using this web.xml it works:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://java.sun.com/xml/ns/javaee"
 xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
 id="WebApp_ID" version="3.0">
  <display-name>openEJBExample3</display-name>


  <servlet>
    <servlet-name>ApplicationConfig</servlet-name>
    <init-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>ApplicationConfig</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>ApplicationConfig</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>


Can you give a try renaming the deployed artifact (.war or exploded folder)
with a name not starting with openejb please?

- Romain


2012/5/3 kalgik <ko...@yahoo.gr>

> I tested both of them.
> If I add the servlet part you recommended to me but I receive the following
> error:
> "java.lang.NullPointerException
>        sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>        java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1626)
>
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
>
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:461)
>
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
>
>  org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
>
>  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
>
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
>
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
>
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        java.lang.Thread.run(Thread.java:662)
> "
> But the ApplicationConfig is not a servlet, isn't it?
>
> I added the system property to the Run Configuration without result.
>
> Can you please send to me your project which is working?
>
> kalgik
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605714.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
I tested both of them. 
If I add the servlet part you recommended to me but I receive the following
error:
"java.lang.NullPointerException
	sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	java.lang.ClassLoader.loadClass(ClassLoader.java:248)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1626)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:461)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)

org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)

org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	java.lang.Thread.run(Thread.java:662)
"
But the ApplicationConfig is not a servlet, isn't it?

I added the system property to the Run Configuration without result.

Can you please send to me your project which is working?

kalgik


--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605714.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you try either adding to your web.xml:

  <servlet>
    <servlet-name>ApplicationConfig</servlet-name>
    <init-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>ApplicationConfig</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>ApplicationConfig</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

or adding the system property "-Dtomee.jaxrs.deploy.undeclared=true"


- Romain


2012/5/3 kalgik <ko...@yahoo.gr>

> I have uploaded at
> https://github.com/downloads/kalgik/tomEE_Projects/openEJBExample3.rar
>
> I tested with Java 1.6 and Java 1.7.
>
> kalgik
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605537.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
I have uploaded at
https://github.com/downloads/kalgik/tomEE_Projects/openEJBExample3.rar

I tested with Java 1.6 and Java 1.7.

kalgik

--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605537.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

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

i don't see why it can't work, can you upload it to a public place please?
(the best for us is a goodle code or github account)

- Romain


2012/5/3 kalgik <ko...@yahoo.gr>

> The annotations I had are:
> @ApplicationPath("/restws/rest-prefix") for the ApplicationConfig
> @Path("/ejb") for the SimpleRESTEJB
> @Path("/pojo") for SimpleRESTPojo
>
> The ApplicationConfig,SimpleRESTEJB and SimpleRESTPojo are in the restws
> package.
> If I change the annotated paths, I received class not found from TomEE plus
> when I deploy the project.
> I receive the "404 Not Found" when I run the application.
>
> Any ideas?
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605497.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
The annotations I had are:
@ApplicationPath("/restws/rest-prefix") for the ApplicationConfig
@Path("/ejb") for the SimpleRESTEJB
@Path("/pojo") for SimpleRESTPojo

The ApplicationConfig,SimpleRESTEJB and SimpleRESTPojo are in the restws
package.
If I change the annotated paths, I received class not found from TomEE plus
when I deploy the project.
I receive the "404 Not Found" when I run the application.

Any ideas?



 

--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4605497.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
"org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
WARNING: No mappings of FacesServlet found. Abort initializing MyFaces." is
just a warning it is not an issue.

normally simply annotate @Path your service and it should work.

- Romain


2012/5/2 kalgik <ko...@yahoo.gr>

> I used the apache-tomee-1.0.0-plus.zip from
>
> http://www.apache.org/dyn/closer.cgi/openejb/openejb-4.0.0/apache-tomee-1.0.0-plus.zip
>
> http://www.apache.org/dyn/closer.cgi/openejb/openejb-4.0.0/apache-tomee-1.0.0-plus.zip
> .
>
> I followed the instructions for the TomEE installation on Eclipse but
> unfortunately still can not be deployed.
> I created a "Dynamic Web Project" with dynamic web module version = 3.0 (is
> that right?).
>
> Can you please tell me the exact steps I had to follow?
> By the way , I still receive the message
> *"org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
> WARNING: No mappings of FacesServlet found. Abort initializing MyFaces."
> from the TomEE plus. *
>
> kalgik
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4603389.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
I used the apache-tomee-1.0.0-plus.zip from 
http://www.apache.org/dyn/closer.cgi/openejb/openejb-4.0.0/apache-tomee-1.0.0-plus.zip
http://www.apache.org/dyn/closer.cgi/openejb/openejb-4.0.0/apache-tomee-1.0.0-plus.zip
.

I followed the instructions for the TomEE installation on Eclipse but
unfortunately still can not be deployed. 
I created a "Dynamic Web Project" with dynamic web module version = 3.0 (is
that right?).

Can you please tell me the exact steps I had to follow? 
By the way , I still receive the message 
*"org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
WARNING: No mappings of FacesServlet found. Abort initializing MyFaces."
from the TomEE plus. *

kalgik



--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4603389.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
apache-tomee-1.0.0-webprofile.zip doesn't support rest or soap services.
Use apache-tomee-1.0.0-plus.zip

- Romain


2012/5/2 kalgik <ko...@yahoo.gr>

> Yes, it still rest service.
> I am using now the tomee-webprofile (apache-tomee-1.0.0-webprofile.zip).
>
> kalgik
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4603348.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
Yes, it still rest service.
I am using now the tomee-webprofile (apache-tomee-1.0.0-webprofile.zip).

kalgik


--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4603348.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
is it still about rest services?

if yes do you use tomee+ or tomee-webprofile?

- Romain


2012/5/2 kalgik <ko...@yahoo.gr>

> Hello Anthony.
>
> I followed the steps you provided.
> However, I still can not deploy my web applciation on tomEE Web Profile
> server.
>
> I receive the following message: *"WARNING: No mappings of FacesServlet
> found. Abort initializing MyFaces."*
>
> I checked the
>
> http://openejb.979440.n4.nabble.com/FacesServlet-is-optional-in-Tomee-td4596836.html
>
> http://openejb.979440.n4.nabble.com/FacesServlet-is-optional-in-Tomee-td4596836.html
> Shall I copy and paste the source code of
>
> http://svn.apache.org/repos/asf/myfaces/core/trunk/implee6/src/main/java/org/apache/myfaces/ee6/MyFacesContainerInitializer.java
>
> http://svn.apache.org/repos/asf/myfaces/core/trunk/implee6/src/main/java/org/apache/myfaces/ee6/MyFacesContainerInitializer.java
> in my Eclipse project?
>
> I created a "Dynamic Web Project in Eclipse".
>
> Regards,
> kalgik
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4603106.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
Hello Anthony.

I followed the steps you provided.
However, I still can not deploy my web applciation on tomEE Web Profile
server.

I receive the following message: *"WARNING: No mappings of FacesServlet
found. Abort initializing MyFaces."*

I checked the 
http://openejb.979440.n4.nabble.com/FacesServlet-is-optional-in-Tomee-td4596836.html
http://openejb.979440.n4.nabble.com/FacesServlet-is-optional-in-Tomee-td4596836.html 
Shall I copy and paste the source code of 
http://svn.apache.org/repos/asf/myfaces/core/trunk/implee6/src/main/java/org/apache/myfaces/ee6/MyFacesContainerInitializer.java
http://svn.apache.org/repos/asf/myfaces/core/trunk/implee6/src/main/java/org/apache/myfaces/ee6/MyFacesContainerInitializer.java 
in my Eclipse project?

I created a "Dynamic Web Project in Eclipse".

Regards,
kalgik

--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4603106.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Anthony Fryer <ap...@hotmail.com>.
I have been using tomee in eclipse.  There's no need to copy any jars around,
or to specify the "Use tomcat installation" option.  You can create a tomee
server in eclipse and keep the default "Use workspace metadata (does not
modify tomcat installation)" option.   I just repeated the steps with the
latest build and it works.  The steps i use are...

    1. Download and install the Apache TomEE Web Profile server
(http://people.apache.org/~dblevins/staging-081/openejb-4.0.0/).  For my
installation i extracted the zip file to "C:\Program
Files\apache-tomee-webprofile-1.0.0".  Copy any database connector jar files
your webapp needs into the <tomee_install>/lib folder (eg.
mysql-connector-java-5.1.14-bin.jar if you connect to mysql database).

    2. In eclipse, click on the Servers tab, right click and select
New->Server.

    3. Select Apache->Tomcat v7.0 Server and click "Next >"

    4. Set the "Tomcat installation directory" to the location of your
Apache TomEE Web Profile server installation (C:\Program
Files\apache-tomee-webprofile-1.0.0). Click Next.

    5. Add your webapp to the server. Click "Finish".

    6. In the Servers tab, double click on your server to open up the
"Overview" page. Click on the "modules" tab

    7. Click "Add External Web Module". In the "Add Web Module" dialog, for
document base, browse to <tomee_install_dir>/webapps/tomee (ie. C:\Program
Files\apache-tomee-webprofile-1.0.0\webapps\tomee). Set Path: to "/tomee".
Uncheck "Auto reloading enabled". Click OK.

    8. Click on the <your webapp> module and click the "Edit..." button.
Uncheck the "Auto reloading enabled" checkbox and click OK. Then click the
save button in eclipse so the server configuration gets saved.

    9.  On the server "Overview" page, click "Open launch configuration".  
In the "Edit launch configuration properties" dialog box, click the
"Arguments" tab.  Add whatever vm arguments you want to the "VM arguments"
text field (eg.  -Xmx256M -XX:MaxPermSize=256M).

    10. Copy the tomee.xml and logging.properties files from the
<apache_tomee_install_dir>\conf folder into the folder created in eclipse
for your server configuration files (eg.
<eclipse_workdir>\Servers\apache-tomee-webprofile-1.0.0 at
localhost-config).  In eclipse, click on the Servers folder and hit F5 to
refresh.  These files will now be displayed in eclipse.

    11. In eclipse, click on your webapp project, then select
"Project->clean". Hit OK. This will cause eclipse to clean and rebuild your
web application ready to deploy to the tomee server.

    12. In the Servers tab, right click on the server and select "Publish".

    13. Start the server. 

I had a minor issue going from beta2 to 1.0.0 caused by a persistence.xml
file that i had in my webapp project which referenced a jar file that also
contained a persistence.xml.  In beta2 you needed the persistence.xml to be
in your webapp project.  In tomee 1.0.0 it scans jars in WEB-INF/lib and
finds persistence.xml files contained within them.  It was easy to resolve
by just deleting my webapps persistence.xml file.

--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4585104.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i just tried a web project under eclipse and did it
http://openejb.apache.org/tomee-and-eclipse.html and it works fine.

- Romain


2012/4/24 Romain Manni-Bucau <rm...@gmail.com>

> i can't download it :(
>
> - Romain
>
>
>
> 2012/4/24 kalgik <ko...@yahoo.gr>
>
>> I have uploaded the contents of Eclipse project at
>> https://www.dropbox.com/home/TomEEplus_Example4
>> https://www.dropbox.com/home/TomEEplus_Example4
>>
>> Regards,
>> kalgik
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4583346.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Re: Problem deploying REST Examples on Eclipse

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i can't download it :(

- Romain


2012/4/24 kalgik <ko...@yahoo.gr>

> I have uploaded the contents of Eclipse project at
> https://www.dropbox.com/home/TomEEplus_Example4
> https://www.dropbox.com/home/TomEEplus_Example4
>
> Regards,
> kalgik
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4583346.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
I have uploaded the contents of Eclipse project at 
https://www.dropbox.com/home/TomEEplus_Example4
https://www.dropbox.com/home/TomEEplus_Example4 

Regards,
kalgik

--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4583346.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Problem deploying REST Examples on Eclipse

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

Can you share your project?

- Romain
Le 24 avr. 2012 13:31, "kalgik" <ko...@yahoo.gr> a écrit :

> I tried with the version you recommended. I copied all the jat files from
> tomme\lib folder to lib\ folder.
> The build was successfully again.
> But when I run the Eclipse project I received the following:
>
> "ΜΜ org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
> WARNING: No mappings of FacesServlet found. Abort initializing MyFace"
>
> I checked the TomEE plus server.xml and it containes the
> org.apache.tomee.loader.OpenEJBListener Listener.
>
> Any ideas?
>
> Regards,
> kalgik
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4583122.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Problem deploying REST Examples on Eclipse

Posted by kalgik <ko...@yahoo.gr>.
I tried with the version you recommended. I copied all the jat files from
tomme\lib folder to lib\ folder.
The build was successfully again.
But when I run the Eclipse project I received the following:

"ΜΜ org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
WARNING: No mappings of FacesServlet found. Abort initializing MyFace"

I checked the TomEE plus server.xml and it containes the
org.apache.tomee.loader.OpenEJBListener Listener.

Any ideas?

Regards,
kalgik

--
View this message in context: http://openejb.979440.n4.nabble.com/Problem-deploying-REST-Examples-on-Eclipse-tp4582815p4583122.html
Sent from the OpenEJB User mailing list archive at Nabble.com.