[EJB 3.0] - EJB Local Home in EJB 3.0
by kancharla_g
Hi,
Is JBoss supports LocalHome? I am not able to lookup from the JSF backing bean which is also in the same ear file.
I have created an Stateful Session Bean as follows
@Stateful
@LocalHome(value=TestUserHome.class)
public class TestUserBean implements TestUserLocal {
@Init
public void initDefault(){
}
...
}
My ear package is as follows.
MyApplication.ear
|
|____ entities.jar
|
|____ ejb-beans.jar
|
|____ webapp.war
|
|____ META-INF
|
|____ application.xml
I need to lookup the TestUserHome which is in ejb-beans.jar from my JSF backing bean which is webapp.war. I tried the following ways to lookup none of them successful.
a) TestUserBean/localhome
b) TestUserBean/home
c) ejb-beans.jar#TestUserBean/home
d) Define in web.xml as follows
<ejb-local-ref>
<ejb-ref-name>TestUser</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.test.TestUserHome</local-home>
com.test.TestUserLocal
</ejb-local-ref>
and in jboss-web.xml
<ejb-local-ref>
<ejb-ref-name>TestUser</ejb-ref-name>
<local-jndi-name>TestUserBean/localhome</local-jndi-name>
</ejb-local-ref>
e) TestUserHome.class.getName();
Please suggest me how to lookup LocalHome. I am using jboss-4.2.2.GA
Thank you,
Gupta.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125356#4125356
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125356
18 years, 2 months
[JBoss Seam] - <s:button> does not include Request parameter in 2.0.0 GA
by kchenga
i observed an interesting behavior with the <s:button> and request parameters just now.
in pages.xml
<page view-id="/hello.jsp" action="#{helloWorld.sayHello}">
in hello.jsp
this line of code,
<s:button view="/hello2.jsp" action="#{hellowWord2.sayAgain}"/>,
is translated to
<input onclick="location.href='/hello2.seam?firstName=&lastName=&cid=3&actionMethod=hello2.jsp%3AhellowWord2.sayAgain'" id="j_id2:j_id6" value="Say again" type="button" />
Notice the empty values for the firstName in lastName parameters in the onclick event even if the person object's corresponding attributes contain values.
this line of code without the view attribute in the button tag works -
<s:button action="#{hellowWord2.sayAgain}"/> to
<input onclick="location.href='/hello.seam?firstName=Mickey&lastName=Mouse&cid=3&actionMethod=hello.jsp%3AhellowWord2.sayAgain'" id="j_id2:j_id6" value="Say again" type="button" />
I'm using Seam 2.0.0 GA.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125346#4125346
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125346
18 years, 2 months
[Remoting] - problem wiht Identity object
by mazz@jboss.com
Suppose I have a box whose hostname is not resolvable via DNS (I know, I know, but for people demo'ing software on a laptop, we've seen it happen). So, I cannot "ping `hostname`" but I can "ping 127.0.0.1".
Look at NetworkRegistry:
public ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName) throws Exception
| {
| this.mBeanServer = mBeanServer;
| this.objectName = objectName;
| // make sure our identity system property is properly set
| Identity identity = Identity.get(this.mBeanServer);
| ...
|
Now look at the Identity.get() method it called there:
| if(identities.containsKey(server))
| {
| return (Identity) identities.get(server);
| }
| try
| {
| String serverid = (String) server.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "MBeanServerId");
| Identity identity = new Identity(InetAddress.getLocalHost(), createId(server), serverid);
| identities.put(server, identity);
| return identity;
| }
It calls InetAddress.getLocalHost() but if that fails (and it will if the local hostname is not resolvable) you can *never* start a NetworkRegistry object.
If there is an exception here in that call to InetAddress.getLocalHost(), it should fallback and use: InetAddress getByName("127.0.0.1").
I tried setting "jboss.identity" sysprop to Identity.createUniqueID() but unfortunately, that sysprop isn't used in this class and NetworkRegistry never looks to see if that is set as a fallback.
I understand that without a resolvable host, it hobbles things - but for demo purposes of software that will ONLY ever run on a single laptop over the loopback network adapter on 127.0.0.1, this should still work without me having to disable things like the NetworkRegistry.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125344#4125344
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125344
18 years, 2 months