tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Karsten.O...@t-systems.com>
Subject RE: Cannot find @Stateless annotation in other module
Date Thu, 06 Mar 2008 08:12:08 GMT


Hello,

Sorry for the delay. Also with 3.0-SNAPSHOT I face with the same problem. 

Can it be a problem with asm? I had to manually include it. OpenEJB seems to be depending
on it.

		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm</artifactId>
			<version>2.2.3</version>
			<scope>test</scope>
		</dependency>

The initial context in my app I get with (I tried it without openejb.deployments.classpath.include
but it cannot find anything in this case.):

        Properties properties = new Properties();
        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");

        properties.setProperty("openejb.deployments.classpath.include",
                ".*(target|mock|target/classes|target/test-classes).*");
        // properties.setProperty("openejb.deployments.classpath.exclude", "");
        if (DB_MODE == MYSQL) {
            properties.setProperty("MySqlDatabase", "new://Resource?type=DataSource");
            properties.setProperty("MySqlDatabase.JdbcUrl", "jdbc:mysql://localhost:3306/tpg-server");
            properties.setProperty("MySqlDatabase.JdbcDriver", "com.mysql.jdbc.Driver");
            properties.setProperty("MySqlDatabase.UserName", "tpg");
            properties.setProperty("MySqlDatabase.Password", "tpg");
            properties.setProperty("MySqlDatabase.JtaManaged", "false");
        } else if (DB_MODE == DERBY) {
            properties.setProperty("DerbyDatabase", "new://Resource?type=DataSource");
            properties.setProperty("DerbyDatabase.JdbcUrl", "jdbc:derby:derbyDB;create=true");
            properties.setProperty("DerbyDatabase.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
            properties.setProperty("DerbyDatabase.JtaManaged", "false");
        }

        InitialContext initialContext = new InitialContext(properties);

Here is the output:

Apache OpenEJB 3.0-SNAPSHOT    build: 20080305-05:39
http://openejb.apache.org/
INFO - openejb.home = C:\workspace\tpg-server\p3-server\p3-core\target
INFO - openejb.base = C:\workspace\tpg-server\p3-server\p3-core\target
INFO - Configuring Service(id=Default Security Service, type=SecurityService, pr ovider-id=Default
Security Service) INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManag
er, provider-id=Default Transaction Manager) INFO - Configuring Service(id=MySqlDatabase,
type=Resource, provider-id=Default JDBC Database) INFO - Configuring Service(id=Default JDK
1.3 ProxyFactory, type=ProxyFactory, p rovider-id=Default JDK 1.3 ProxyFactory) INFO - Found
EjbModule in classpath: C:\Dokumente%20und%20Einstellungen\koh\.m2\
repository\tpg\pattern-management\pattern-management-api\0.4-SNAPSHOT\pattern-ma
nagement-api-0.4-SNAPSHOT-mock.jar
INFO - Found EjbModule in classpath: C:\workspace\tpg-server\p3-server\p3-core\t
arget\classes
INFO - Found EjbModule in classpath: C:\Dokumente%20und%20Einstellungen\koh\.m2\
repository\tpg\networkstorage-management\networkstorage-management-api\0.2-SNAPS
HOT\networkstorage-management-api-0.2-SNAPSHOT-mock.jar
INFO - Configuring app: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tp
g\pattern-management\pattern-management-api\0.4-SNAPSHOT\pattern-management-api-
0.4-SNAPSHOT-mock.jar
WARN - Unable to scrape for @Stateful, @Stateless or @MessageDriven annotations.
 Invalid EjbModule URL: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tp
g\pattern-management\pattern-management-api\0.4-SNAPSHOT\pattern-management-api-
0.4-SNAPSHOT-mock.jar
INFO - Loaded Module: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tpg\
pattern-management\pattern-management-api\0.4-SNAPSHOT\pattern-management-api-0.
4-SNAPSHOT-mock.jar
INFO - Configuring app: C:\workspace\tpg-server\p3-server\p3-core\target\classes

INFO - Configuring Service(id=Default Stateless Container, type=Container, provi der-id=Default
Stateless Container) INFO - Auto-creating a container for bean ClientDaoImpl: Container(type=STATELES
S, id=Default Stateless Container) INFO - Configuring PersistenceUnit(name=P3ServerPersistenceUnit,
provider=org.hi
bernate.ejb.HibernatePersistence)
INFO - Auto-creating a Resource with id 'MySqlDatabaseJta' of type 'DataSource f or 'P3ServerPersistenceUnit'.
INFO - Configuring Service(id=MySqlDatabaseJta, type=Resource, provider-id=MySql
Database)
INFO - Adjusting P3ServerPersistenceUnit <jta-data-source> to 'MySqlDatabaseJta'

INFO - Adjusting P3ServerPersistenceUnit <non-jta-data-source> to 'MySqlDatabase '
WARN - Cannot find bean "de.mms_dresden.ppp.server.service.impl.FormServiceImpl/
patternService" referenced by bean "FormServiceImpl" with ejb-link "null".
WARN - Cannot find bean "de.mms_dresden.ppp.server.service.impl.FormServiceImpl/
networkStorageService" referenced by bean "FormServiceImpl" with ejb-link "Netwo rkStorageServiceImpl".
INFO - Loaded Module: C:\workspace\tpg-server\p3-server\p3-core\target\classes
INFO - Configuring app: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tp
g\networkstorage-management\networkstorage-management-api\0.2-SNAPSHOT\networkst
orage-management-api-0.2-SNAPSHOT-mock.jar
WARN - Unable to scrape for @Stateful, @Stateless or @MessageDriven annotations.
 Invalid EjbModule URL: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tp
g\networkstorage-management\networkstorage-management-api\0.2-SNAPSHOT\networkst
orage-management-api-0.2-SNAPSHOT-mock.jar
INFO - Loaded Module: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tpg\
networkstorage-management\networkstorage-management-api\0.2-SNAPSHOT\networkstor
age-management-api-0.2-SNAPSHOT-mock.jar
WARN - Property "ConnectionProperties" not supported by "MySqlDatabase"
WARN - Property "ConnectionProperties" not supported by "MySqlDatabaseJta"
INFO - Assembling app: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tpg
\pattern-management\pattern-management-api\0.4-SNAPSHOT\pattern-management-api-0
.4-SNAPSHOT-mock.jar
INFO - Deployed Application(path=C:\Dokumente%20und%20Einstellungen\koh\.m2\repo
sitory\tpg\pattern-management\pattern-management-api\0.4-SNAPSHOT\pattern-manage
ment-api-0.4-SNAPSHOT-mock.jar)
INFO - Assembling app: C:\workspace\tpg-server\p3-server\p3-core\target\classes
INFO - PersistenceUnit(name=P3ServerPersistenceUnit, provider=org.hibernate.ejb.
HibernatePersistence)
INFO - Jndi(name=ClientDaoImplRemote) --> Ejb(deployment-id=ClientDaoImpl) INFO - Jndi(name=FormDaoImplLocal)
--> Ejb(deployment-id=FormDaoImpl) INFO - Jndi(name=PenDaoImplRemote) --> Ejb(deployment-id=PenDaoImpl)
INFO - Jndi(name=RequestDaoImplRemote) --> Ejb(deployment-id=RequestDaoImpl) INFO - Jndi(name=ShopDaoImplRemote)
--> Ejb(deployment-id=ShopDaoImpl) INFO - Jndi(name=UserDaoImplLocal) --> Ejb(deployment-id=UserDaoImpl)
INFO - Jndi(name=KVDReceiverFacadeImplRemote) --> Ejb(deployment-id=KVDReceiverF
acadeImpl)
INFO - Jndi(name=PenReceiverFacadeImplRemote) --> Ejb(deployment-id=PenReceiverF
acadeImpl)
INFO - Jndi(name=EncryptionManagementServiceImplLocal) --> Ejb(deployment-id=Enc
ryptionManagementServiceImpl)
INFO - Jndi(name=FormServiceImplLocal) --> Ejb(deployment-id=FormServiceImpl)
INFO - Jndi(name=KVDManagementServiceImplLocal) --> Ejb(deployment-id=KVDManagem
entServiceImpl)
INFO - Jndi(name=PenManagementServiceImplLocal) --> Ejb(deployment-id=PenManagem
entServiceImpl)
INFO - Jndi(name=PenRequestServiceImplLocal) --> Ejb(deployment-id=PenRequestSer
viceImpl)
INFO - Jndi(name=StrokeEngineServiceImplLocal) --> Ejb(deployment-id=StrokeEngin
eServiceImpl)
INFO - Created Ejb(deployment-id=ClientDaoImpl, ejb-name=ClientDaoImpl, containe r=Default
Stateless Container) INFO - Created Ejb(deployment-id=FormDaoImpl, ejb-name=FormDaoImpl, container=De
fault Stateless Container) INFO - Created Ejb(deployment-id=PenDaoImpl, ejb-name=PenDaoImpl,
container=Defa ult Stateless Container) INFO - Created Ejb(deployment-id=RequestDaoImpl, ejb-name=RequestDaoImpl,
contai ner=Default Stateless Container) INFO - Created Ejb(deployment-id=ShopDaoImpl, ejb-name=ShopDaoImpl,
container=De fault Stateless Container) INFO - Created Ejb(deployment-id=UserDaoImpl, ejb-name=UserDaoImpl,
container=De fault Stateless Container) INFO - Created Ejb(deployment-id=KVDReceiverFacadeImpl,
ejb-name=KVDReceiverFaca deImpl, container=Default Stateless Container) INFO - Created Ejb(deployment-id=PenReceiverFacadeImpl,
ejb-name=PenReceiverFaca deImpl, container=Default Stateless Container) INFO - Created Ejb(deployment-id=EncryptionManagementServiceImpl,
ejb-name=Encry ptionManagementServiceImpl, container=Default Stateless Container) INFO - Created
Ejb(deployment-id=FormServiceImpl, ejb-name=FormServiceImpl, cont ainer=Default Stateless
Container) INFO - Created Ejb(deployment-id=KVDManagementServiceImpl, ejb-name=KVDManagemen
tServiceImpl, container=Default Stateless Container) INFO - Created Ejb(deployment-id=PenManagementServiceImpl,
ejb-name=PenManagemen tServiceImpl, container=Default Stateless Container) INFO - Created
Ejb(deployment-id=PenRequestServiceImpl, ejb-name=PenRequestServi ceImpl, container=Default
Stateless Container) INFO - Created Ejb(deployment-id=StrokeEngineServiceImpl, ejb-name=StrokeEngineS
erviceImpl, container=Default Stateless Container) INFO - Deployed Application(path=C:\workspace\tpg-server\p3-server\p3-core\targe
t\classes)
INFO - Assembling app: C:\Dokumente%20und%20Einstellungen\koh\.m2\repository\tpg
\networkstorage-management\networkstorage-management-api\0.2-SNAPSHOT\networksto
rage-management-api-0.2-SNAPSHOT-mock.jar
INFO - Deployed Application(path=C:\Dokumente%20und%20Einstellungen\koh\.m2\repo
sitory\tpg\networkstorage-management\networkstorage-management-api\0.2-SNAPSHOT\
networkstorage-management-api-0.2-SNAPSHOT-mock.jar)
INFO - OpenEJB ready.
OpenEJB ready.

Thanks,
Karsten

> -----Urspr√ľngliche Nachricht-----
> Von: David Blevins [mailto:david.blevins@visi.com]
> Gesendet: Mittwoch, 27. Februar 2008 21:17
> An: users@openejb.apache.org
> Betreff: Re: Cannot find @Stateless annotation in other module
> 
> 
> On Feb 26, 2008, at 9:48 AM, <Karsten.Ohme@t-systems.com> 
> <Karsten.Ohme@t-systems.com  > wrote:
> 
> > Hi,
> >
> > I have a working thanks to the help of you a working test. I use 
> > TestNG now. Now I use in my bean a reference with @EJB
> annotation to
> > another bean in another module. The behaviour of the
> detected modules
> > when I use the include and exclude properties is strange.
> > Also when I place an empty ejb-jar.xml in the META-INF directory it 
> > has problems to find the beans. When I go the hard way and include 
> > everything with include=.* and exclude="" I would expect
> that the bean
> > must be found, but I get disappointed.
> > Anyway, it works somehow in the current configuration, but although 
> > the bean which should be injected in the @EJB field has a
> @Stateless
> > annotation OpenEJB complains what in cannot find any @Stateless, 
> > @Stateful, ... annotation. What could be the reason?
> 
> Jack had the same issue with @EJB references between modules. 
>  We added a few features in this area just this weekend in fact.  You 
> can try out the new referencing ability by updating your pom.xml to 
> openejb version 3.0-SNAPSHOT and adding 
> http://people.apache.org/repo/m2-snapshot-repository/
>   as a snapshot enabled repository.
> 
> You definitely shouldn't get the "@Stateless, @Stateful...annotation"
> warning under normal circumstances.  Can you send the full log output?
> 
> > By the way I have found differences in the behaviour
> between OpenJPA
> > and Hibernate. Named native SQL queries with parameters in OpenJPA 
> > must be set by index, in Hibernate by name. Is this incompatibility 
> > intentional?
> 
> I don't think any incompatibility is intentional.  OpenJPA has it's 
> compatibility certification and Hibernate has yet to pass the
> tests.   
> There's no guarantee that this part is actually tested, so I couldn't 
> say for sure who is doing it right.
> 
> -David
> 
> 

> -----Urspr√ľngliche Nachricht-----
> Von: David Blevins [mailto:david.blevins@visi.com] 
> Gesendet: Mittwoch, 27. Februar 2008 21:17
> An: users@openejb.apache.org
> Betreff: Re: Cannot find @Stateless annotation in other module
> 
> 
> On Feb 26, 2008, at 9:48 AM, <Karsten.Ohme@t-systems.com> 
> <Karsten.Ohme@t-systems.com  > wrote:
> 
> > Hi,
> >
> > I have a working thanks to the help of you a working test. I use 
> > TestNG now. Now I use in my bean a reference with @EJB 
> annotation to 
> > another bean in another module. The behaviour of the 
> detected modules 
> > when I use the include and exclude properties is strange.
> > Also when I place an empty ejb-jar.xml in the META-INF directory it 
> > has problems to find the beans. When I go the hard way and include 
> > everything with include=.* and exclude="" I would expect 
> that the bean 
> > must be found, but I get disappointed.
> > Anyway, it works somehow in the current configuration, but although 
> > the bean which should be injected in the @EJB field has a 
> @Stateless 
> > annotation OpenEJB complains what in cannot find any @Stateless, 
> > @Stateful, ... annotation. What could be the reason?
> 
> Jack had the same issue with @EJB references between modules. 
>  We added a few features in this area just this weekend in 
> fact.  You can try out the new referencing ability by 
> updating your pom.xml to openejb version 3.0-SNAPSHOT and 
> adding http://people.apache.org/repo/m2-snapshot-repository/
>   as a snapshot enabled repository.
> 
> You definitely shouldn't get the "@Stateless, 
> @Stateful...annotation"  
> warning under normal circumstances.  Can you send the full log output?
> 
> > By the way I have found differences in the behaviour 
> between OpenJPA 
> > and Hibernate. Named native SQL queries with parameters in OpenJPA 
> > must be set by index, in Hibernate by name. Is this incompatibility 
> > intentional?
> 
> I don't think any incompatibility is intentional.  OpenJPA has it's  
> compatibility certification and Hibernate has yet to pass the 
> tests.   
> There's no guarantee that this part is actually tested, so I 
> couldn't say for sure who is doing it right.
> 
> -David
> 
> 

Mime
View raw message