Discussion:
[omniORB] interoperability of DII requests
Jason Stelzer
2007-07-06 22:58:12 UTC
Permalink
Hello, this is probably a self inflicted problem as I'm very new to
corba. But, there doesn't seem to be many good places to look for
examples that apply to what I'm doing.

Currently I'm working on getting an older application of ours to talk
to our newer ejb servers via corba. We're using java 1.5 on the
server side with jboss 4.0.5GA. On the client side, I'm using omniorb
4.1.0. At this point I've puzzled out how to get ejb3 beans
registered with jacorb in jboss. So, at this point I can look up the
remote interface to an ejb3 bean in the orb.

I can connect to the jboss server and lookup the remote name service
on the C++ side.

I can lookup objects and create requests. However, I believe I'm
either putting the request together wrong or need to declare things
slightly differently.

The bean I'm talking to is a glorified hello world bean. It takes a
string as an argument and returns a different string. The method
never gets invoked. It looks like things are dying during the corba
marshalling of input. All I see in the jboss log is:

12:12:40,052 ERROR sys : [STDERR] org.omg.CORBA.MARSHAL: unknown
value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0 completed: No
12:12:40,052 ERROR sys : [STDERR] at
org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2446)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.CDRStream$StringReader.read(CDRStream.java:
578)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.strategy.SkeletonStrategy.readParams
(SkeletonStrategy.java:128)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.ejb3.iiop.BeanCorbaServant._invoke(BeanCorbaServant.java:193)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:
297)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:596)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:739)
12:12:40,054 INFO sys : [controller] rid: 4 opname: echoString
invocation: system exception was thrown (org.omg.CORBA.MARSHAL:
unknown value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0
completed: No)

Assuming I've looked up the right object, does this seem like a
reasonable way to call a remote method as I've described on the C++
side? Appologies if this comes through mangled.


CORBA::String_var arg = (const char*)"Echo!";
CORBA::Request_var req = obj->_request("echoString");
req->add_in_arg() <<= arg;
req->set_return_type(CORBA::_tc_wstring);
req->invoke();
if( req->env()->exception() ) {
CORBA::Exception *excP = req->env()->exception();
cout << "echo_diiclt: An exception was thrown! " << excP->_name
() << endl;
return;
}
const char* ret;
req->return_value() >>= ret;
cout << "I said, \"" << (char*)arg << "\"." << endl
<< "The Echo object replied, \"" << ret <<"\"." << endl;


Also, as an asside, I've been using a cfg file on the commandline
with a InitRef set for the name service. How do I do this on the
commandline? For now, in addition to things like trace level, I'm
setting "InitRef= NameService=corbaloc::***@jstelzer-
lin.ws.hmsonline.com:3528/JBoss/Naming/root " inside the config file
I specify via -ORBconfigFile on the commandline.

--
J.
Jason Stelzer
2007-07-07 02:02:21 UTC
Permalink
Post by Jason Stelzer
Hello, this is probably a self inflicted problem as I'm very new to
corba. But, there doesn't seem to be many good places to look for
examples that apply to what I'm doing.
Currently I'm working on getting an older application of ours to
talk to our newer ejb servers via corba. We're using java 1.5 on
the server side with jboss 4.0.5GA. On the client side, I'm using
omniorb 4.1.0. At this point I've puzzled out how to get ejb3 beans
registered with jacorb in jboss. So, at this point I can look up
the remote interface to an ejb3 bean in the orb.
I can connect to the jboss server and lookup the remote name
service on the C++ side.
I can lookup objects and create requests. However, I believe I'm
either putting the request together wrong or need to declare things
slightly differently.
The bean I'm talking to is a glorified hello world bean. It takes a
string as an argument and returns a different string. The method
never gets invoked. It looks like things are dying during the corba
12:12:40,052 ERROR sys : [STDERR] org.omg.CORBA.MARSHAL: unknown
value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0 completed: No
12:12:40,052 ERROR sys : [STDERR] at
org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2446)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.CDRStream$StringReader.read
(CDRStream.java:578)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.strategy.SkeletonStrategy.readParams
(SkeletonStrategy.java:128)
12:12:40,053 ERROR sys : [STDERR] at
193)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.invokeOperation
(RequestProcessor.java:297)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:596)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:739)
12:12:40,054 INFO sys : [controller] rid: 4 opname: echoString
unknown value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0
completed: No)
As a followup, I've found that if I make void() calls, I get no
errors. Logging shows the calls are made. However when I return or
pass in strings I get exceptions related to marshalling the data. I'm
not quite sure why.


--
J.
Welch, Jay
2007-07-07 02:11:57 UTC
Permalink
I believe you need to CORBA::string_dup() your argument for the call. Remember that var types such as String_var take ownership of the data and thus discard them when done. See if that helps.


-----Original Message-----
From: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com]On Behalf Of Jason
Stelzer
Sent: Friday, July 06, 2007 4:02 PM
To: Jason Stelzer
Cc: omniorb-***@omniorb-support.com
Subject: Re: [omniORB] interoperability of DII requests
Post by Jason Stelzer
Hello, this is probably a self inflicted problem as I'm very new to
corba. But, there doesn't seem to be many good places to look for
examples that apply to what I'm doing.
Currently I'm working on getting an older application of ours to
talk to our newer ejb servers via corba. We're using java 1.5 on
the server side with jboss 4.0.5GA. On the client side, I'm using
omniorb 4.1.0. At this point I've puzzled out how to get ejb3 beans
registered with jacorb in jboss. So, at this point I can look up
the remote interface to an ejb3 bean in the orb.
I can connect to the jboss server and lookup the remote name
service on the C++ side.
I can lookup objects and create requests. However, I believe I'm
either putting the request together wrong or need to declare things
slightly differently.
The bean I'm talking to is a glorified hello world bean. It takes a
string as an argument and returns a different string. The method
never gets invoked. It looks like things are dying during the corba
12:12:40,052 ERROR sys : [STDERR] org.omg.CORBA.MARSHAL: unknown
value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0 completed: No
12:12:40,052 ERROR sys : [STDERR] at
org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2446)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.CDRStream$StringReader.read
(CDRStream.java:578)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.strategy.SkeletonStrategy.readParams
(SkeletonStrategy.java:128)
12:12:40,053 ERROR sys : [STDERR] at
193)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.invokeOperation
(RequestProcessor.java:297)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:596)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:739)
12:12:40,054 INFO sys : [controller] rid: 4 opname: echoString
unknown value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0
completed: No)
As a followup, I've found that if I make void() calls, I get no
errors. Logging shows the calls are made. However when I return or
pass in strings I get exceptions related to marshalling the data. I'm
not quite sure why.


--
J.
Jason Stelzer
2007-07-07 02:19:31 UTC
Permalink
Post by Welch, Jay
I believe you need to CORBA::string_dup() your argument for the
call. Remember that var types such as String_var take ownership of
the data and thus discard them when done. See if that helps.
That made no difference to the marshalling related errors. I've been
basing things on the example in src/examples/dii/echo_diiclt.cc

--
J.
BaileyK at schneider.com ()
2007-07-07 02:22:21 UTC
Permalink
Have you tried using CORBA::WString rather than CORBA::String? Just a
guess.


CORBA::String_var arg = (const char*)"Echo!";
^^^^^^^^^
CORBA::Request_var req = obj->_request("echoString");
req->add_in_arg() <<= arg;
req->set_return_type(CORBA::_tc_wstring);
req->invoke();

---
Kendall Bailey
Engineering & Research
Schneider National, Inc.
Duncan Grisby
2007-07-07 02:25:29 UTC
Permalink
Post by Jason Stelzer
I can connect to the jboss server and lookup the remote name service
on the C++ side.
I can lookup objects and create requests. However, I believe I'm
either putting the request together wrong or need to declare things
slightly differently.
I haven't looked in detail at your code. Are you sure you're filling in
the right request for the parameters the server is expecting?

I'd suggest first trying a static invocation based on the IDL, to
confirm that that works, before dealing with the complexity of DII. If
you can possibly avoid it, it's best not to use DII at all. It's just so
much extra work.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Ridgway, Richard (London)
2007-07-07 02:47:01 UTC
Permalink
Give this a whirl in your jacorb.properties.
jacorb.log.default.verbosity=3
jacorb.debug.dump_incoming_messages=on
Gets quite verbose, and helps to have the giop spec to hand, but has
been useful a few times to me. JacORB 2.3.0 and omnORBpy work fine
together, although I don't use DII.

Richard

-----Original Message-----
From: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com] On Behalf Of Duncan
Grisby
Sent: 06 July 2007 21:26
To: Jason Stelzer
Cc: omniorb-***@omniorb-support.com
Subject: Re: [omniORB] interoperability of DII requests
Post by Jason Stelzer
I can connect to the jboss server and lookup the remote name service
on the C++ side.
I can lookup objects and create requests. However, I believe I'm
either putting the request together wrong or need to declare things
slightly differently.
I haven't looked in detail at your code. Are you sure you're filling in
the right request for the parameters the server is expecting?

I'd suggest first trying a static invocation based on the IDL, to
confirm that that works, before dealing with the complexity of DII. If
you can possibly avoid it, it's best not to use DII at all. It's just so
much extra work.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --

_______________________________________________
omniORB-list mailing list
omniORB-***@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
--------------------------------------------------------

This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.
--------------------------------------------------------
William Bauder
2007-07-07 03:14:07 UTC
Permalink
Post by Jason Stelzer
12:12:40,052 ERROR sys : [STDERR] org.omg.CORBA.MARSHAL: unknown
value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0 completed: No
12:12:40,052 ERROR sys : [STDERR] at
org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2446)
I'm guessing that "unknown value tag" means that it's looking for a
typecode, but doesn't recognize it. However, 6 is the length of "Echo!"
(string length + 1 for null terminator). I *think* jacorb is expecting
an Any, or Object, or something along those lines, but omniorb is just
sending a string.

Try varying the string that you're sending; see if the unknown value
tags matches the string length + 1.

Unfortunately, I can't offer any suggestions on how to actually resolve
it, unless it's something obvious like the server method not taking a
string as a parameter.

-Bill



-----Original Message-----
From: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com] On Behalf Of Jason
Stelzer
Sent: Friday, July 06, 2007 4:02 PM
To: Jason Stelzer
Cc: omniorb-***@omniorb-support.com
Subject: Re: [omniORB] interoperability of DII requests
Post by Jason Stelzer
Hello, this is probably a self inflicted problem as I'm very new to
corba. But, there doesn't seem to be many good places to look for
examples that apply to what I'm doing.
Currently I'm working on getting an older application of ours to talk
to our newer ejb servers via corba. We're using java 1.5 on
the server side with jboss 4.0.5GA. On the client side, I'm using
omniorb 4.1.0. At this point I've puzzled out how to get ejb3 beans
registered with jacorb in jboss. So, at this point I can look up
the remote interface to an ejb3 bean in the orb.
I can connect to the jboss server and lookup the remote name service
on the C++ side.
I can lookup objects and create requests. However, I believe I'm
either putting the request together wrong or need to declare things
slightly differently.
The bean I'm talking to is a glorified hello world bean. It takes a
string as an argument and returns a different string. The method
never gets invoked. It looks like things are dying during the corba
12:12:40,052 ERROR sys : [STDERR] org.omg.CORBA.MARSHAL: unknown
value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0 completed: No
12:12:40,052 ERROR sys : [STDERR] at
org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2446)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.CDRStream$StringReader.read
(CDRStream.java:578)
12:12:40,053 ERROR sys : [STDERR] at
org.jboss.iiop.rmi.marshal.strategy.SkeletonStrategy.readParams
(SkeletonStrategy.java:128)
12:12:40,053 ERROR sys : [STDERR] at
193)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.invokeOperation
(RequestProcessor.java:297)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:596)
12:12:40,054 ERROR sys : [STDERR] at
org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:739)
12:12:40,054 INFO sys : [controller] rid: 4 opname: echoString
unknown value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0
completed: No)
As a followup, I've found that if I make void() calls, I get no
errors. Logging shows the calls are made. However when I return or
pass in strings I get exceptions related to marshalling the data. I'm
not quite sure why.


--
J.
Duncan Grisby
2007-07-07 04:41:03 UTC
Permalink
Post by William Bauder
Post by Jason Stelzer
12:12:40,052 ERROR sys : [STDERR] org.omg.CORBA.MARSHAL: unknown
value tag: 0x6 (offset=0x88) vmcid: 0x0 minor code: 0 completed: No
12:12:40,052 ERROR sys : [STDERR] at
org.jacorb.orb.CDRInputStream.read_value(CDRInputStream.java:2446)
I'm guessing that "unknown value tag" means that it's looking for a
typecode, but doesn't recognize it. However, 6 is the length of "Echo!"
(string length + 1 for null terminator). I *think* jacorb is expecting
an Any, or Object, or something along those lines, but omniorb is just
sending a string.
I hadn't looked closely enough at it to spot that. "unknown value tag"
implies it is looking for a valuetype. That's probably because it's
expecting a StringValue, not just a plain string.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Jason Stelzer
2007-07-09 23:14:24 UTC
Permalink
Post by Duncan Grisby
I hadn't looked closely enough at it to spot that. "unknown value tag"
implies it is looking for a valuetype. That's probably because it's
expecting a StringValue, not just a plain string.
Thanks. I'm attempting to start over and try building a client based
on idl generated from the class files.

This leads me to a question about value boxes. Apparently I need to
pass a CORBA::WStringValue* rather than a plain string. This is fine,
but beyond http://omniorb.sourceforge.net/omni41/omniORB/
omniORB013.html#toc60 I'm not really certain what this object is, or
how I need to treat it with regard to construction, destruction, etc.
Are there some other key words I should be using to look up the info?
I've tried perusing omg.org but the pdfs I've read there have been
unhelpful.

Sorry for such basic questions, but there isn't a wealth of examples
out there to learn from.


--
J.
Duncan Grisby
2007-07-11 01:51:21 UTC
Permalink
Post by Jason Stelzer
This leads me to a question about value boxes. Apparently I need to
pass a CORBA::WStringValue* rather than a plain string. This is fine,
but beyond http://omniorb.sourceforge.net/omni41/omniORB/
omniORB013.html#toc60 I'm not really certain what this object is, or
how I need to treat it with regard to construction, destruction, etc.
Are there some other key words I should be using to look up the info?
I've tried perusing omg.org but the pdfs I've read there have been
unhelpful.
Value boxes are documented in section 1.17.7 of the C++ mapping, version
1.1:

http://www.omg.org/technology/documents/formal/c++.htm

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Jason Stelzer
2007-07-11 02:52:49 UTC
Permalink
Thanks. This is dense but it does shed light on things.
Post by Duncan Grisby
Post by Jason Stelzer
This leads me to a question about value boxes. Apparently I need to
pass a CORBA::WStringValue* rather than a plain string. This is fine,
but beyond http://omniorb.sourceforge.net/omni41/omniORB/
omniORB013.html#toc60 I'm not really certain what this object is, or
how I need to treat it with regard to construction, destruction, etc.
Are there some other key words I should be using to look up the info?
I've tried perusing omg.org but the pdfs I've read there have been
unhelpful.
Value boxes are documented in section 1.17.7 of the C++ mapping, version
http://www.omg.org/technology/documents/formal/c++.htm
Cheers,
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
--
J.
Sean Parker
2007-07-11 06:08:28 UTC
Permalink
Hello -

I've encountered an issue simply because I'm trying to
use a struct for the first that is "fixed length" (i.e.
it's a series of longs, w/o a string in it)

For example, I define a struct:

[Begin IDL]
struct DateTime
{
long year;
...
long seconds;
};
[End IDL]

This results in C++ template using the *_Fix_* class (I
forget the exact name) as opposed to the *_Variable_*
template class if the struct had a string in it.

[Begin C++]
DateTime* get( <stuff> )
{
DateTime_var ret = new DateTime();
ret->year = 2007;
...
ret->seconds = 0;
return ret._retn();
}
[End C++]

Now the compile complains "can't convert DateTime to
DateTime* in return" on return line.

I never had this problem when the template class was for
variable-length structs. Am I doing something wrong?

Any assistance appreciated.

Thanks and God Bless
Sean





God Bless
Sean Parker






____________________________________________________________________________________
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

Loading...