java - EntityManages NullPointerException, eclipselink + tomee + Jersey + Derby -


i new jpa, ejb , rest topic , wanted make simple crud app. when use entitymanagerfactory entities derby problem starts when want use transactions persisting objects. when try inject entitymanager nullpointerexception. i've seen several topic @ stackoverflow similar problems apparently cannot solve problem.

i want run app , focus on persistence concept , not spent few days trying set up. don't know why cannot provide datasource in web-inf/resources.xml (warning - failed register in jmx: javax.naming.namenotfoundexception: name "resource/crud/localdb" not found.)

persistence.xml

<?xml version="1.0" encoding="utf-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">   <persistence-unit name="mypersistenceunit" transaction-type="jta">     <provider>org.eclipse.persistence.jpa.persistenceprovider</provider>     <jta-data-source>localdb</jta-data-source>     <class>com.kuba.crud.model.customer</class>     <properties>     <property name="javax.persistence.jdbc.user" value="testuser"/>         <property name="javax.persistence.jdbc.password" value="password"/>       <property name="javax.persistence.target-database." value="derby"/>       <property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/testdb;create=true"/>       <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.clientdriver"/>     </properties>   </persistence-unit> </persistence> 

customer entity

package com.kuba.crud.model;  import java.io.serializable; import javax.persistence.basic; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.id; import javax.persistence.namedqueries; import javax.persistence.namedquery; import javax.persistence.table; import javax.validation.constraints.notnull; import javax.validation.constraints.size; import javax.xml.bind.annotation.xmlrootelement;   @entity @table(name = "customers") @xmlrootelement @namedqueries({     @namedquery(name = "customer.findall", query = "select c customer c"),     @namedquery(name = "customer.findbyid", query = "select c customer c c.id = :id"),     @namedquery(name = "customer.findbyfirstname", query = "select c customer c c.firstname = :firstname"),     @namedquery(name = "customer.findbylastname", query = "select c customer c c.lastname = :lastname"),     @namedquery(name = "customer.findbyage", query = "select c customer c c.age = :age")}) public class customer implements serializable {       private static final long serialversionuid = 1l;     @id     @basic(optional = false)     @notnull         @column(name = "id")     private integer id;     @size(max = 20)     @column(name = "firstname")     private string firstname;     @size(max = 20)     @column(name = "lastname")     private string lastname;     @column(name = "age")     private integer age;      public customer() {     }      public customer(integer id) {         this.id = id;     }      public integer getid() {         return id;     }      public void setid(integer id) {         this.id = id;     }      public string getfirstname() {         return firstname;     }      public void setfirstname(string firstname) {         this.firstname = firstname;     }      public string getlastname() {         return lastname;     }      public void setlastname(string lastname) {         this.lastname = lastname;     }      public integer getage() {         return age;     }      public void setage(integer age) {         this.age = age;     }      @override     public int hashcode() {         int hash = 0;         hash += (id != null ? id.hashcode() : 0);         return hash;     }      @override     public boolean equals(object object) {         // todo: warning - method won't work in case id fields not set         if (!(object instanceof customer)) {             return false;         }         customer other = (customer) object;         if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {             return false;         }         return true;     }      @override     public string tostring() {         return "com.kuba.crud.model.customer[ id=" + id + " first name="+firstname+" last name="+lastname+" age="+age+" ]";     }    } 

customerresource class

package com.kuba.crud.resources;  import com.kuba.crud.model.customer; import com.kuba.crud.service.customerservice; import java.util.list; import javax.ejb.ejb; import javax.ws.rs.consumes; import javax.ws.rs.get; import javax.ws.rs.post; import javax.ws.rs.path; import javax.ws.rs.pathparam; import javax.ws.rs.produces;  import javax.ws.rs.core.mediatype;   @path("/customers") @consumes(mediatype.application_json) @produces(mediatype.application_json)  public class customerresource {     @ejb(lookup = "customerservice")    private customerservice customerservice;      public customerresource() {      }              @get     public list<customer> getcustomers() {                  system.out.println("is customerservice emptyy? "+(customerservice==null));         return customerservice.getallcustomers();      }     @get     @path("/{id}")     public customer getcustomer(@pathparam("id") int id){         return customerservice.getcustomer(id);     }      @post     public void addcustomer(customer customer){          customerservice.addprofile(customer);     }        } 

customerservice class

package com.kuba.crud.service;  import com.kuba.crud.model.customer; import java.util.arraylist; import java.util.list; import javax.ejb.stateful; import javax.persistence.entitymanager; import javax.persistence.persistencecontext; import javax.persistence.query;      @stateful         public class customerservice {      //    entitymanagerfactory entitymanagerfactory;         @persistencecontext(unitname = "mypersistenceunit")         private entitymanager em;          public customerservice(){     //       entitymanagerfactory = persistence.createentitymanagerfactory("mypersistenceunit");     //       em = entitymanagerfactory.createentitymanager();         }          public list<customer> getallcustomers() {              list<customer> customers = new arraylist<>();             system.out.println("is empty? "+(em==null));                  query query = em.createnamedquery("customer.findall", customer.class);                 customers = query.getresultlist();              return customers;         }          public customer getcustomer(int id){              return em.find(customer.class, id);             }         public void addprofile(customer customer) {                  em.persist(customer);                system.out.println("customerservice: "+customer);          }      } 

tomee on startup:

using catalina_home:   "c:\apache-tomee-plume-7.0.1" using catalina_tmpdir: "c:\apache-tomee-plume-7.0.1\temp" using jre_home:        "c:\program files\java\jdk1.8.0_102" using classpath:       "c:\apache-tomee-plume-7.0.1\bin\bootstrap.jar;c:\apache-tomee-plume-7.0.1\bin\tomcat-juli.jar" info - default jpa provider changed org.eclipse.persistence.jpa.persistenceprovider info - server version:        apache tomcat (tomee)/8.5.3 (7.0.1) info - server built:          jun 9 2016 11:16:29 utc info - server number:         8.5.3.0 info - os name:               windows 8.1 info - os version:            6.3 info - architecture:          amd64 info - java home:             c:\program files\java\jdk1.8.0_102\jre info - jvm version:           1.8.0_102-b14 info - jvm vendor:            oracle corporation info - catalina_base:         c:\apache-tomee-plume-7.0.1 info - catalina_home:         c:\apache-tomee-plume-7.0.1 info - command line argument: -javaagent:c:\apache-tomee-plume-7.0.1\lib\openejb-javaagent.jar info - command line argument: -djdk.tls.ephemeraldhkeysize=2048 info - command line argument: -djava.util.logging.config.file=c:\apache-tomee-plume-7.0.1\conf\logging.properties info - command line argument: -djava.util.logging.manager=org.apache.juli.classloaderlogmanager info - command line argument: -dcatalina.base=c:\apache-tomee-plume-7.0.1 info - command line argument: -dcatalina.home=c:\apache-tomee-plume-7.0.1 info - command line argument: -djava.io.tmpdir=c:\apache-tomee-plume-7.0.1\temp info - apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: c:\program files\java\jdk1.8.0_102\bin;c:\windows\sun\java\bin;c:\windows\system32;c:\windows;c:\programdata\oracle\java\javapath;c:\program files (x86)\intel\icls client\;c:\program files\intel\icls client\;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\windows\idmu\common;c:\program files\lenovo\fingerprint manager pro\;c:\program files (x86)\calibre2\;c:\program files\matlab\matlab production server\r2015a\runtime\win64;c:\program files\matlab\matlab production server\r2015a\bin;c:\program files\matlab\matlab production server\r2015a\polyspace\bin;c:\program files\intel\wifi\bin\;c:\program files\common files\intel\wirelesscommon\;c:\program files (x86)\intel\intel(r) management engine components\dal;c:\program files\intel\intel(r) management engine components\dal;c:\program files (x86)\intel\intel(r) management engine components\ipt;c:\program files\intel\intel(r) management engine components\ipt;c:\program files\apache-maven-3.3.9\bin;c:\program files\db-derby-10.12.1.1-bin\bin;c:\java\tomcat-native-1.2.8-win32-src;c:\program files\intel\wifi\bin\;c:\program files\common files\intel\wirelesscommon\;. info - initializing protocolhandler ["http-nio-8080"] info - using shared selector servlet write/read info - initializing protocolhandler ["ajp-nio-8009"] info - using shared selector servlet write/read info - using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.tomeedatasourcecreator' info - ******************************************************************************** info - openejb http://tomee.apache.org/ info - startup: wed sep 07 13:11:16 cest 2016 info - copyright 1999-2016 (c) apache openejb project, rights reserved. info - version: 7.0.1 info - build date: 20160623 info - build time: 12:04 info - ******************************************************************************** info - openejb.home = c:\apache-tomee-plume-7.0.1 info - openejb.base = c:\apache-tomee-plume-7.0.1 info - created new singletonservice org.apache.openejb.cdi.threadsingletonserviceimpl@6d2a209c info - succeeded in installing singleton service info - tomee configuration file 'c:\apache-tomee-plume-7.0.1\conf\tomee.xml' info - configuring service(id=tomcat security service, type=securityservice, provider-id=tomcat security service) info - configuring service(id=default transaction manager, type=transactionmanager, provider-id=default transaction manager) info - using 'openejb.deployments.classpath=false' info - creating transactionmanager(id=default transaction manager) info - creating securityservice(id=tomcat security service) info - creating serverservice(id=cxf) info - creating serverservice(id=cxf-rs) info -   ** bound services ** info -   name                 ip              port   info - ------- info - ready! info - initialization processed in 2332 ms info - importing tomcat resource id 'userdatabase' of type 'org.apache.catalina.userdatabase'. info - creating resource(id=userdatabase) info - starting service catalina info - starting servlet engine: apache tomcat (tomee)/8.5.3 (7.0.1) info - deploying configuration descriptor c:\apache-tomee-plume-7.0.1\conf\catalina\localhost\crud.xml info - ------------------------- localhost -> /crud info - configuring enterprise application: c:\users\t440s\documents\netbeansprojects\crud\target\crud info - auto-deploying ejb customerservice: ejbdeployment(deployment-id=customerservice) info - configuring service(id=crud/localdb, type=resource, provider-id=default jdbc database) info - creating resource(id=crud/localdb) info - configuring service(id=default managed container, type=container, provider-id=default managed container) info - auto-creating container bean crud.comp911887475: container(type=managed, id=default managed container) info - creating container(id=default managed container) info - using directory c:\apache-tomee-plume-7.0.1\temp stateful session passivation info - auto-linking resource-ref 'openejb/resource/crud/localdb' in bean crud.comp911887475 resource(id=crud/localdb) info - auto-linking resource-ref 'openejb/resource/localdb' in bean crud.comp911887475 resource(id=crud/localdb) info - configuring service(id=default stateful container, type=container, provider-id=default stateful container) info - auto-creating container bean customerservice: container(type=stateful, id=default stateful container) info - creating container(id=default stateful container) info - using directory c:\apache-tomee-plume-7.0.1\temp stateful session passivation info - auto-linking resource-ref 'openejb/resource/crud/localdb' in bean customerservice resource(id=crud/localdb) info - auto-linking resource-ref 'openejb/resource/localdb' in bean customerservice resource(id=crud/localdb) info - configuring persistenceunit(name=mypersistenceunit, provider=org.eclipse.persistence.jpa.persistenceprovider) info - auto-creating resource id 'crud/localdbnonjta' of type 'datasource 'mypersistenceunit'. info - configuring service(id=crud/localdbnonjta, type=resource, provider-id=crud/localdb) info - creating resource(id=crud/localdbnonjta) info - adjusting persistenceunit mypersistenceunit <jta-data-source> resource id 'crud/localdb' 'localdb' info - adjusting persistenceunit mypersistenceunit <non-jta-data-source> resource id 'crud/localdbnonjta' 'null' info - enterprise application "c:\users\t440s\documents\netbeansprojects\crud\target\crud" loaded. info - assembling app: c:\users\t440s\documents\netbeansprojects\crud\target\crud info - persistenceunit(name=mypersistenceunit, provider=org.eclipse.persistence.jpa.persistenceprovider) - provider time 1391ms info - jndi(name=customerservicelocalbean) --> ejb(deployment-id=customerservice) info - jndi(name=global/crud/customerservice!com.kuba.crud.service.customerservice) --> ejb(deployment-id=customerservice) info - jndi(name=global/crud/customerservice) --> ejb(deployment-id=customerservice) info - existing thread singleton service in systeminstance(): org.apache.openejb.cdi.threadsingletonserviceimpl@6d2a209c info - openwebbeans container starting... info - adding openwebbeansplugin : [cdiplugin] info - adding openwebbeansplugin : [openwebbeansjsfplugin] info - using annotated mode file:/c:/users/t440s/documents/netbeansprojects/crud/target/crud/web-inf/classes/ looking classes find cdi beans, maybe think add beans.xml if not there or add jar exclusions.list info - injection points validated successfully. info - openwebbeans container has started, took 344 ms. info - created ejb(deployment-id=customerservice, ejb-name=customerservice, container=default stateful container) info - started ejb(deployment-id=customerservice, ejb-name=customerservice, container=default stateful container) info - using context file c:\users\t440s\documents\netbeansprojects\crud\target\crud\meta-inf\context.xml info - deployed application(path=c:\users\t440s\documents\netbeansprojects\crud\target\crud) info - @ least 1 jar scanned tlds yet contained no tlds. enable debug logging logger complete list of jars scanned no tlds found in them. skipping unneeded jars during scanning can improve startup time , jsp compilation time. info - using readers: info -      org.apache.cxf.jaxrs.provider.primitivetextprovider@6dc43f2d info -      org.apache.cxf.jaxrs.provider.formencodingprovider@2b0a9a37 info -      org.apache.cxf.jaxrs.provider.multipartprovider@382667aa info -      org.apache.cxf.jaxrs.provider.sourceprovider@478b110c info -      org.apache.cxf.jaxrs.provider.jaxbelementprovider@3957f0bc info -      org.apache.openejb.server.cxf.rs.cxfrsservice$tomeejohnzonprovider@1645bc65 info -      org.apache.openejb.server.cxf.rs.cxfrsservice$tomeejsonpprovider@26b1fe87 info -      org.apache.cxf.jaxrs.provider.stringtextprovider@178951ff info -      org.apache.cxf.jaxrs.provider.binarydataprovider@5b783974 info -      org.apache.cxf.jaxrs.provider.datasourceprovider@60e510ea info - using writers: info -      org.apache.johnzon.jaxrs.wadldocumentmessagebodywriter@49898fb7 info -      org.apache.cxf.jaxrs.provider.stringtextprovider@178951ff info -      org.apache.cxf.jaxrs.provider.primitivetextprovider@6dc43f2d info -      org.apache.cxf.jaxrs.provider.formencodingprovider@2b0a9a37 info -      org.apache.cxf.jaxrs.provider.multipartprovider@382667aa info -      org.apache.cxf.jaxrs.provider.sourceprovider@478b110c info -      org.apache.cxf.jaxrs.provider.jaxbelementprovider@3957f0bc info -      org.apache.openejb.server.cxf.rs.cxfrsservice$tomeejohnzonprovider@1645bc65 info -      org.apache.openejb.server.cxf.rs.cxfrsservice$tomeejsonpprovider@26b1fe87 info -      org.apache.cxf.jaxrs.provider.binarydataprovider@5b783974 info -      org.apache.cxf.jaxrs.provider.datasourceprovider@60e510ea info - using exception mappers: info -      org.apache.cxf.jaxrs.impl.webapplicationexceptionmapper@7d54dc44 info -      org.apache.openejb.server.cxf.rs.ejbexceptionmapper@19c575df info -      org.apache.cxf.jaxrs.validation.validationexceptionmapper@494491b6 info - rest application: http://localhost:8080/crud/               -> org.apache.openejb.server.rest.internalapplication@46972b9f info -      service uri: http://localhost:8080/crud/customers      -> pojo com.kuba.crud.resources.customerresource info -               http://localhost:8080/crud/customers/     ->      list<customer> getcustomers() info -               http://localhost:8080/crud/customers/{id} ->      customer getcustomer(int)     info -              post http://localhost:8080/crud/customers/     ->      void addcustomer(customer)    info - deployment of configuration descriptor c:\apache-tomee-plume-7.0.1\conf\catalina\localhost\crud.xml has finished in 5,938 ms info - deploying web application directory c:\apache-tomee-plume-7.0.1\webapps\docs info - ------------------------- localhost -> /docs info - configuring enterprise application: c:\apache-tomee-plume-7.0.1\webapps\docs info - enterprise application "c:\apache-tomee-plume-7.0.1\webapps\docs" loaded. info - assembling app: c:\apache-tomee-plume-7.0.1\webapps\docs info - deployed application(path=c:\apache-tomee-plume-7.0.1\webapps\docs) info - @ least 1 jar scanned tlds yet contained no tlds. enable debug logging logger complete list of jars scanned no tlds found in them. skipping unneeded jars during scanning can improve startup time , jsp compilation time. info - deployment of web application directory c:\apache-tomee-plume-7.0.1\webapps\docs has finished in 187 ms info - deploying web application directory c:\apache-tomee-plume-7.0.1\webapps\host-manager info - ------------------------- localhost -> /host-manager info - configuring enterprise application: c:\apache-tomee-plume-7.0.1\webapps\host-manager info - enterprise application "c:\apache-tomee-plume-7.0.1\webapps\host-manager" loaded. info - assembling app: c:\apache-tomee-plume-7.0.1\webapps\host-manager info - using context file c:\apache-tomee-plume-7.0.1\webapps\host-manager\meta-inf\context.xml info - deployed application(path=c:\apache-tomee-plume-7.0.1\webapps\host-manager) info - @ least 1 jar scanned tlds yet contained no tlds. enable debug logging logger complete list of jars scanned no tlds found in them. skipping unneeded jars during scanning can improve startup time , jsp compilation time. info - deployment of web application directory c:\apache-tomee-plume-7.0.1\webapps\host-manager has finished in 203 ms info - deploying web application directory c:\apache-tomee-plume-7.0.1\webapps\manager info - ------------------------- localhost -> /manager info - configuring enterprise application: c:\apache-tomee-plume-7.0.1\webapps\manager info - enterprise application "c:\apache-tomee-plume-7.0.1\webapps\manager" loaded. info - assembling app: c:\apache-tomee-plume-7.0.1\webapps\manager info - using context file c:\apache-tomee-plume-7.0.1\webapps\manager\meta-inf\context.xml info - deployed application(path=c:\apache-tomee-plume-7.0.1\webapps\manager) info - @ least 1 jar scanned tlds yet contained no tlds. enable debug logging logger complete list of jars scanned no tlds found in them. skipping unneeded jars during scanning can improve startup time , jsp compilation time. info - deployment of web application directory c:\apache-tomee-plume-7.0.1\webapps\manager has finished in 172 ms info - deploying web application directory c:\apache-tomee-plume-7.0.1\webapps\root info - ------------------------- localhost -> / info - configuring enterprise application: c:\apache-tomee-plume-7.0.1\webapps\root info - enterprise application "c:\apache-tomee-plume-7.0.1\webapps\root" loaded. info - assembling app: c:\apache-tomee-plume-7.0.1\webapps\root info - deployed application(path=c:\apache-tomee-plume-7.0.1\webapps\root) info - @ least 1 jar scanned tlds yet contained no tlds. enable debug logging logger complete list of jars scanned no tlds found in them. skipping unneeded jars during scanning can improve startup time , jsp compilation time. info - deployment of web application directory c:\apache-tomee-plume-7.0.1\webapps\root has finished in 156 ms info - starting protocolhandler [http-nio-8080] info - starting protocolhandler [ajp-nio-8009] info - server startup in 6750 ms 

error stack:

07-sep-2016 13:17:05.337 severe [http-nio-8080-exec-7] org.apache.catalina.core.standardwrappervalve.invoke servlet.service() servlet [jersey web application] in context path [/crud] threw exception [java.lang.nullpointerexception] root cause  java.lang.nullpointerexception     @ com.kuba.crud.resources.customerresource.getcustomers(customerresource.java:37)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     @ java.lang.reflect.method.invoke(method.java:498)     @ org.glassfish.jersey.server.model.internal.resourcemethodinvocationhandlerfactory$1.invoke(resourcemethodinvocationhandlerfactory.java:81)     @ org.glassfish.jersey.server.model.internal.abstractjavaresourcemethoddispatcher$1.run(abstractjavaresourcemethoddispatcher.java:144)     @ org.glassfish.jersey.server.model.internal.abstractjavaresourcemethoddispatcher.invoke(abstractjavaresourcemethoddispatcher.java:161)     @ org.glassfish.jersey.server.model.internal.javaresourcemethoddispatcherprovider$typeoutinvoker.dodispatch(javaresourcemethoddispatcherprovider.java:205)     @ org.glassfish.jersey.server.model.internal.abstractjavaresourcemethoddispatcher.dispatch(abstractjavaresourcemethoddispatcher.java:99)     @ org.glassfish.jersey.server.model.resourcemethodinvoker.invoke(resourcemethodinvoker.java:389)     @ org.glassfish.jersey.server.model.resourcemethodinvoker.apply(resourcemethodinvoker.java:347)     @ org.glassfish.jersey.server.model.resourcemethodinvoker.apply(resourcemethodinvoker.java:102)     @ org.glassfish.jersey.server.serverruntime$2.run(serverruntime.java:326)     @ org.glassfish.jersey.internal.errors$1.call(errors.java:271)     @ org.glassfish.jersey.internal.errors$1.call(errors.java:267)     @ org.glassfish.jersey.internal.errors.process(errors.java:315)     @ org.glassfish.jersey.internal.errors.process(errors.java:297)     @ org.glassfish.jersey.internal.errors.process(errors.java:267)     @ org.glassfish.jersey.process.internal.requestscope.runinscope(requestscope.java:317)     @ org.glassfish.jersey.server.serverruntime.process(serverruntime.java:305)     @ org.glassfish.jersey.server.applicationhandler.handle(applicationhandler.java:1154)     @ org.glassfish.jersey.servlet.webcomponent.serviceimpl(webcomponent.java:473)     @ org.glassfish.jersey.servlet.webcomponent.service(webcomponent.java:427)     @ org.glassfish.jersey.servlet.servletcontainer.service(servletcontainer.java:388)     @ org.glassfish.jersey.servlet.servletcontainer.service(servletcontainer.java:341)     @ org.glassfish.jersey.servlet.servletcontainer.service(servletcontainer.java:228)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:230)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:165)     @ org.apache.tomee.webservices.cxfjaxrsfilter.dofilter(cxfjaxrsfilter.java:83)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:192)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:165)     @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:192)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:165)     @ org.apache.openejb.server.httpd.eefilter.dofilter(eefilter.java:65)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:192)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:165)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:198)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:108)     @ org.apache.tomee.catalina.openejbvalve.invoke(openejbvalve.java:44)     @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:522)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:140)     @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79)     @ org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:620)     @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:87)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:349)     @ org.apache.coyote.http11.http11processor.service(http11processor.java:1110)     @ org.apache.coyote.abstractprocessorlight.process(abstractprocessorlight.java:66)     @ org.apache.coyote.abstractprotocol$connectionhandler.process(abstractprotocol.java:785)     @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1425)     @ org.apache.tomcat.util.net.socketprocessorbase.run(socketprocessorbase.java:52)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617)     @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61)     @ java.lang.thread.run(thread.java:745) 

first of remove javax.persistence.jdbc. properties , configure localdb in conf/tomee.xml datasource configuration belongs to.

then npe think lookup name reference @ injection point not right, remove name, if type enough injection no need precise it


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -