Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

tomee+ and restful webservice

omile bartholomew
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to all my brother.please i'm new to restful web service and also new in using the new Apache TomeePlus .My aim of using restful web service is to integrate it in my web e-eCommerce website.

My IDE is Netbeans 7.3.1,
In my sql ,I built a database called oko which is made up on table with ID, first name and Last name, this is just for testing purposes.
in My netbeans i built a web app called AGAIN
in this AGAIN I built entity beans from my MySQL database,"entity class ="
i built restful web service from entity class "";
i used glassfish server 3.2.
when i tested the restful web service it work pretty well.
i was very happy with this !!.

Now i tried to do thesame thing with my apache TomeePlus server ,
but it is not working .
i included "MySQL driver jar file " to TomeePlus /lib",
i Followed the step on FIRST:
it gave me an error which has kept me one week trying to resolve.

SEVERE: Servlet.service() for servlet [ServletAdaptor] in context with path [/AGAIN] threw exception
at service.AbstractFacade.findAll(
at service.OkoFacadeREST.findAll(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(
at com.sun.jersey.spi.container.servlet.WebComponent.service(
at com.sun.jersey.spi.container.servlet.ServletContainer.service(
at com.sun.jersey.spi.container.servlet.ServletContainer.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.valves.AccessLogValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.AbstractHttp11Processor.process(
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

My web.xml file looks like this

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<description>Multiple packages, separated by semicolon(;), can be specified in param-value</description>


My context.xml file looks like this
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/AGAIN"/>


My persistence .xml file looks like this

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="" xmlns:xsi="" version="2.1" xsi:schemaLocation="">
<persistence-unit name="AGAINPU" transaction-type="RESOURCE_LOCAL">
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/okolotesting?zeroDateTimeBehavior=convertToNull"/>
<property name="javax.persistence.jdbc.password" value="root"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.user" value="root"/>

.Please brothers this has kept me almost a week of sleepless nigth.
i need your help and support please.
Ulf Dittmer
Posts: 42970
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at service.AbstractFacade.findAll(
at service.OkoFacadeREST.findAll(

Some object in your code is null. Start by finding out which object that is. Then decide whether that object being null is a bug (which you would then debug further), or if it's legitimately null and the code just isn't handling that case correctly yet.
omile bartholomew
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello i notice that the issue comes from loading the mysql driver to Tomeeplus.i do include that to \lib folder of tomeeplus but the iti is still the same.please can you show my the configuration of CATLINAT_Home of apache.?thats how to configure it with mysql driver ?.thank you for your help Ulf Dittmer
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!