Re: Get environment variable

2012-08-27 Thread Charles Moulliard
This is what I have done. Thx.

On Fri, Aug 24, 2012 at 8:21 PM, Scott England-Sullivan sully6...@gmail.com
 wrote:

 Hi Charles,

 Kind of a hack but I believe you would have to pass the ENV in as a
 command line property using something like
 -Dopenshift.internal.ip=$OPENSHIFT_INTERNAL_IP.  Adding this to the
 /bin/karaf shell script and then set the following in the
 org.ops4j.pax.web.cfg: 
 org.ops4j.pax.web.listening.addresses=${openshift.internal.ip}.

 I just verified that this will do what you are looking for.

 Best Regards,
 Scott ES

 On Fri, Aug 24, 2012 at 2:07 AM, Charles Moulliard ch0...@gmail.comwrote:

 Hi,

 Karaf is deployed on a remote Unix machine where I need to get the
 following variable :  $OPENSHIFT_INTERNAL_IP which corresponds to this value

 [fabric-fuse.rhcloud.com fabric]\ printenv | grep OPENSHIFT_INTERNAL
 OPENSHIFT_INTERNAL_IP=127.6.51.129

 This variable has been added in the file org.ops4j.pax.web.cfg --
 org.ops4j.pax.web.listening.addresses=$OPENSHIFT_INTERNAL_IP

 but when Karaf boots, this value is not retrieved

 config:list

 karaf@root config:list | grep org.ops4j.pax.web
 Pid:org.ops4j.pax.web
 BundleLocation: mvn:org.ops4j.pax.web/pax-web-runtime/1.0.10
service.pid = org.ops4j.pax.web
felix.fileinstall.filename =
 file:/var/lib/stickshift/2ee23a78e9664b8593ebbc77e16aac38/app-root/runtime/fabric/etc/org.ops4j.pax.web.cfg
org.ops4j.pax.web.listening.addresses = $OPENSHIFT_INTERNAL_IP

 Is there a trick to resolve this enviroment variable ?

 Regards,
 --
 Charles Moulliard
 Apache Committer / Sr. Pr. Consultant at FuseSource.com
 Twitter : @cmoulliard
 Blog : http://cmoulliard.blogspot.com





 --
 --
 Scott England-Sullivan
 --
 FuseSource
 Web: http://www.fusesource.com
 Blog: http://sully6768.blogspot.com
 Twitter: sully6768




-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com


Re: Aries error: No transaction currently active

2012-08-27 Thread Christoph Gritschenberger
Hi,

There seems to be some race-condition in aries there. Something similar
has been reported previously [1] [2].
I think we were able to fix it by synchronizing entity-manager-access
with synchronized-blocks

synchronized(entityManager){
entityManager.merge(...);
}

kind regards,
christoph

[1]
http://karaf.922171.n3.nabble.com/Exception-No-transaction-currently-active-td4025308.html
[2]
http://mail-archives.apache.org/mod_mbox/aries-dev/201207.mbox/%3CCAEQV%2BEEhx4zNS%3D9MbxBhBUfedeC8F%3DBvGXn7v49EzwYxBJdf3g%40mail.gmail.com%3E

On 25/08/12 10:12, johnsas wrote:
 Hi,
 
 I am using Aries 0.3 for transaction management in Karaf 2.2.8.
 It works in gereral but sometimes I get the following exception when
 accessing a database:
 
 javax.persistence.TransactionRequiredException: No transaction currently
 active
   at
 org.apache.aries.jpa.container.context.transaction.impl.JTAPersistenceContextRegistry.getCurrentPersistenceContext(JTAPersistenceContextRegistry.java:103)
   at
 org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getPersistenceContext(JTAEntityManager.java:83)
   at
 org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.merge(JTAEntityManager.java:270)
   at
 org.xxx.persistence.impl.DatabaseProviderDao.merge(DatabaseProviderDao.java:304)
 
 This error occurs out of the blue.
 Do you have an idea why this happens, and what can be done to avoid it?
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825.html
 Sent from the Karaf - User mailing list archive at Nabble.com.
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Aries error: No transaction currently active

2012-08-27 Thread johnsas
Hi,

It seems that the issue was fixed in ARIES-885. But this will only be
available with Aries 1.0.
Do you have an idea to synchronize all calls to the EM with Aries 0.3?

We have a blueprint similar to this:

bean id=serviceBean
   class=org.xxx.MyServiceImpl
   jpa:context unitname=store property=entityManager /
   tx:transaction method=* value=Required /
/bean

service ref=serviceBean interface=org.xxx.MyService /

How can I replace the entityManager with one that synchronizes the calls?

John

 



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825p4025844.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Aries error: No transaction currently active

2012-08-27 Thread johnsas
What I don't understand is why my persistence bundle exports two
EntityManagerFactory Services.

Component (44) provides:

objectClass = javax.persistence.EntityManagerFactory
org.apache.aries.jpa.container.managed = true
org.apache.aries.jpa.default.unit.name = false
osgi.unit.name = registry
osgi.unit.provider = org.eclipse.persistence.jpa.PersistenceProvider
osgi.unit.version = 1.0.0
service.id = 350

objectClass = javax.persistence.EntityManagerFactory
org.apache.aries.jpa.container.managed = true
org.apache.aries.jpa.default.unit.name = false
org.apache.aries.jpa.proxy.factory = true
osgi.unit.name = registry
osgi.unit.provider = org.eclipse.persistence.jpa.PersistenceProvider
osgi.unit.version = 1.0.0
service.id = 351

objectClass = xxx.Registry
osgi.service.blueprint.compname = registryService
service.id = 379
version = 1

objectClass = org.osgi.service.blueprint.container.BlueprintContainer
osgi.blueprint.container.symbolicname =
org.oparo.services.registry.registry-component
osgi.blueprint.container.version = 1.0.0
service.id = 389

Is this normal behaviour? If yes, which bundle is using those OSGi-services?




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825p4025846.html
Sent from the Karaf - User mailing list archive at Nabble.com.