Re: [JBoss-user] Problem making CORBA call

2001-05-16 Thread Dave Ortman

org.omg.CORBA.ORB orb = ORB.init(new String[] {ior}, null);

Why do you pass the IOR here?

When I first went to write the CORBA connection, I copied and pasted from some
sample code which I had found.  It worked, so I never changed it.


Sytem.err.println(e);

Please change this to e.printStackTrace(System.err).

I did.

Oh, I thought you were getting a null back from string_to_object.  If you're

getting a NPE from the string_to_object call, then there's definitely a
problem with the ORB.

The stacktrace I got certainly supports that assertion.

It would be helpful to see the complete stacktrace of the exception.

Ask and you shall recieve.

[TestBean] java.lang.NullPointerException
[TestBean]  at com.sun.corba.se.internal.core.IOR.getCodebase(Unknown Source)

[TestBean]  at com.sun.corba.se.internal.core.IOR.read(Unknown Source)
[TestBean]  at com.sun.corba.se.internal.iiop.CDRInputStream.read_Object(Unknown
Source)
[TestBean]  at com.sun.corba.se.internal.iiop.CDRInputStream.read_Object(Unknown
Source)
[TestBean]  at com.sun.corba.se.internal.corba.ORB.string_to_object(Unknown
Source)
[TestBean]  at 
com.calpers.CORBA.client.CometManager.connect(com/calpers/corba/client/CometManag

er.java:81)
[TestBean]  at 
psg.intranet.ejb.sessionbeans.TestBean.getIndivs(psg/intranet/ejb/sessionbeans/Te

stBean.java:33)
[TestBean]  at java.lang.reflect.Method.invoke(Native Method)
[TestBean]  at 
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSess

ionContainer.java:472)
[TestBean]  at 
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSession

InstanceInterceptor.java:87)
[TestBean]  at 
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)

[TestBean]  at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:

263)
[TestBean]  at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)

[TestBean]  at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:190)

[TestBean]  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)

[TestBean]  at 
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:271

)
[TestBean]  at 
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoke

r.java:392)
[TestBean]  at java.lang.reflect.Method.invoke(Native Method)
[TestBean]  at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)

[TestBean]  at sun.rmi.transport.Transport$1.run(Unknown Source)
[TestBean]  at java.security.AccessController.doPrivileged(Native Method)

[TestBean]  at sun.rmi.transport.Transport.serviceCall(Unknown Source)
[TestBean]  at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown
Source)
[TestBean]  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Source)
[TestBean]  at java.lang.Thread.run(Unknown Source)

Thanks,
-Dave

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Problem making CORBA call

2001-05-16 Thread Dave Ortman

-- Stack Trace --

 Hmm, well I can't complain about not enough information any more, so I'm

going to have to admit that I have no idea.  Sorry. 

No problem.  I appreciate you're curiosity up to this point.  And, it makes
me feel slightly better to know that I'm not the only one without an answer.
:)

 Is the source for these com.sun.corba classes available?  You could try
using a different ORB (e.g. JacORB) for which you have source. 

I don't have them... but I was going to go see if I could find them.  If not,
I guess I can try using a different ORB.  I was just hoping that somebody out
there had already hit this wall, so as to save me the time necessary to look
into it.

 I think there's some debugging you can turn on that will show you all of
the
premission checks that the security manager is doing.  This might provide
some insight. 

I'll look into it. 

Thanks much,
-Dave

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Problem making CORBA call

2001-05-15 Thread Dave Ortman

You shouldn't jump to conclusions like that - you might hurt yourself.

Just a wild guess... I never assumed it would be correct.

AFAIK, there shouldn't be any reason why you can't be a CORBA client.

Well, at least that clears that up.  I had looked through the spec for something
saying You can't do this, but had no such luck.  So I guess that narrows it
down to user error.


 I placed the IOR string in the Java file, as I can't use I/O classes to read

 it from a file (as I'm doing in my Swing client).  I've put some logging in

 the bean, and have found that the string_to_object method always returns a
null
 object.

Well, this means that the ORB wasn't able to convert the string to an
object.  If this were some security related problem I would expect an
exception of some description.

As would I.

Are you sure that the IOR string is the same as you are using the Swing
client?  Are you running these things on the same machine?  Perhaps there
is an environment configuration problem.  Are you using the same ORB?  Are
you initialising the ORB the same way?

I'm 99% sure that everything is EXACTLY the same.  I actually have the connection
logic in a helper class - CorbaManager.  The IOR string is hard coded in the
class.  I'm running both EJB and Swing client on the same machine.  So, each
create an instance of the CorbaManager object - one works, the other doesn't.


I'll go and check for that extra 1% of confidence.  Perhaps I'm doing something
different... but I really don't think that to be the case.  At any rate, knowing
that it's not forbidden helps in now that I know there must be a problem somewhere


Thanks,
-Dave

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Problem making CORBA call

2001-05-15 Thread Dave Ortman

You might find that ORBs do some things that an EJB would be prohibited by

the spec from doing, but I'm pretty sure JBoss wouldn't stop them from
happening anyway.

I had originally figured that perhaps the ORB was breaking some rule, but was
unable to guess as to what that might be.

 
 Are you sure that the IOR string is the same as you are using the Swing

 client?  Are you running these things on the same machine?  Perhaps there

 is an environment configuration problem.  Are you using the same ORB?  Are

 you initialising the ORB the same way?
 
 I'm 99% sure that everything is EXACTLY the same.  I actually have the connection

 logic in a helper class - CorbaManager.  The IOR string is hard coded in the

 class.  I'm running both EJB and Swing client on the same machine.  So, each

 create an instance of the CorbaManager object - one works, the other doesn't.

 
 
 I'll go and check for that extra 1% of confidence.  Perhaps I'm doing something

 different... but I really don't think that to be the case.  At any rate, knowing

 that it's not forbidden helps in now that I know there must be a problem
 somewhere

Which ORB are you using?  You might find that you're picking up an
orb.properties file in one but not the other, or something.

I'm simply using the OMG classes which are distributed with the JDK.  The ORB
on the other end is a Forte server.. though that really shouldn't matter.

Anyway, keep us updated.  I plan to port an application at work to JBoss
at some point, and we do a bit of CORBA, so I'm interested in how you get
on, at least.

I have no qualms with continuing to bug the fine people on this list, so no
problem. :)

I went back and checked... and found nothing that looked out of whack.  As I
said earlier, I wrapped some CORBA calls in a helper class really quick.  I
then create an instance of this helper object, have it connect to the CORBA
server, then use it as a call through for subsequent CORBA calls.  The connect
logic (which works in normal client, but fails in a session bean) is as follows:


public boolean connect(String fileName) {

System.out.println(fileName);
String ior = 
IOR:01001c0049444c3a436f726261534f2f436f7262615365727665723a312e3100b40001010a0077656273657276657200ed139c006652744501002b00536974652f436f726261534f5f434c302f436f726261534f5f636c302d436f726261536572766572534f0100010006002600436f726261534f5f636c302f436f726261534f5f434c302f436f726261536572766572534f000100;

//System.out.println(ior);
if (ior == null) {
connected = false;
}
try 
{
System.out.println(1);
org.omg.CORBA.ORB orb = ORB.init(new String[] {ior},
null);
System.out.println(2);
if (orb == null) {
System.out.println(orb is null damn it
to hell!);
}
System.out.println(3);
org.omg.CORBA.Object obj = orb.string_to_object(ior);
System.out.println(4);
server = CorbaServerHelper.narrow(obj);
mediator = server.getCORBAMediator(); 
if (mediator == null) {
System.out.println(Crap!);
} 
}
catch (java.lang.Exception e)
{
System.err.println(e);
}

connected = true;
return connected;
}

I have the IOR string hard coded in the class.  I did this to avoid the I/O
issues within the bean, and to make sure that I was using the same IOR string
in both cases.  In the Swing client, this method works find.  It obtains a reference
to an object and stores it for future requests.  However, when running within
a session bean in JBoss, I receive a NullPointerException.  Within the console
on JBoss, I see the numbers 1, 2, and 3 get printed out - which means that it's
dying on the string_to_object() method.  The IOR is not null.  The orb is not
null (as I check for it directly above).  So I assume the error is getting raised
from inside the string_to_object method.

Am I doing something really stupid?

Thanks,
-Dave

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Problem making CORBA call

2001-05-14 Thread Dave Ortman

Hi,

I'm attempting to make a call to a CORBA service from within a session bean.
 The code below works perfectly fine when I run it from a Swing Java client.
 However, as soon as I place it in a session bean, I recieve a NULL exception.
 I'm assuming it has something to do with the I/O and the EJB container - it
isn't letting me get a reference to an external object.  Can somebody help me
out?

The code I'm using to obtain a reference to an external CORBA object is as follows:


String ior = __IOR String here;
ORB orb = ORB.init(new String[] {ior}, null);
org.omg.CORBA.Object obj = orb.string_to_object(ior);
System.out.println(ior);
server = CorbaServerHelper.narrow(obj);
mediator = server.getCORBAMediator(); 
if (mediator == null) {
System.out.println(Crap!);
} 

I placed the IOR string in the Java file, as I can't use I/O classes to read
it from a file (as I'm doing in my Swing client).  I've put some logging in
the bean, and have found that the string_to_object method always returns a null
object.

Is this an easy fix?

Thanks,
-Dave Ortman

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Problem making CORBA call

2001-05-14 Thread Toby Allsopp

On Mon, May 14, 2001 at 09:24:23AM -0700, Dave Ortman wrote:
 Hi,
 
 I'm attempting to make a call to a CORBA service from within a session bean.
  The code below works perfectly fine when I run it from a Swing Java client.
  However, as soon as I place it in a session bean, I recieve a NULL exception.
  I'm assuming it has something to do with the I/O and the EJB container - it
 isn't letting me get a reference to an external object.  Can somebody help me
 out?

You shouldn't jump to conclusions like that - you might hurt yourself.

AFAIK, there shouldn't be any reason why you can't be a CORBA client.

 The code I'm using to obtain a reference to an external CORBA object is as follows:
 
 
 String ior = __IOR String here;
 ORB orb = ORB.init(new String[] {ior}, null);
 org.omg.CORBA.Object obj = orb.string_to_object(ior);
 System.out.println(ior);
 server = CorbaServerHelper.narrow(obj);
 mediator = server.getCORBAMediator(); 
 if (mediator == null) {
 System.out.println(Crap!);
 } 
 
 I placed the IOR string in the Java file, as I can't use I/O classes to read
 it from a file (as I'm doing in my Swing client).  I've put some logging in
 the bean, and have found that the string_to_object method always returns a null
 object.

Well, this means that the ORB wasn't able to convert the string to an
object.  If this were some security related problem I would expect an
exception of some description.

Are you sure that the IOR string is the same as you are using the Swing
client?  Are you running these things on the same machine?  Perhaps there
is an environment configuration problem.  Are you using the same ORB?  Are
you initialising the ORB the same way?

Toby.

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user