Discussion:
[jboss-user] [EJB3] - Re: Get ear name
Łukasz Kasprzyk
2012-04-12 07:31:13 UTC
Permalink
Łukasz Kasprzyk [https://community.jboss.org/people/lkasprzy] created the discussion

"Re: Get ear name"

To view the discussion, visit: https://community.jboss.org/message/729542#729542

--------------------------------------------------------------
Is exist some way to get ear name in Jboss 7.1 version ? As I know the RemoteBinding annotation don't work in 7 version. I have about 15 ears in many diffrent environments with diffrent versions ear  (with timestamps) and composed with diffrent version of modules. This versions is changing often, so I have to programatically inject ear name and also module name.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/729542#729542]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Viggo Navarsete
2012-04-12 07:42:48 UTC
Permalink
Viggo Navarsete [https://community.jboss.org/people/viggo.navarsete] created the discussion

"Re: Get ear name"

To view the discussion, visit: https://community.jboss.org/message/729545#729545

--------------------------------------------------------------
I would say that if you really need the name of the EAR file, then you do something wrong, either the way you package your application, or how you refer to modules. When running JBoss 7.x there should really be no reason for needing the EAR name since you can use CDI to inject resources, you hardly need to know about JNDI at all. With earlier version of JBoss there is a different story but my point is that if you find yourself needing the name of the EAR file, then you should rethink your solution.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/729545#729545]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Łukasz Kasprzyk
2012-04-12 08:53:05 UTC
Permalink
Łukasz Kasprzyk [https://community.jboss.org/people/lkasprzy] created the discussion

"Re: Get ear name"

To view the discussion, visit: https://community.jboss.org/message/729557#729557

--------------------------------------------------------------
I have remote communication betwen client (on tomcat) to jboss and jboss to jboss, so I don't see easy way to resolve this.
In previous Jboss versions with RemoteBinding it was very easy, also in weblogic there is simple way with mappedName in Stateless annotation.
Mayby request https://issues.jboss.org/browse/EJBTHREE-648 https://issues.jboss.org/browse/EJBTHREE-648 will be realized ?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/729557#729557]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Maxim Frolov
2013-05-22 18:37:43 UTC
Permalink
Maxim Frolov [https://community.jboss.org/people/frolovmx] created the discussion

"Re: Get ear name"

To view the discussion, visit: https://community.jboss.org/message/818943#818943

--------------------------------------------------------------
In JBoss 7.1.X you can get the EAR name using JNDI Lookup like this:
String earName = new InitialContext().lookup("java:app/AppName")
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/818943#818943]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
Loading...