Phew, I was getting a bit nervous on that comment, I'm not all that self asured. But
thanks for the nice reply and sorry for my comments.
Code:
Context ctx = new InitialContext(env);
| Object obj = ctx.lookup( "acme/Application" );
| ApplicationHome home = (ApplicationHome)PortableRemoteObject.narrow(obj,
ApplicationHome.class);
| Application app = (Application)home.findBaseKey("logon.label");
| System.out.println("1. logon.label : " + app.getValue());
| app = (Application)home.findKeyByLocale("en_ZA", "logon.label");
| System.out.println("2. logon.label : " + app.getValue());Class bcHome =
Class.forName("app.resources.ApplicationHome");
| Method findBaseKey = bcHome.getMethod("findBaseKey", new Class[] { String.class });
| Class bClass = Class.forName("app.resources.Application");
| Method getValue = bClass.getMethod("getValue", null);
| Object boHome; // = bcHome.newInstance();
| Object bObject = bClass.newInstance();
| boHome = PortableRemoteObject.narrow(obj, bcHome); <-LINE 35
| Object[] baseKeyVal = null;
| baseKeyVal[0] = "logon.label";
| bObject = findBaseKey.invoke(boHome, baseKeyVal);
| System.out.println("3. logon.label : " + getValue.invoke(bObject, null));
And I get:
1. logon.label : Please log on.
2. logon.label : Kom gerus binne
Exception: app.resources.Applicationjava.lang.InstantiationException:
app.resources.Application
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at CallResourcesEjb.main(CallResourcesEjb.java:35)
Thanks for the help, I'm quite new to Java and EJB's.
Appreciated.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835798#3835798
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835798
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user