You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Christian Eugster <ch...@gmx.net> on 2012/12/19 18:14:14 UTC

Enterprise OSGi fancyfoods Tutorial

Hi,

I am working through the fancyfoods tutorial of Enterprise OSGi in 
Action. Up to the fancyfoods.persistence bundle I finally have worked 
through.  I am using the karaf 2.3.0 environment. When I install the 
fancyfoods.persistence bundle I get the message

2012-12-19 17:59:31,442 | INFO  | rint Extender: 3 | 
BlueprintContainerImpl           | container.BlueprintContainerImpl  330 
| 7 - org.apache.aries.blueprint.core - 1.0.1 | Bundle 
fancyfoods.persistence is waiting for dependencies 
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=fancyfoods))(objectClass=javax.persistence.EntityManagerFactory))]

the karaf features:list shows as follows:

karaf@root> features:list
State         Version           Name Repository             Description
[installed  ] [1.0.1          ] transaction karaf-enterprise-2.3.0 OSGi 
Transaction Manager
[installed  ] [1.0.1          ] jpa karaf-enterprise-2.3.0 OSGi 
Persistence Container
[installed  ] [1.0.0          ] jndi karaf-enterprise-2.3.0 OSGi Service 
Registry JNDI access
[uninstalled] [1.0.0          ] application-without-isolation 
karaf-enterprise-2.3.0 Provide EBA archive support
[installed  ] [2.3.0          ] karaf-framework karaf-2.3.0            
Karaf core feature
[uninstalled] [2.5.6.SEC03    ] spring karaf-2.3.0            Spring support
[uninstalled] [2.5.6.SEC03    ] spring-web karaf-2.3.0            Spring 
2 Web support
[uninstalled] [3.0.7.RELEASE  ] spring karaf-2.3.0            Spring support
[uninstalled] [3.0.7.RELEASE  ] spring-aspects karaf-2.3.0            
Spring AOP support
[uninstalled] [1.2.1          ] spring-dm karaf-2.3.0            Spring 
DM support
[uninstalled] [1.2.1          ] spring-dm-web karaf-2.3.0            
Spring DM Web Support
[uninstalled] [3.0.7.RELEASE  ] spring-instrument karaf-2.3.0            
Spring Instrument support
[uninstalled] [3.0.7.RELEASE  ] spring-jdbc karaf-2.3.0            
Spring JDBC support
[uninstalled] [3.0.7.RELEASE  ] spring-jms karaf-2.3.0            Spring 
JMS support
[uninstalled] [3.0.7.RELEASE  ] spring-struts karaf-2.3.0            
Spring Struts support
[uninstalled] [3.0.7.RELEASE  ] spring-test karaf-2.3.0            
Spring Test support
[uninstalled] [3.0.7.RELEASE  ] spring-orm karaf-2.3.0            Spring 
ORM support
[uninstalled] [3.0.7.RELEASE  ] spring-oxm karaf-2.3.0            Spring 
OXM support
[uninstalled] [3.0.7.RELEASE  ] spring-tx karaf-2.3.0            Spring 
Transaction (TX) support
[uninstalled] [3.0.7.RELEASE  ] spring-web karaf-2.3.0            Spring 
Web support
[uninstalled] [3.0.7.RELEASE  ] spring-web-portlet 
karaf-2.3.0            Spring Web Portlet support
[uninstalled] [3.1.2.RELEASE  ] spring31 karaf-2.3.0            Spring 
3.1 support
[uninstalled] [3.1.2.RELEASE  ] spring31-aspects karaf-2.3.0            
Spring 3.1 AOP support
[uninstalled] [3.1.2.RELEASE  ] spring31-instrument 
karaf-2.3.0            Spring 3.1 Instrument support
[uninstalled] [3.1.2.RELEASE  ] spring31-jdbc karaf-2.3.0            
Spring 3.1 JDBC support
[uninstalled] [3.1.2.RELEASE  ] spring31-jms karaf-2.3.0            
Spring 3.1 JMS support
[uninstalled] [3.1.2.RELEASE  ] spring31-struts karaf-2.3.0            
Spring 3.1 Struts support
[uninstalled] [3.1.2.RELEASE  ] spring31-test karaf-2.3.0            
Spring 3.1 Test support
[uninstalled] [3.1.2.RELEASE  ] spring31-orm karaf-2.3.0            
Spring 3.1 ORM support
[uninstalled] [3.1.2.RELEASE  ] spring31-oxm karaf-2.3.0            
Spring 3.1 OXM support
[uninstalled] [3.1.2.RELEASE  ] spring31-tx karaf-2.3.0            
Spring 3.1 Transaction (TX) support
[uninstalled] [3.1.2.RELEASE  ] spring31-web karaf-2.3.0            
Spring 3.1 Web support
[uninstalled] [3.1.2.RELEASE  ] spring31-web-portlet 
karaf-2.3.0            Spring 3.1 Web Portlet support
[uninstalled] [2.3.0          ] wrapper karaf-2.3.0            Provide 
OS integration
[uninstalled] [2.3.0          ] obr karaf-2.3.0            Provide OSGi 
Bundle Repository (OBR) support
[uninstalled] [2.3.0          ] config karaf-2.3.0            Provide 
OSGi ConfigAdmin support
[installed  ] [7.6.7.v20120910] jetty karaf-2.3.0            Provide 
Jetty engine support
[installed  ] [2.3.0          ] http karaf-2.3.0            
Implementation of the OSGi HTTP service
[installed  ] [2.3.0          ] http-whiteboard karaf-2.3.0            
Provide HTTP Whiteboard pattern support
[uninstalled] [2.3.0          ] war karaf-2.3.0            Turn Karaf as 
a full WebContainer
[uninstalled] [2.3.0          ] kar karaf-2.3.0            Provide KAR 
(KARaf archive) support
[installed  ] [2.3.0          ] webconsole-base karaf-2.3.0            
Base support of the Karaf WebConsole
[installed  ] [2.3.0          ] webconsole karaf-2.3.0            Karaf 
WebConsole for administration and monitoring
[uninstalled] [2.3.0          ] ssh karaf-2.3.0            Provide a 
SSHd server on Karaf
[uninstalled] [2.3.0          ] management karaf-2.3.0            
Provide a JMX MBeanServer and a set of MBeans in Karaf
[installed  ] [2.3.0          ] eventadmin karaf-2.3.0            OSGi 
Event Admin service specification for event-based communication
[uninstalled] [2.3.0          ] jasypt-encryption karaf-2.3.0            
Advanced encryption support for Karaf security
[installed  ] [2.3.0          ] scr karaf-2.3.0            Declarative 
Service support
[installed  ] [2.2.1          ] openjpa repo-0
[uninstalled] [1.4            ] commons-dbcp repo-0
karaf@root>

And the karaf command osgi:list:

karaf@root> osgi:list
START LEVEL 100 , List Threshold: 50
    ID   State         Blueprint      Level  Name
[  90] [Resolved   ] [            ] [   80] Commons DBCP (1.4)
[  91] [Active     ] [            ] [   80] Commons Pool (1.5.4)
[  92] [Active     ] [            ] [   80] Commons Lang (2.4)
[  93] [Active     ] [            ] [   80] Commons Collections (3.2.1)
[  94] [Active     ] [            ] [   80] Apache Geronimo JSR-317 JPA 
2.0 Spec API (1.1)
[  95] [Active     ] [            ] [   80] geronimo-jms_1.1_spec (1.1.1)
[  96] [Active     ] [            ] [   80] OpenJPA Aggregate Jar (2.2.1)
[ 131] [Active     ] [            ] [   80] Apache Derby 10.9 
(10.9.1000000.1344872)
[ 136] [Active     ] [Created     ] [   80] fancyfoods-ds-derby 
Blueprint Bundle (0.0.1.SNAPSHOT)
[ 143] [Active     ] [            ] [   80] fancyfoods.api Bundle (1.0.0)
[ 144] [Active     ] [Created     ] [   80] 
fancyfoods.department.chocolate Blueprint Bundle (1.0.0)
[ 145] [Active     ] [Created     ] [   80] fancyfoods.web Blueprint 
Bundle (1.0.0)
[ 146] [Active     ] [Created     ] [   80] fancyfoods.business 
Blueprint Bundle (1.0.0)
[ 147] [Active     ] [GracePeriod ] [   80] fancyfoods.department.cheese 
Blueprint Bundle (1.0.0)
[ 148] [Active     ] [GracePeriod ] [   80] fancyfoods.persistence 
Blueprint Bundle (1.0.0)
karaf@root>

Does anyone know what I am doing wrong or has any hint?

Thanks!

Christian

Re: Enterprise OSGi fancyfoods Tutorial

Posted by Christian Eugster <ch...@gmx.net>.
Hi Graham,

thank you for your answer.

I try to build the fancyfoods example again and again and I am failing. 
I build the example step by step as instructed in the book (once using 
karaf but also using the proposed container from the aries samples).

after installing the persistence bundle the console keeps saying:

osgi> [Blueprint Extender: 3] INFO 
org.apache.aries.blueprint.container.BlueprintContainerImpl - Bundle 
fancyfoods.persistence is waiting for dependencies 
[(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=fancyfoods))(objectClass=javax.persistence.EntityManagerFactory))]

I checked each detail against the book and against the configuration of 
the aries blog sample persistence bundle without finding any hints, 
while the build of the downloaded blog sample is working.

Where is my error and how can I find out, what is going wrong? Can you 
give me a hint?

Thank you!

Sincerly

Christian



Re: Enterprise OSGi fancyfoods Tutorial

Posted by Graham Charters <gc...@gmail.com>.
Hi Christian,

I was hoping someone with more knowledge that I was going to respond, but I
see there have been no comments, so I'll take a stab...

My apologies if you know all this already... The error is a result of
Blueprint timing out waiting for an EntityManagerFactory service.  That
service should be registered as a result of your persistence bundle being
processed.  A bundle being "Active" does not necessarily mean it's working
as you intended.  The JPA runtime (extender) will look for a
Meta-Persistence header in your persistence bundle and then try to process
the persistence.xml.  I believe that persistence XML also defines a
dependency on a data source, so if that is not configured correctly, that
can also cause the EntityManagerFactory to fail to be registered.

Have you looked for the EntityManagerFactory service in the console?

Regards, Graham.


On 19 December 2012 17:14, Christian Eugster <ch...@gmx.net>wrote:

>  Hi,
>
> I am working through the fancyfoods tutorial of Enterprise OSGi in Action.
> Up to the fancyfoods.persistence bundle I finally have worked through.  I
> am using the karaf 2.3.0 environment. When I install the
> fancyfoods.persistence bundle I get the message
>
> 2012-12-19 17:59:31,442 | INFO  | rint Extender: 3 |
> BlueprintContainerImpl           | container.BlueprintContainerImpl  330 |
> 7 - org.apache.aries.blueprint.core - 1.0.1 | Bundle fancyfoods.persistence
> is waiting for dependencies [(&(&(org.apache.aries.jpa.proxy.factory=true)(
> osgi.unit.name
> =fancyfoods))(objectClass=javax.persistence.EntityManagerFactory))]
>
> the karaf features:list shows as follows:
>
> karaf@root> features:list
> State         Version           Name
> Repository             Description
> [installed  ] [1.0.1          ] transaction
> karaf-enterprise-2.3.0 OSGi Transaction Manager
> [installed  ] [1.0.1          ] jpa
> karaf-enterprise-2.3.0 OSGi Persistence Container
> [installed  ] [1.0.0          ] jndi
> karaf-enterprise-2.3.0 OSGi Service Registry JNDI access
> [uninstalled] [1.0.0          ] application-without-isolation
> karaf-enterprise-2.3.0 Provide EBA archive support
> [installed  ] [2.3.0          ] karaf-framework
> karaf-2.3.0            Karaf core feature
> [uninstalled] [2.5.6.SEC03    ] spring
> karaf-2.3.0            Spring support
> [uninstalled] [2.5.6.SEC03    ] spring-web
> karaf-2.3.0            Spring 2 Web support
> [uninstalled] [3.0.7.RELEASE  ] spring
> karaf-2.3.0            Spring support
> [uninstalled] [3.0.7.RELEASE  ] spring-aspects
> karaf-2.3.0            Spring AOP support
> [uninstalled] [1.2.1          ] spring-dm
> karaf-2.3.0            Spring DM support
> [uninstalled] [1.2.1          ] spring-dm-web
> karaf-2.3.0            Spring DM Web Support
> [uninstalled] [3.0.7.RELEASE  ] spring-instrument
> karaf-2.3.0            Spring Instrument support
> [uninstalled] [3.0.7.RELEASE  ] spring-jdbc
> karaf-2.3.0            Spring JDBC support
> [uninstalled] [3.0.7.RELEASE  ] spring-jms
> karaf-2.3.0            Spring JMS support
> [uninstalled] [3.0.7.RELEASE  ] spring-struts
> karaf-2.3.0            Spring Struts support
> [uninstalled] [3.0.7.RELEASE  ] spring-test
> karaf-2.3.0            Spring Test support
> [uninstalled] [3.0.7.RELEASE  ] spring-orm
> karaf-2.3.0            Spring ORM support
> [uninstalled] [3.0.7.RELEASE  ] spring-oxm
> karaf-2.3.0            Spring OXM support
> [uninstalled] [3.0.7.RELEASE  ] spring-tx
> karaf-2.3.0            Spring Transaction (TX) support
> [uninstalled] [3.0.7.RELEASE  ] spring-web
> karaf-2.3.0            Spring Web support
> [uninstalled] [3.0.7.RELEASE  ] spring-web-portlet
> karaf-2.3.0            Spring Web Portlet support
> [uninstalled] [3.1.2.RELEASE  ] spring31
> karaf-2.3.0            Spring 3.1 support
> [uninstalled] [3.1.2.RELEASE  ] spring31-aspects
> karaf-2.3.0            Spring 3.1 AOP support
> [uninstalled] [3.1.2.RELEASE  ] spring31-instrument
> karaf-2.3.0            Spring 3.1 Instrument support
> [uninstalled] [3.1.2.RELEASE  ] spring31-jdbc
> karaf-2.3.0            Spring 3.1 JDBC support
> [uninstalled] [3.1.2.RELEASE  ] spring31-jms
> karaf-2.3.0            Spring 3.1 JMS support
> [uninstalled] [3.1.2.RELEASE  ] spring31-struts
> karaf-2.3.0            Spring 3.1 Struts support
> [uninstalled] [3.1.2.RELEASE  ] spring31-test
> karaf-2.3.0            Spring 3.1 Test support
> [uninstalled] [3.1.2.RELEASE  ] spring31-orm
> karaf-2.3.0            Spring 3.1 ORM support
> [uninstalled] [3.1.2.RELEASE  ] spring31-oxm
> karaf-2.3.0            Spring 3.1 OXM support
> [uninstalled] [3.1.2.RELEASE  ] spring31-tx
> karaf-2.3.0            Spring 3.1 Transaction (TX) support
> [uninstalled] [3.1.2.RELEASE  ] spring31-web
> karaf-2.3.0            Spring 3.1 Web support
> [uninstalled] [3.1.2.RELEASE  ] spring31-web-portlet
> karaf-2.3.0            Spring 3.1 Web Portlet support
> [uninstalled] [2.3.0          ] wrapper
> karaf-2.3.0            Provide OS integration
> [uninstalled] [2.3.0          ] obr
> karaf-2.3.0            Provide OSGi Bundle Repository (OBR) support
> [uninstalled] [2.3.0          ] config
> karaf-2.3.0            Provide OSGi ConfigAdmin support
> [installed  ] [7.6.7.v20120910] jetty
> karaf-2.3.0            Provide Jetty engine support
> [installed  ] [2.3.0          ] http
> karaf-2.3.0            Implementation of the OSGi HTTP service
> [installed  ] [2.3.0          ] http-whiteboard
> karaf-2.3.0            Provide HTTP Whiteboard pattern support
> [uninstalled] [2.3.0          ] war
> karaf-2.3.0            Turn Karaf as a full WebContainer
> [uninstalled] [2.3.0          ] kar
> karaf-2.3.0            Provide KAR (KARaf archive) support
> [installed  ] [2.3.0          ] webconsole-base
> karaf-2.3.0            Base support of the Karaf WebConsole
> [installed  ] [2.3.0          ] webconsole
> karaf-2.3.0            Karaf WebConsole for administration and monitoring
> [uninstalled] [2.3.0          ] ssh
> karaf-2.3.0            Provide a SSHd server on Karaf
> [uninstalled] [2.3.0          ] management
> karaf-2.3.0            Provide a JMX MBeanServer and a set of MBeans in
> Karaf
> [installed  ] [2.3.0          ] eventadmin
> karaf-2.3.0            OSGi Event Admin service specification for
> event-based communication
> [uninstalled] [2.3.0          ] jasypt-encryption
> karaf-2.3.0            Advanced encryption support for Karaf security
> [installed  ] [2.3.0          ] scr
> karaf-2.3.0            Declarative Service support
> [installed  ] [2.2.1          ] openjpa
> repo-0
> [uninstalled] [1.4            ] commons-dbcp
> repo-0
> karaf@root>
>
> And the karaf command osgi:list:
>
> karaf@root> osgi:list
> START LEVEL 100 , List Threshold: 50
>    ID   State         Blueprint      Level  Name
> [  90] [Resolved   ] [            ] [   80] Commons DBCP (1.4)
> [  91] [Active     ] [            ] [   80] Commons Pool (1.5.4)
> [  92] [Active     ] [            ] [   80] Commons Lang (2.4)
> [  93] [Active     ] [            ] [   80] Commons Collections (3.2.1)
> [  94] [Active     ] [            ] [   80] Apache Geronimo JSR-317 JPA
> 2.0 Spec API (1.1)
> [  95] [Active     ] [            ] [   80] geronimo-jms_1.1_spec (1.1.1)
> [  96] [Active     ] [            ] [   80] OpenJPA Aggregate Jar (2.2.1)
> [ 131] [Active     ] [            ] [   80] Apache Derby 10.9
> (10.9.1000000.1344872)
> [ 136] [Active     ] [Created     ] [   80] fancyfoods-ds-derby Blueprint
> Bundle (0.0.1.SNAPSHOT)
> [ 143] [Active     ] [            ] [   80] fancyfoods.api Bundle (1.0.0)
> [ 144] [Active     ] [Created     ] [   80]
> fancyfoods.department.chocolate Blueprint Bundle (1.0.0)
> [ 145] [Active     ] [Created     ] [   80] fancyfoods.web Blueprint
> Bundle (1.0.0)
> [ 146] [Active     ] [Created     ] [   80] fancyfoods.business Blueprint
> Bundle (1.0.0)
> [ 147] [Active     ] [GracePeriod ] [   80] fancyfoods.department.cheese
> Blueprint Bundle (1.0.0)
> [ 148] [Active     ] [GracePeriod ] [   80] fancyfoods.persistence
> Blueprint Bundle (1.0.0)
> karaf@root>
>
> Does anyone know what I am doing wrong or has any hint?
>
> Thanks!
>
> Christian
>