${MYUSERD} is fine but you need to be sure this singleton is deployed
before your application is deployed (deploying it in another application -
simple jar defined in conf/tomee.xml Deployments would be fine)*Romain Manni-Bucau* *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/7/22 mauro2java2011 <[email protected]> > I have tried to write a ejb singleton with attribute : > @Named > @Singleton > @Startup > public class MySingletonEnvVarPropertiesManager { > > Private String MYUSERDB, MYDBPASS, MYDBHOST, MYDBPORT, MYDBNAMEDB > @PostCreation > Public void init (){ > MYUSERDB=System.getEnv ("OPENSHIFT_MYSQL_USER"); > System.setPropertie ("MYUSERDB", MYUSERDB); > > // i use same similar code for get other environment variables and set the > sistem proprties > > > } > > I have also write the methods set and getter for all string into my > singlrton.? > > Or into resources.xml at resource i can get the system properties from: > $(MYUSERDB); ???? > > Or i have to get the valye from method gettere of singleton with: > $(mysingletonEnvVarPropertoesManager.MYUSERDB).?..?. > > Or the singleton not work ? > > Or the tomcat listener set the properties at webapplication startup or at > global server startup ?... > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Re-i-have-tried-but-not-work-tp4664234p4664311.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >
