About delphi call EJB running in JBoss

02-08-16 IPOz

Hi,friends

According to what is said on http://laurent.etiemble.free.fr/combridge/ the VB can call EJB in JBoss successfully.However i donot understand why the following program written in delphi can NOT do it

...

jboss: TJBossServices;

JvmControl1: TJvmControl;

...

procedure TForm1.ejbClick(Sender: TObject);

var

home : OleVariant;

bean : OleVariant;

begin

JvmControl1.Classpath :=

'd:\jboss\client\jboss-client.jar;' +

'd:\jboss\client\jboss-common-client.jar;' +

'd:\jboss\client\jboss-j2ee.jar;' +

'd:\jboss\client\jnp-client.jar;' +

'd:\jboss\client\jbosssx-client.jar;' +

'd:\jboss\client\log4j.jar;' +

'd:\myProject\cas\ejb\build\bank.jar' ;

JvmControl1.StartJvm;

jboss.ProviderURL := 'jnp://192.168.1.118:1099';

home := jboss.LookupEjbHome(

'bank/BankBean',

'com.xx.ejb.interfaces.BankHome');

showMessage('bank home varType=' + intToStr(varType(home)));

bean := home.create(); // raise error "Wrong type:cannot convert to Jobject:VT_ERROR"

showMessage('Created Bank');

showMessage(bean.getXml());

bean.remove();

showMessage('ok');

end;

Any suggestion is appreciated !

BTW,

Any interested person can test it by getting all your needs from http://laurent.etiemble.free.fr/combridge/

banq
2002-08-19 15:16

Delphi我不懂,有人懂吗?

fox1121
2002-09-04 17:32

使用

Delphi -> xml --> http --> Servlet --> Beans --> Ejb