users@glassfish.java.net

Re: EJB 3 Interoperability issue - need help

From: Pocket <Pocket_at_korruptor.de>
Date: Thu, 13 Mar 2008 12:35:18 -0700 (PDT)

glassfish wrote:
>
> Hi Pocket,
>
> we sucessfully connected a C# client via IIOP.NET to an EJB (2.x) style to
> GlassFish v2 in the following way:
>
> Step 1:
> Create EJB 2.x wiht Home/Remote interfaces
>
> Step 2:
> run rmic compiler with the following options:
> rmic -idl -classpath ..\EJBTest\dist\EJBTest.jar;javaee.jar -d
> ../EJBTest/src/idl_gen test.jee5.EJBTestHome
>
> Step 3:
> Copy "orb.idl" and "ir.idl" from ./jre/lib directory to your idl-root
> directory (in our sample "idl_gen").
>
> Step 4:
> Run IIOP.NET idl compiler with options to automatically generates impl
> classes for all value types:
> IDLToCLSCompiler -vtSkel -vtSkelO -vtSkelTd ..\gen_src -o ..\lib <assembly
> name> test\jee5\EJBTestHome.idl
>
> The generated Impl-Classes are ready to use, there is no need to overwrite
> the generated classes.
>
> Hope this helps,
> greetings
>
Hi, thank you for this. I just got the error myself today.
I cannot just use the Skeletons which are created by IDL2CLS, because the
IDL just represents the Interfaces of the objects. The remoted objects are
no problem, their method calls will be delegated to the remote session bean.
But if you transport an object other than remoted ones:
like this:

@stateless
public class TestBean {

public Valuetype getValueType(){return new Valuetype;}
...

you will only have the interface of this object, not the implementation
(which can just be getters/setter). So you have to implement the dummy
functions of these in your generated skeletons.
I did this, but i just tried to acces the wrong field. If the Valuetype has
a field (e.g. String name), the skeleton will have this aswell. But the
transported Proxy has a field, which is called m_name.
So by returning the skeletons field from inside the skeleton, this call
becomes a recursive one, which leads to a stack overflow.

That was the first problem...

the second one, was the transport aof Valuetypes containing Collection
Types. In this case i had an Entity bean, which has a field:
private List<T> customList=new ArrayList<T>();
(incl getters/setters)

this Entity is persistent by persistence Api. IIOP.NET has some ValueType
mappings for arrayList. But if you query the database, the EntityManager
results in a Java.util.vector instead of arrayList. And for Vector there is
no TypeMapping.

i solved this, by converting the output of the query into an ArrayList,
which works. But i couldn t get the Custom Typemapping to work.
So i changed the tranported datamodel and dropped any Collection types. This
is no problem, because i have to do this for my exams and therefor i should
compare the quality of webservices to Corba implementations.

So my Problems are gone..

If someone has an idea how to get the arrayList to work (converted), pls let
me know..

thanks and best regards
Pocket
 

-- 
View this message in context: http://www.nabble.com/EJB-3-Interoperability-issue---need-help-tp14380349p16036641.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.