You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Nick Mpallas <mp...@upstreamsystems.com> on 2009/06/05 17:31:32 UTC

EjbModule fail to validate

 Hi all,
 i have a maven project and i want to use openejb for unit testing
 purposes.I have a META-INF/ with persistence.xml and ejb-jar.xml file
 with the ejb that i want the container to load.The container creates the
 classpath.ear project correctly but fails to deploy the ear file with
 the error(i have set VERBOSE level log):
 INFO - openejb.home
 =
 /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/src/main/reso
urces INFO - openejb.base
 =
 /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/src/main/reso
urces INFO - Configuring Service(id=Default Security Service,
 type=SecurityService, provider-id=Default Security Service)
 INFO - Configuring Service(id=Default Transaction Manager,
 type=TransactionManager, provider-id=Default Transaction Manager)
 INFO - Found EjbModule in
 classpath:
 /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/target/classe
s INFO - Beginning
 load:
 /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/target/classe
s INFO - Configuring enterprise application: classpath.ear
 INFO - Configuring Service(id=Default Stateless Container,
 type=Container, provider-id=Default Stateless Container)
 INFO - Auto-creating a container for bean MPersistenceController:
 Container(type=STATELESS, id=Default Stateless Container)
 INFO - Configuring PersistenceUnit(name=ref-app-pu,
 provider=org.hibernate.ejb.HibernatePersistence)
 INFO - Configuring Service(id=Default JDBC Database, type=Resource,
 provider-id=Default JDBC Database)
 INFO - Auto-creating a Resource with id 'Default JDBC Database' of type
 'DataSource for 'ref-app-pu'.
 INFO - Configuring Service(id=Default Unmanaged JDBC Database,
 type=Resource, provider-id=Default Unmanaged JDBC Database)
 INFO - Auto-creating a Resource with id 'Default Unmanaged JDBC
 Database' of type 'DataSource for 'ref-app-pu'.
 INFO - Adjusting ref-app-pu <jta-data-source> to 'Default JDBC Database'
 INFO - Adjusting ref-app-pu <non-jta-data-source> to 'Default Unmanaged
 JDBC Database'
 ERROR - FAIL ... MPersistenceController:      The <local> element of the
 ejb-jar.xml is for interfaces extending javax.ejb.EJBLocalObject.  If
 this interface is intended to be an EJB 3.0 business local view, declare
 this interface as
 <business-local>com.upstreamsystems.mint.core.PersistenceControllerLocal</b
usiness-local> or via the @Local annotation on the bean class or interface
 class. ERROR - Invalid
 EjbModule(path=/home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtest
s/target/classes) WARN - Jar not loaded. classpath.ear.  Module failed
 validation.
 AppModule(path=classpath.ear)

 I can't figure out what's wrong with the validation of the
 classpath.ear!!!I am stuck with it the last 2 days.

 regards
Nick
-- 
"To err is human,to forgive beyond the scope of an operating system"
\n\

Re: EjbModule fail to validate

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi Nick...

  For looking-up EJB(s) from an embedded OpenEJB containers you should
use org.apache.openejb.client.LocalInitialContextFactory. Take a look
at this example
http://openejb.apache.org/3.0/simple-stateless-example.html . For the
list of examples we have on our site take a look at this link
http://openejb.apache.org/OPENEJB/examples.html .

On Fri, Jun 5, 2009 at 7:16 PM, Nick Mpallas<mp...@upstreamsystems.com> wrote:
> Problem is solved...but when i do new InitailContext to look up my bean now i
> get the error: javax.naming.NoInitialContextException: Need to specify class
> name in environment or system property, or as an applet parameter, or in an
> application resource file:  java.naming.factory.initial.Obviously i am losing
> the way to obtain the ejb correctly from the embedded container.Any
> suggestions apart from the RTFM!
>
> thanks
>
>
> On Friday 05 June 2009 18:31:32 Nick Mpallas wrote:
>>  Hi all,
>>  i have a maven project and i want to use openejb for unit testing
>>  purposes.I have a META-INF/ with persistence.xml and ejb-jar.xml file
>>  with the ejb that i want the container to load.The container creates the
>>  classpath.ear project correctly but fails to deploy the ear file with
>>  the error(i have set VERBOSE level log):
>>  INFO - openejb.home
>>  =
>>
>> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/src/main/reso
>> urces INFO - openejb.base
>>  =
>>
>> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/src/main/reso
>> urces INFO - Configuring Service(id=Default Security Service,
>>  type=SecurityService, provider-id=Default Security Service)
>>  INFO - Configuring Service(id=Default Transaction Manager,
>>  type=TransactionManager, provider-id=Default Transaction Manager)
>>  INFO - Found EjbModule in
>>  classpath:
>>
>> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/target/classe
>> s INFO - Beginning
>>  load:
>>
>> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/target/classe
>> s INFO - Configuring enterprise application: classpath.ear
>>  INFO - Configuring Service(id=Default Stateless Container,
>>  type=Container, provider-id=Default Stateless Container)
>>  INFO - Auto-creating a container for bean MPersistenceController:
>>  Container(type=STATELESS, id=Default Stateless Container)
>>  INFO - Configuring PersistenceUnit(name=ref-app-pu,
>>  provider=org.hibernate.ejb.HibernatePersistence)
>>  INFO - Configuring Service(id=Default JDBC Database, type=Resource,
>>  provider-id=Default JDBC Database)
>>  INFO - Auto-creating a Resource with id 'Default JDBC Database' of type
>>  'DataSource for 'ref-app-pu'.
>>  INFO - Configuring Service(id=Default Unmanaged JDBC Database,
>>  type=Resource, provider-id=Default Unmanaged JDBC Database)
>>  INFO - Auto-creating a Resource with id 'Default Unmanaged JDBC
>>  Database' of type 'DataSource for 'ref-app-pu'.
>>  INFO - Adjusting ref-app-pu <jta-data-source> to 'Default JDBC Database'
>>  INFO - Adjusting ref-app-pu <non-jta-data-source> to 'Default Unmanaged
>>  JDBC Database'
>>  ERROR - FAIL ... MPersistenceController:      The <local> element of the
>>  ejb-jar.xml is for interfaces extending javax.ejb.EJBLocalObject.  If
>>  this interface is intended to be an EJB 3.0 business local view, declare
>>  this interface as
>>
>> <business-local>com.upstreamsystems.mint.core.PersistenceControllerLocal</b
>> usiness-local> or via the @Local annotation on the bean class or interface
>> class. ERROR - Invalid
>>
>> EjbModule(path=/home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtest
>> s/target/classes) WARN - Jar not loaded. classpath.ear.  Module failed
>> validation.
>>  AppModule(path=classpath.ear)
>>
>>  I can't figure out what's wrong with the validation of the
>>  classpath.ear!!!I am stuck with it the last 2 days.
>>
>>  regards
>> Nick
>
> --
>
> "To err is human,to forgive beyond the scope of an operating system"
> \n\
>



-- 
----
Thanks
- Mohammad Nour
- LinkedIn: http://www.linkedin.com/in/mnour
----
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

Re: EjbModule fail to validate

Posted by Nick Mpallas <mp...@upstreamsystems.com>.
Problem is solved...but when i do new InitailContext to look up my bean now i 
get the error: javax.naming.NoInitialContextException: Need to specify class 
name in environment or system property, or as an applet parameter, or in an 
application resource file:  java.naming.factory.initial.Obviously i am losing 
the way to obtain the ejb correctly from the embedded container.Any 
suggestions apart from the RTFM!

thanks


On Friday 05 June 2009 18:31:32 Nick Mpallas wrote:
>  Hi all,
>  i have a maven project and i want to use openejb for unit testing
>  purposes.I have a META-INF/ with persistence.xml and ejb-jar.xml file
>  with the ejb that i want the container to load.The container creates the
>  classpath.ear project correctly but fails to deploy the ear file with
>  the error(i have set VERBOSE level log):
>  INFO - openejb.home
>  =
> 
> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/src/main/reso
> urces INFO - openejb.base
>  =
> 
> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/src/main/reso
> urces INFO - Configuring Service(id=Default Security Service,
>  type=SecurityService, provider-id=Default Security Service)
>  INFO - Configuring Service(id=Default Transaction Manager,
>  type=TransactionManager, provider-id=Default Transaction Manager)
>  INFO - Found EjbModule in
>  classpath:
> 
> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/target/classe
> s INFO - Beginning
>  load:
> 
> /home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtests/target/classe
> s INFO - Configuring enterprise application: classpath.ear
>  INFO - Configuring Service(id=Default Stateless Container,
>  type=Container, provider-id=Default Stateless Container)
>  INFO - Auto-creating a container for bean MPersistenceController:
>  Container(type=STATELESS, id=Default Stateless Container)
>  INFO - Configuring PersistenceUnit(name=ref-app-pu,
>  provider=org.hibernate.ejb.HibernatePersistence)
>  INFO - Configuring Service(id=Default JDBC Database, type=Resource,
>  provider-id=Default JDBC Database)
>  INFO - Auto-creating a Resource with id 'Default JDBC Database' of type
>  'DataSource for 'ref-app-pu'.
>  INFO - Configuring Service(id=Default Unmanaged JDBC Database,
>  type=Resource, provider-id=Default Unmanaged JDBC Database)
>  INFO - Auto-creating a Resource with id 'Default Unmanaged JDBC
>  Database' of type 'DataSource for 'ref-app-pu'.
>  INFO - Adjusting ref-app-pu <jta-data-source> to 'Default JDBC Database'
>  INFO - Adjusting ref-app-pu <non-jta-data-source> to 'Default Unmanaged
>  JDBC Database'
>  ERROR - FAIL ... MPersistenceController:      The <local> element of the
>  ejb-jar.xml is for interfaces extending javax.ejb.EJBLocalObject.  If
>  this interface is intended to be an EJB 3.0 business local view, declare
>  this interface as
> 
> <business-local>com.upstreamsystems.mint.core.PersistenceControllerLocal</b
> usiness-local> or via the @Local annotation on the bean class or interface
> class. ERROR - Invalid
> 
> EjbModule(path=/home/nmpallas/dev/workplace-testng/mint_tesng/commons/mtest
> s/target/classes) WARN - Jar not loaded. classpath.ear.  Module failed
> validation.
>  AppModule(path=classpath.ear)
>
>  I can't figure out what's wrong with the validation of the
>  classpath.ear!!!I am stuck with it the last 2 days.
>
>  regards
> Nick

-- 

"To err is human,to forgive beyond the scope of an operating system"
\n\