Problem running RMI/IIOP sample (stateless bean)

Hi.
I am unable to run the RMI/IIOP stateless bean sample (Weblogic 6.1 on
Windows 2000). I have deployed the sample (iiop_ejb_stateless) and the
server is running. I checked in the admin console and the module is
deployed OK.
However, the client is unable to get the initial context and throws a
""We were unable to get a connection to the WebLogic server at
iiop://localhost:
Please make sure that the server is running."
error message on the command prompt. What could be wrong? Is there a
flag I need to throw on to get the server to enable IIOP based
connections?
Thanks in advance,
- deepak

Deepak Balakrishna <[email protected]> writes:
I am unable to run the RMI/IIOP stateless bean sample (Weblogic 6.1 on
Windows 2000). I have deployed the sample (iiop_ejb_stateless) and the
server is running. I checked in the admin console and the module is
deployed OK.
However, the client is unable to get the initial context and throws a
""We were unable to get a connection to the WebLogic server at
iiop://localhost:
Please make sure that the server is running."
error message on the command prompt. What could be wrong? Is there a
flag I need to throw on to get the server to enable IIOP based
connections?It should be on by default. Try using SP2 to see if that helps at all
(although all the examples work on all releases). Also try substituting
localhost for your machine name, W2K does some fun tricks with DNS.
andy

Similar Messages

  • Problem  running the OdpNetWs sample

    Hi,
    I have the following error when starting the OdpNetWebService sample (I must say that I work with Oracle8i DataBase instead of 9i, in case this would be the trouble...)
    Thank you very much in advance for your help
    Bert
    Server Error in '/OdpNetWs/src/client' Application.
    File or assembly name ciejkhb8.dll, or one of its dependencies, was not found.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.IO.FileNotFoundException: File or assembly name ciejkhb8.dll, or one of its dependencies, was not found.
    Source Error:
    Line 33: '<remarks/>
    Line 34: Public Sub New()
    Line 35: MyBase.New
    Line 36: Me.Url = "http://bmasson/OdpNetWs/src/webservice/ODPService.asmx"
    Line 37: End Sub
    Source File: D:\ODP\web\OdpNetWs\src\client\Web References\webservice\Reference.vb Line: 35
    Assembly Load Trace: The following information can be helpful to determine why the assembly 'ciejkhb8.dll' could not be loaded.
    === Pre-bind state information ===
    LOG: Where-ref bind. Location = C:\WINDOWS\TEMP\ciejkhb8.dll
    LOG: Appbase = file:///D:/ODP/web/OdpNetWs/src/client
    LOG: Initial PrivatePath = bin
    Calling assembly : (Unknown).
    ===
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/WINDOWS/TEMP/ciejkhb8.dll.
    Stack Trace:
    [FileNotFoundException: File or assembly name ciejkhb8.dll, or one of its dependencies, was not found.]
    System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark) +0
    System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark) +307
    System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +21
    System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +67
    System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +0
    System.Xml.Serialization.Compiler.Compile() +408
    System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings) +1259
    System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings) +60
    System.Web.Services.Protocols.SoapClientType..ctor(Type type) +957
    System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() +151
    client.webservice.ODPService..ctor() in D:\ODP\web\OdpNetWs\src\client\Web References\webservice\Reference.vb:35
    client.MainForm.Page_Init(Object sender, EventArgs e) in D:\ODP\web\OdpNetWs\src\client\Main.aspx.vb:52
    System.Web.UI.Control.OnInit(EventArgs e) +67
    System.Web.UI.Control.InitRecursive(Control namingContainer) +240
    System.Web.UI.Page.ProcessRequestMain() +174
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

    Hi,
    I have the following error when starting the OdpNetWebService sample (I must say that I work with Oracle8i DataBase instead of 9i, in case this would be the trouble...)
    Thank you very much in advance for your help
    Bert
    Server Error in '/OdpNetWs/src/client' Application.
    File or assembly name ciejkhb8.dll, or one of its dependencies, was not found.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.IO.FileNotFoundException: File or assembly name ciejkhb8.dll, or one of its dependencies, was not found.
    Source Error:
    Line 33: '<remarks/>
    Line 34: Public Sub New()
    Line 35: MyBase.New
    Line 36: Me.Url = "http://bmasson/OdpNetWs/src/webservice/ODPService.asmx"
    Line 37: End Sub
    Source File: D:\ODP\web\OdpNetWs\src\client\Web References\webservice\Reference.vb Line: 35
    Assembly Load Trace: The following information can be helpful to determine why the assembly 'ciejkhb8.dll' could not be loaded.
    === Pre-bind state information ===
    LOG: Where-ref bind. Location = C:\WINDOWS\TEMP\ciejkhb8.dll
    LOG: Appbase = file:///D:/ODP/web/OdpNetWs/src/client
    LOG: Initial PrivatePath = bin
    Calling assembly : (Unknown).
    ===
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/WINDOWS/TEMP/ciejkhb8.dll.
    Stack Trace:
    [FileNotFoundException: File or assembly name ciejkhb8.dll, or one of its dependencies, was not found.]
    System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark) +0
    System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark) +307
    System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +21
    System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +67
    System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +0
    System.Xml.Serialization.Compiler.Compile() +408
    System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings) +1259
    System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings) +60
    System.Web.Services.Protocols.SoapClientType..ctor(Type type) +957
    System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() +151
    client.webservice.ODPService..ctor() in D:\ODP\web\OdpNetWs\src\client\Web References\webservice\Reference.vb:35
    client.MainForm.Page_Init(Object sender, EventArgs e) in D:\ODP\web\OdpNetWs\src\client\Main.aspx.vb:52
    System.Web.UI.Control.OnInit(EventArgs e) +67
    System.Web.UI.Control.InitRecursive(Control namingContainer) +240
    System.Web.UI.Page.ProcessRequestMain() +174
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

  • Transactions Sample RMI-IIOP Code

    Hi,
              Looking to the link below it appears that we can have RMI-IIOP applications
              and clients that use JTA.
              http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1067532
              Does anyone know of a RMI-IIOP sample that illustrates how transactions are
              propagated from RMI-IIOP clients to RMI-IIOP applications?
              Regards,
              Dan Cimpoesu
              

    But if you look to the diagram:
    http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1040200
    it suggests that transactional context is passed from clients to RMI-IIOP
    servers.
    Am I wrong?
    Dan
    "Andy Piper" <[email protected]> wrote in message
    news:[email protected]..
    "Dan Cimpoesu" <[email protected]> writes:
    Transactions over IIOP are not supported or implemented in WLS 6.1 or
    previous. This is a feature of WLS 7.0. In 7.0 we implement OTS.
    andy
    Hi,
    Based on the links below:
    http://e-docs.bea.com/wls/docs61/jta/trxrmi.html#1018506
    http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1067532
    It appears that is possible to have distributed transactions across
    RMI-IIOP
    clients and RMI-IIOP applications (servers).
    I followed up the "Transactions Sample RMI Code" section but it appearsthat
    the transaction context is not propagated from client to server. I amalso
    surprised by the note:
    Note: These code fragments do not derive from any of the sampleapplications
    that ship with WebLogic Server. They merely illustrate the use of the
    UserTransaction object within an RMI application.
    The above note suggests that there is no sample code available.
    Is there anyone who successfully had RMI-IIOP applications (servers)
    participating in distributed transactions?
    Is there any sample code that illustrates RMI-IIOP applications(servers)
    participating in distributed transactions?
    If anyone thinks that this should work I will post my code that does not
    work.
    Regards,
    Dan Cimpoesu

  • Again: RMI-IIOP Problem !

    Dear Eduardo,
    this bug doesn't seem to be fixed yet, neither
    with service pack 3 nor 4 !
    Even worse, with service pack 4 Weblogic
    doesn't return from the method call, it simply
    hangs up in some way !
    Any suggestions ?
    Thank you,
    Reinhold Biedermann
    Eduardo Ceballos wrote:
    It's a bug, alright.
    It's fixed in service pack 3, due out in the first week of June, or soI'm told.
    >
    Reinhold Biedermann wrote:
    Hello,
    RMI-IIOP worked fine with Weblogic 5.1
    so far, until I tried the following:
    Assuming the interface Address and the
    value-object AddressValue, the client-side ....
    >public interface Address {
    public void setCity(String city);
    public String getCity();
    public void setStreet(String street);
    public String getStreet();
    public class AddressValue extends Object implements Address,
    Serializable {
    private String city = "";
    private String street = "";
    public AddressValue() { }
    public String getCity() {   return city;  }
    public String getStreet() {   return street;  }
    public void setCity(String city) {    this.city = city;   }
    public void setStreet(String street) {   this.street = street;  }
    >.... RMI-IIOP call of the Stateless Session Bean's
    business method retrieveAddress() results in ....
    >public Address retrieveAddress(String primaryKey) {
    Address address = new AddressValue();
    // filling address with the according values !
    address.setStreet("street of primaryKey");
    address.setCity("city of primaryKey");
    return address;
    >... the error message:
    >java.lang.NullPointerException
    at
    com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:950)
    >>
    at
    in.tum.de.gps.server.process._AddressActivities_Stub.retrieveAddress(Unknown
    Source)
    at in.tum.de.gps.client.TestClient.main(TestClient.java:72)
    >I'm simply getting nothing ! What's the matter ?
    The property "enable-call-by-reference" has already
    been set to 'false' !
    J2EE Server can handle this, is WebLogic using
    a different IIOP than SUN ?
    There are no problem with WebLogic, when
    changing the business method from
    "public Address retrieveAddress(String primaryKey)"
    to
    "public AddressValue retrieveAddress(String primaryKey)"
    , but that's not object-oriented !
    many thanks,
    Reinhold Biedermann

    We (actually, just me, I guess) have our wires crossed...
    You are correct in that you have every reason to expect a signature that returns an interface to support marshaling of any concrete manifestation of that interface.
    The bug fix was re-scheduled from SP3 to 4 and then into the (them imminent) 5.1.1 release... I will investigate what release vehicle it is languishing in and report back to this list.
    The shame of it is that I found and fixed that bug quite a while ago...
    Reinhold Biedermann wrote:
    Dear Eduardo,
    this bug doesn't seem to be fixed yet, neither
    with service pack 3 nor 4 !
    Even worse, with service pack 4 Weblogic
    doesn't return from the method call, it simply
    hangs up in some way !
    Any suggestions ?
    Thank you,
    Reinhold Biedermann
    Eduardo Ceballos wrote:
    It's a bug, alright.
    It's fixed in service pack 3, due out in the first week of June, or soI'm told.
    Reinhold Biedermann wrote:
    Hello,
    RMI-IIOP worked fine with Weblogic 5.1
    so far, until I tried the following:
    Assuming the interface Address and the
    value-object AddressValue, the client-side ....
    >public interface Address {
    public void setCity(String city);
    public String getCity();
    public void setStreet(String street);
    public String getStreet();
    public class AddressValue extends Object implements Address,
    Serializable {
    private String city = "";
    private String street = "";
    public AddressValue() { }
    public String getCity() {   return city;  }
    public String getStreet() {   return street;  }
    public void setCity(String city) {    this.city = city;   }
    public void setStreet(String street) {   this.street = street;  }
    >.... RMI-IIOP call of the Stateless Session Bean's
    business method retrieveAddress() results in ....
    >public Address retrieveAddress(String primaryKey) {
    Address address = new AddressValue();
    // filling address with the according values !
    address.setStreet("street of primaryKey");
    address.setCity("city of primaryKey");
    return address;
    >... the error message:
    >java.lang.NullPointerException
    at
    com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:950)
    at
    in.tum.de.gps.server.process._AddressActivities_Stub.retrieveAddress(Unknown
    Source)
    at in.tum.de.gps.client.TestClient.main(TestClient.java:72)
    >I'm simply getting nothing ! What's the matter ?
    The property "enable-call-by-reference" has already
    been set to 'false' !
    J2EE Server can handle this, is WebLogic using
    a different IIOP than SUN ?
    There are no problem with WebLogic, when
    changing the business method from
    "public Address retrieveAddress(String primaryKey)"
    to
    "public AddressValue retrieveAddress(String primaryKey)"
    , but that's not object-oriented !
    many thanks,
    Reinhold Biedermann

  • RMI/IIOP HelloWorld problem

    I saw this topic in an old thread but couldn't find the answer. My
    problem was the same, the client app was stuck at the line
    obj = nc.resolve(path);
    Could you post your solution if you know the answer to this problem.
    Thanks a lot.

    Yes, you are right. I'm currently using jdk1.3. Is there a fix or do I
    have to go back to jdk1.2? Thanks a lot.
    Regards,
    Eduardo Ceballos wrote:
    You must run under jdk 1.3.
    Jim Hurd wrote:
    I did not see the line
    Thu Aug 03 11:33:52 PDT 2000:<I> <WebLogicServer> IIOP subsystem
    enabled.
    I think that was the problem. How do I fix that?
    Thank you very much.
    Eduardo Ceballos wrote:
    I tried every combination of hostname/ip address I could think of,
    but I don't see that problem... could you confirm that the WLS log
    listen thread entry is... should be something like:
    Thu Aug 03 11:34:06 PDT 2000:<I> <ListenThread> Listening on port:
    7001
    Also, does the first line of your log say:
    Thu Aug 03 11:33:52 PDT 2000:<I> <WebLogicServer> IIOP subsystem
    enabled.
    Jim Hurd wrote:
    Hi Eduardo,
    I tried the rmi-iiop client SimpleHelloClient example that you
    posted (with hostname and port modified according to my setup)
    and I got this error while trying to get the InitialContext (at
    line Context ic = new InitialContext(env);
    Exception in thread "main" javax.naming.CommunicationException:
    Cannot connect to ORB. Root exception is
    org.omg.CORBA.COMM_FAILURE: minor code: 1 completed:
    Maybe
    at
    com.sun.corba.se.internal.iiop.IIOPConnection.purge_calls(Unknown
    Source)
    at
    com.sun.corba.se.internal.iiop.ReaderThread.run(Unknown Source)
    Here is my setup
    env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    env.put("java.naming.provider.url", "iiop://127.0.0.1:7001");
    Context ic = new InitialContext(env);
    Thanks a lot
    Eduardo Ceballos wrote:
    Here's the html version.. maybe clearer
    Eduardo Ceballos wrote:
    As I said, apparently, you are trying to compile the IDL
    client in java using the RMI client classes. THere are two
    problems with this:
    1-- you must compile the rmi class definitions into a
    directory that can be easily excluded from the class path at
    the time you compile the idl definitions.
    2-- the idl definitions and the resulting classes are useless
    wrt the rmi definitions and wls, so the resulting classes must
    be compiled into directories other than those used by wls and
    the rmi clients.
    Another way to look at this is as follows:
    To compile the rmi definitions, you do:
    set ORIGINALCLASSPATH=CLASSPATH
    set CLASSPATH=../fooclasses;$CLASSPATH
    javac -d ../fooclasses rmi/FooImpl.java
    Then,
    -- you compile the jrmp classes as:
    rmic -d ../jrmpclasses rmi.FooImpl
    -- you compile the weblogic classes as:
    java weblogic.rmic -d ../wlsclasses rmi.FooImpl
    that is, you are allowed to compile from the same
    implementation class so long as it is compliant
    -- you compile the rmi-iiop classes as:
    java weblogic.rmic -iiop -d ../rmiiiopclasses rmi.FooImpl
    that is, as with jrmp and wls, the rmi-iiop classes share the
    same base type definitions and implementation.
    However, the idl classes are another matter. To compile the
    idl classes, you must generate the idl, generate the java
    files and generate the idl class files into another, separate
    directory, one which does not include any of ../fooclasses,
    ../jrmpclasses, ../wlsclasses or ../rmiiiopclasses
    directories.
    That is,
    java weblogic.rmic -idlDirtecory ../idl ...
    set CLASSPATH=ORIGINALCLASSPATH
    set CLASSPATH=../idlclasses;CLASSPATH
    cd ../idl
    idl2java rmi/Foo.idl
    javac -d ../idl rmi/*.java
    Hope this helps...
    "Hallam, David [CAR:5e10:EXCH]" wrote:
    The problem you are having is that the compiler is pickingup another copy of HelloWorld... see if you can run the
    compiler with verbose turned on and find where it is getting
    the interface from... or try using javap...
    So, here is the output when I compile in verbose mode:
    D:\weblogic>javac -verbose -d %WL_HOME%\myserver\corbaclient
    examples\rmi_iiop\h
    ello\*.java
    [parsing started
    examples\rmi_iiop\hello\_HelloWorldStub.java]
    [parsing completed 160ms]
    [parsing started examples\rmi_iiop\hello\HelloClient.java]
    [parsing completed 30ms]
    [parsing started examples\rmi_iiop\hello\HelloImpl.java]
    [parsing completed 0ms]
    [parsing started examples\rmi_iiop\hello\HelloWorld.java]
    [parsing completed 10ms]
    [parsing started
    examples\rmi_iiop\hello\HelloWorldHelper.java]
    [parsing completed 0ms]
    [parsing started
    examples\rmi_iiop\hello\HelloWorldHolder.java]
    [parsing completed 0ms]
    [parsing started
    examples\rmi_iiop\hello\HelloWorldOperations.java]
    [parsing completed 0ms]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/ObjectImpl.class)]
    [loading D:\jdk1.3\jre\lib\rt.jar(java/lang/Object.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/Object.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/IDLEntity.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/Serializable.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/Delegate.class)]
    [loading D:\jdk1.3\jre\lib\rt.jar(java/lang/String.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/ObjectInputStream.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/ObjectOutputStream.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CosNaming/NameComponent.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CosNaming/NamingContextHelper.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CosNaming/NamingContext.class)]
    [loading D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/ORB.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/rmi/RemoteException.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/lang/Exception.class)]
    [loading D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/Any.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/TypeCode.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/InputStream.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/OutputStream.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/Streamable.class)]
    [checking examples.rmi_iiop.hello._HelloWorldStub]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/ApplicationException.cl
    ass)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/lang/Throwable.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/MARSHAL.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/SystemException.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/lang/RuntimeException.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CORBA/portable/RemarshalException.clas
    s)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/InputStream.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/IOException.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/OutputStream.class)]
    [loading D:\jdk1.3\jre\lib\rt.jar(java/lang/Error.class)]
    [wrote
    D:\web
    ogic\myserver\corbaclient\examples\rmi_iiop\hello\_HelloWorldStub.
    class]
    [checking examples.rmi_iiop.hello.HelloWorld]
    [wrote
    D:\web
    ogic\myserver\corbaclient\examples\rmi_iiop\hello\HelloWorld.class
    [checking examples.rmi_iiop.hello.HelloWorldOperations]
    [wrote
    D:\web
    ogic\myserver\corbaclient\examples\rmi_iiop\hello\HelloWorldOperat
    ions.class]
    [checking examples.rmi_iiop.hello.HelloClient]
    [loading D:\jdk1.3\jre\lib\rt.jar(java/lang/System.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/PrintStream.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/io/FilterOutputStream.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CosNaming/NamingContextOperations.clas
    s)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/BAD_PARAM.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CosNaming/NamingContextPackage/NotFoun
    d.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/UserException.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CosNaming/NamingContextPackage/CannotP
    roceed.class)]
    [loading
    D:\jdk1.
    \jre\lib\rt.jar(org/omg/CosNaming/NamingContextPackage/Invalid
    Name.class)]
    [wrote
    D:\web
    ogic\myserver\corbaclient\examples\rmi_iiop\hello\HelloClient.clas
    s]
    [checking examples.rmi_iiop.hello.HelloImpl]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/Policy.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/SetOverrideType.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/DomainManager.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/Context.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/NVList.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/NamedValue.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/ExceptionList.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/ContextList.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/Request.class)]
    examples\rmi_iiop\hello\HelloImpl.java:12:
    examples.rmi_iiop.hello.HelloImpl sho
    uld be declared abstract; it does not define
    isa(java.lang.String) in
    examples
    .rmi_iiop.hello.HelloImpl
    public class HelloImpl implements HelloWorld {
    ^
    [loading
    D:\jdk1.3\jre\lib\rt.jar(javax/naming/Context.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(javax/naming/InitialContext.class)]
    [loading D:\jdk1.3\jre\lib\rt.jar(javax/naming/Name.class)]
    [loading
    D:\jdk1.3\jre\lib\rt.jar(java/lang/Comparable.class)]
    [checking examples.rmi_iiop.hello.HelloWorldHelper]
    [checking examples.rmi_iiop.hello.HelloWorldHolder]
    [total 1301ms]
    1 error
    [att1.html]

  • Exception while getting the server instance. Stateless bean problem

    Hi,
    New to OC4J, I'm moving an ear that was running ok under jboss.
    1- The wep app deploys. This is a piece of code inside the init() method of a struts plugin:
         System.out.println("0");
         AddressFacadeHome addressFacadeHome = HomeFactory.getAddressFacadeHome();
         System.out.println("1.0");
         AddressFacade addressFacade = addressFacadeHome.create();
         System.out.println("1.5");
    2- The code is run when the web app is initialized. This is the error message I get. system.out show that the error occurs on addressFacadeHome.create().
    AddressFacade is a remote/local stateless bean. HomeFactory returns the jndi lookup/narrow of the remote object.
    0
    1.0
    caught exception while getting the server instance null
    java.lang.NullPointerException
    com.evermind.security.User com.evermind.server.ThreadState.getCurrentUser()
    ThreadState.java:637
    com.evermind.security.User com.evermind.server.ThreadState.getUser()
    ThreadState.java:371
    fda.common.address.ejb.interfaces.AddressFacade AddressFacadeHome_StatelessSessionHomeWrapper7.create(
    AddressFacadeHome_StatelessSessionHomeWrapper7.java:66
    void fda.web.oaa.struts.plugin.ApplicationInit.init(org.apache.struts.action.ActionServlet, org.apache
    .struts.config.ModuleConfig)
    void org.apache.struts.action.ActionServlet.initModulePlugIns(org.apache.struts.config.ModuleConfig)
    ActionServlet.java:1105
    void org.apache.struts.action.ActionServlet.init()
    ActionServlet.java:468
    void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
    GenericServlet.java:258
    com.evermind.server.http.ServletInstanceInfo com.evermind.server.http.HttpApplication.loadServlet(com.
    evermind.util.ByteString)
    HttpApplication.java:1956
    com.evermind.server.http.ServletInstanceInfo com.evermind.server.http.HttpApplication.findServlet(com.
    evermind.util.ByteString)
    HttpApplication.java:4355
    void com.evermind.server.http.HttpApplication.initPreloadServlets()
    HttpApplication.java:4455
    void com.evermind.server.http.HttpApplication.initDynamic(com.evermind.server.http.HttpApplicationConf
    ig)
    HttpApplication.java:662
    void com.evermind.server.http.HttpApplication.<init>(com.evermind.server.Application, com.evermind.ser
    ver.http.HttpSite, com.evermind.server.http.HttpApplicationConfig, java.lang.String, java.lang.String, boolean
    My guess is that it's a jaas issue (because i see security and getCurrentUser), but at init time, no user is authenticated.
    Any clue would be very much appreciated. Let me know if I can provide anything else, such as deployment descriptors.
    Thanks,
    Christophe.

    After spending some time on this, I looked at the source code for com.evermind.server.ThreadState
    This is the code that throws the exception:
    if(applicationThread != null && applicationThread.httpHandler != null && applicationThread.servletInfo != null)
    try
    server = applicationThread.httpHandler.request.getApplication().getApplication().getServer();
    catch(Throwable t)
    System.out.println("caught exception while getting the server instance " + t.getMessage());
    t.printStackTrace(System.out);
    It looks like this method expects a httpRequest, and would find null because I'm in the servlet.init()
    (at least, that's my interpretation)
    I tested my code (the remoteFacade.create()) inside of a jsp, and it worked...
    So, the next logical question is:
    Can I make EJB calls from within the init method of a servlet? (or more specifically from a struts plugin, which I believe should be more or less the same thing)
    If so, do I need to take extra steps?
    Again, any experience/help on this will be much appreciated.
    Thanks,
    Christophe.

  • Is there any sample RMI-IIOP application using distributed transactions

    Hi,
    Based on the links below:
    http://e-docs.bea.com/wls/docs61/jta/trxrmi.html#1018506
    http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1067532
    It appears that is possible to have distributed transactions across RMI-IIOP
    clients and RMI-IIOP applications (servers).
    I am surprised by the note:
    Note: These code fragments do not derive from any of the sample applications
    that ship with WebLogic Server. They merely illustrate the use of the
    UserTransaction object within an RMI application.
    The above note suggests that there is no sample code available.
    Is there any sample code that illustrates RMI-IIOP applications (servers)
    participating in distributed transactions?
    Regards,
    Dan Cimpoesu

    Transaction examples for IIOP are in the works for the next release.
    "Dan Cimpoesu" <[email protected]> wrote:
    Hi,
    Based on the links below:
    http://e-docs.bea.com/wls/docs61/jta/trxrmi.html#1018506
    http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1067532
    It appears that is possible to have distributed transactions across RMI-IIOP
    clients and RMI-IIOP applications (servers).
    I am surprised by the note:
    Note: These code fragments do not derive from any of the sample applications
    that ship with WebLogic Server. They merely illustrate the use of the
    UserTransaction object within an RMI application.
    The above note suggests that there is no sample code available.
    Is there any sample code that illustrates RMI-IIOP applications (servers)
    participating in distributed transactions?
    Regards,
    Dan Cimpoesu

  • Problems running a simple RMI

    Hi there,
    I have had alot of problems running a small RMI program.
    It has now boiled down to a java.lang.NoClassDefFoundError
    when i try to use my policy file.
    The program complies, when i run javac *.java
    It also creates the stub, when i run rmic.
    I have trawled alot of forums and the closest answer i got was "add your classpath".
    As im a student of java, this does not really tell me much.
    The class/java files are in
    C:\Documents and Settings\MONDARIZ\workspace\RmiHello\server
    The policy file is also in the folder.
    I must add, that the program is from an example, so i would not think there is any coding errors.
    Also when i run it en eclipse, i get "Hello server failed: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)"
    So it seems something is running.

    The answer you found is correct. Java needs to know where to find the class files for execution.
    For starters, use the environment variable CLASSPATH. Set the value to:
    C:\Documents and Settings\MONDARIZ\workspace\RmiHello\server
    This way whatever you run (RMI Registry, Server, Client) has the proper class path. When you get everything running ok, then you can look into other methods of specifying where the class files are found.
    Eclipse, as well as command line Java starts, need to find the policy file. Set up this:
    -Djava.security.policy=C:\Documents and Settings\MONDARIZ\workspace\RmiHello\server\your_policy_file.xxx

  • Problem of running rmi applet and client for Javacard 3.0.2 Connected

    Need help for running rmi application for Java Card 3.0.2 connected version. I am trying to move a working rmi applet & client from 3.0.2 Classic version to Connected version. Then I found that they are so different and I have no idea how to run my application :(
    Here are what I have done:
    - I have modified the Classic HelloWorld applet to an rmi applet. It is OK when I build and run the application in netbeans. The Applet can be selected successfully.
    My problems are:
    - How to connect a rmi client to the rmi applet? Here are what I have done:
    + Run rmi applet in netbeans
    + Run 'rmic' command to generate stub
    + Run rmiregistry outside of netbeans
    + Build and run rmi client application outside of netbeans by typing "ant all"
    However, the rmi client was not able to connect to the applet:
    [java] java.net.ConnectException: Connection refused: connect
    Would this be a problem of netbeans? Could someone tell me how to run rmi applet/client within or outside netbeans. Thanks a lot!

    Well finally I figured out that CREF-emulators (from JCDK 2.2.1, 2.2.2, 3.0.1 classic) do not support cryptographic extensions at all.
    BUT JCWDE(from JCDK 2.2.1, 2.2.2) - support, but this kind of simulator quite hard to use, because it does not have state between launches.
    About CJCRE(from JCDK 3.0.1 connected) - still don't know, seems not support cryptographic extensions.

  • Problem running JAXB sample applications

    hi,
    I have been trying to run the JAXB sample applications provided with JWSDP1.1
    Class Paths etc are set as follows as specified :
    set JAVA_HOME=C:\Program Files\jdk1.3.1_03
    set JWSDP_HOME=C:\Program Files\jwsdp-1.1
    set JAXB_HOME=%JWSDP_HOME%\jaxb-1.0
    set JAXB_LIBS=%JAXB_HOME%\lib
    set JAXP_LIBS=%JWSDP_HOME%\jaxp-1.2.2\lib
    set JWSDP_LIBS=%JWSDP_HOME%\jwsdp-shared\lib
    set PATH=%JAXB_HOME%\bin;%JWSDP_HOME%\jwsdp-shared\bin;%PATH%
    set CLASSPATH=%JAXB_LIBS%\jaxb-api.jar;%JAXB_LIBS%\jaxb-ri.jar;%JAXB_LIBS%\jaxb-xjc.jar;%JAXB_LIBS%\jaxb-libs.jar;%JAXP_LIBS%\jaxb-api.jar;%JAXP_LIBS%\endorsed\xercesImpl.jar;%JAXP_LIBS%\endorsed\xalan.jar;%JAXP_LIBS%\endorsed\sax.jar;%JAXP_LIBS%\endorsed\dom.jar;%JWSDP_LIBS%\jax-qname.jar;%JWSDP_LIBS%namespace.jar;.
    cd %JAXB_HOME%\examples\users-guide\SampleApp1
    xjc.bat po.xsd -p primer.po
    javac Main.java primer\po\*.java primer\po\impl\*.java
    I keep running into the following error message at this stage :
    cannot access javax.xml.transform.Source
    file javax\xml\transform\Source.class not found
    (PurchaseOrder)u.unmarshal(new FileInputStream("po.xml"));
    Help greatly appreciated!! Thanks

    well, i think i don't see the jaxp-api.jar in you classpath.
    (javax.xml.transform.Source is in this jar)
    you did put the jaxb-api.jar in the classpath but this is not the same one (obviously!)

  • Problem running Java client of EJB deployed on WebSphere

    Hi,
    I am using websphere studio 5.1.2 with fix pack 3. I have a sample Stateless Session Bean (EJB) deployed and running on websphere.
    I wrote a small Java client program as below.
    import java.util.Hashtable;
    import HelloJavaHome;
    import HelloJava;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.ejb.EJBHome;
    import javax.ejb.EJBObject;
    public class RemoteConn {
    public static void main(String[] ar) throws Exception{
    String greeting = "";
    try{
    Hashtable env = new Hashtable();
    //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ws.naming.util.WsnInitCtxFactory");
    //env.put(Context.PROVIDER_URL, "corbaloc:iiop:myhost.mycompany.com:2809/NameServiceCellPersistentRoot");
    env.put(Context.PROVIDER_URL, "iiop://localhost:2809");
    System.out.println("Before creating context ");
    InitialContext initContext = new InitialContext(env);
    System.out.println("Before looking up HelloJavaHome.");
    //Object obj = initContext.lookup("java:comp/env/ejb/HelloJavaHome");
    Object obj = initContext.lookup("ejb/HelloJavaHome");
    System.out.println("After lookup javahome.");
    HelloJavaHome home = (HelloJavaHome) javax.rmi.PortableRemoteObject.narrow(obj, HelloJavaHome.class);
    HelloJava remote = home.create();
    greeting = remote.getGreeting("John");
    catch(Exception e){
    e.printStackTrace();
    System.out.println("Greeting::"+ greeting);
    I did not have any problem if I write and run this client from Websphere studio environment..
    However its giving lot of compilation and runtime errors when I tried to run from command line.
    I could eliminated compilation errors by setting the below jar files in the classpath.
    testclient.jar; (client jar of my EJB)
    j2ee.jar;
    naming.jar;ras.jar;
    wsexception.jar;
    bootstrap.jar;
    namingclient.jar;
    websphere.jar;server.jar;
    ejbcontainer.jar;
    ecutils.jar;
    Now it is throwing runtime error after the statement, "Before looking up HelloJavaHome.", has printed. Here is the stack trace of exception ..
    Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.CORBA.iiop.GlobalORBFactory
    at com.ibm.ejs.oa.EJSORBImpl.class$(EJSORBImpl.java:44)
    at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:195)
    at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:93)
    at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:65)
    at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:385)
    at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:284)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:369)
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:112)
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:422)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:143)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at RemoteEJBConn.main(RemoteEJBConn.java:38)
    I appreciate if sombody could help me ASAP fixing this problem.
    Thanks in advance.

    Try using the IBM JVM (theres one shipped with WebSphere in websphere_home\AppServer\java
    Also include idl.jar and ffdc.jar on the classpath

  • How write rmi-iiop over ssl with weblogic server 6.1?

    Hello,
    I have written an appication like this:
    - An EJB server running on Weblogic server 6.1
    (named: BankServerHome)
    -A java client calling the BankServer.
    Platform: windows 2000 - jdk1.4
    Now I want to secure the communication with SSL protocol.
    I have done this:
    -generate a key peer with weblogic service named certificate.
    -send the CSR to a CA and place the answer into the weblogic
    server certificate directory.
    -update path for ServerCertificateChainFileName,
    ServerCertificateFileName, ServerKeyFileName into config.xml.
    -launch weblogicServer
         -> server certificate is recognized
         -> listening port 7001 and 7002.
    (-stop weblogicServer!)
    At now, all is all right, errors come hereafter:
    Then I follow the guideline "Programming weblogic Security" (version of 30/07/2001).
    "To use RMI over IIOP over SSL with a Java client, do the following:
    2. Extend the java.rmi.server.RMISocketFactory class to handle SSL socket
    connections. Be sure to specify the port on which WebLogic Server listens for
    SSL connections. For an example of a class that extends the
    java.rmi.server.RMISocketFactory class, see Listing 4-22.
    3. Run the ejbc compiler with the -d option.
    4. Add your extension of the java.rmi.server.RMISocketFactory class to the
    CLASSPATH of the Java client.
    5. Use the following command options when starting the Java client:
    -xbootclasspath/a:%CLASSPATH%
    -Dorg.omg.CORBA.ORBSocketFactoryClass=implementation of java.rmi.server.RMISocketFactory
    -Dssl.certs=directory location of digital certificate for Java client
    -Dssl.key=directory location of private key for Java client"
    At step 3. I found into documentation that -d is linked to a directory name.
    When I run ejbc with this option -d I have the message:
    "ERROR: You must specify an output directory or jar with the -d option to weblogic.ejbc."
    % So what option can I use to run ejbc for secure usage?
    At step 5. Whatever I write for -Dorg.omg.CORBA.ORBSocketFactoryClass,
    this pointed class is not instanciated.
    Then I can not create a socket with my client.
    The folowing exception is raised:
    javax.naming.CommunicationException [Root exception is java.net.ConnectException:
    No server found at T3S://localhost:7002]
    So, my questions are:
    % Why -Dorg.omg.CORBA.ORBSocketFactoryClass must be known by the client and not
    the server?
    My java client part, managing connection is:
    -------------------BEGIN OF CONNECTION MANAGER-------------------
    Properties env = new Properties ();
    // Shouldn't have to do this, but for now you must
    if ( factory.equals ("weblogic.jndi.WLInitialContextFactory") ) {
    env.put ("java.naming.provider.url", "t3s://localhost:7002");
    } else {
    env.put ("java.naming.provider.url", "rmi://localhost:7002");
    InitialContext context = new InitialContext (env);
    BankSessionServerHome bssh = (BankServerHome) context.lookup("BankServerHome");
    BankServer = bssh.create();
    -------------------END OF CONNECTION MANAGER-------------------
    % What is the code for the java client allowing connection with the ejb?
    % And better, can I have a sample example for rmi-iiop over ssl?
    (...wlserver6.1\samples\examples\iiop\ejb\stateless\rmiclient\client.java do not
    speak ssl!)
    Any help will be appreciate from you...
    Best Regards.
    Oliver

    "oliver" <[email protected]> writes:
    First off 1.4 isn't supported as yet. That is probably part of the problem.
    You also must use a corba URL from the client in order for this to work for instance:
    If you are using WLInitialContextFactory:
    corbaloc:iiop:localhost:7001/NameService
    If you are using CNCtxFactory:
    iiop://localhost:7001
    Using rmi: is the wrong thing to do - that will use jrmp or t3.
    However, I suggest that you raise a call with support since there is
    some other trickiness with getting SSL working. We hope to have this
    much improved in SP2.
    andy
    Hello,
    I have written an appication like this:
    - An EJB server running on Weblogic server 6.1
    (named: BankServerHome)
    -A java client calling the BankServer.
    Platform: windows 2000 - jdk1.4
    Now I want to secure the communication with SSL protocol.
    I have done this:
    -generate a key peer with weblogic service named certificate.
    -send the CSR to a CA and place the answer into the weblogic
    server certificate directory.
    -update path for ServerCertificateChainFileName,
    ServerCertificateFileName, ServerKeyFileName into config.xml.
    -launch weblogicServer
         -> server certificate is recognized
         -> listening port 7001 and 7002.
    (-stop weblogicServer!)
    At now, all is all right, errors come hereafter:
    Then I follow the guideline "Programming weblogic Security" (version of 30/07/2001).
    "To use RMI over IIOP over SSL with a Java client, do the following:
    2. Extend the java.rmi.server.RMISocketFactory class to handle SSL socket
    connections. Be sure to specify the port on which WebLogic Server listens for
    SSL connections. For an example of a class that extends the
    java.rmi.server.RMISocketFactory class, see Listing 4-22.
    3. Run the ejbc compiler with the -d option.
    4. Add your extension of the java.rmi.server.RMISocketFactory class to the
    CLASSPATH of the Java client.
    5. Use the following command options when starting the Java client:
    -xbootclasspath/a:%CLASSPATH%
    -Dorg.omg.CORBA.ORBSocketFactoryClass=implementation of java.rmi.server.RMISocketFactory
    -Dssl.certs=directory location of digital certificate for Java client
    -Dssl.key=directory location of private key for Java client"
    At step 3. I found into documentation that -d is linked to a directory name.
    When I run ejbc with this option -d I have the message:
    "ERROR: You must specify an output directory or jar with the -d option to weblogic.ejbc."
    % So what option can I use to run ejbc for secure usage?
    At step 5. Whatever I write for -Dorg.omg.CORBA.ORBSocketFactoryClass,
    this pointed class is not instanciated.
    Then I can not create a socket with my client.
    The folowing exception is raised:
    javax.naming.CommunicationException [Root exception is java.net.ConnectException:
    No server found at T3S://localhost:7002]
    So, my questions are:
    % Why -Dorg.omg.CORBA.ORBSocketFactoryClass must be known by the client and not
    the server?
    My java client part, managing connection is:
    -------------------BEGIN OF CONNECTION MANAGER-------------------
    Properties env = new Properties ();
    // Shouldn't have to do this, but for now you must
    if ( factory.equals ("weblogic.jndi.WLInitialContextFactory") ) {
    env.put ("java.naming.provider.url", "t3s://localhost:7002");
    } else {
    env.put ("java.naming.provider.url", "rmi://localhost:7002");
    InitialContext context = new InitialContext (env);
    BankSessionServerHome bssh = (BankServerHome) context.lookup("BankServerHome");
    BankServer = bssh.create();
    -------------------END OF CONNECTION MANAGER-------------------
    % What is the code for the java client allowing connection with the ejb?
    % And better, can I have a sample example for rmi-iiop over ssl?
    (...wlserver6.1\samples\examples\iiop\ejb\stateless\rmiclient\client.java do not
    speak ssl!)
    Any help will be appreciate from you...
    Best Regards.
    Oliver

  • Noob Question: Problem with Persistence in First Entity Bean

    Hey folks,
    I have started with EJB3 just recently. After reading several books on the topic I finally started programming myself. I wanted to develop a little application for getting a feeling of the technology. So what I did is to create a AppClient, which calls a Stateless Session Bean. This Stateless Bean then adds an Entity to the Database. For doing this I use Netbeans 6.5 and the integrated glassfish. The problem I am facing is, that the mapping somehow doesnt work, but I have no clue why it doesn't work. I just get an EJBException.
    I would be very thankfull if you guys could help me out of this. And don't forget this is my first ejb project - i might need a very detailed answer ... I know - noobs can be a real ....
    So here is the code of the application. I have a few methods to do some extra work there, you can ignore them, there are of no use at the moment. All that is really implemented is testConnection() and testAddCompany(). The testconnection() Methode works pretty fine, but when it comes to the testAddCompany I get into problems.
    Edit:As I found out just now, there is the possibility of Netbeans to add a Facade pattern to an Entity bean. If I use this, everythings fine and it works out to be perfect, however I am still curious, why the approach without the given classes by netbeans it doesn't work.
    public class Main {
        private EntryRemote entryPoint = null;
        public static void main(String[] args) throws NamingException {
            Main main = new Main();
            main.runApplication();
        private void runApplication()throws NamingException{
            this.getContext();
            this.testConnection();
            this.testAddCompany();
            this.testAddShipmentAddress(1);
            this.testAddBillingAddress(1);
            this.testAddEmployee(1);
            this.addBankAccount(1);
        private void getContext() throws NamingException{
            InitialContext ctx = new InitialContext();
            this.entryPoint = (EntryRemote) ctx.lookup("Entry#ejb.EntryRemote");
        private void testConnection()
            System.err.println("Can Bean Entry be reached: " + entryPoint.isAlive());
        private void testAddCompany(){
            Company company = new Company();
            company.setName("JavaFreaks");
            entryPoint.addCompany(company);
            System.err.println("JavaFreaks has been placed in the db");
        }Here is the Stateless Session Bean. I added the PersistenceContext, and its also mapped in the persistence.xml file, however here the trouble starts.
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(mappedName="Entry")
    public class EntryBean implements EntryRemote {
        @PersistenceContext(unitName="PersistenceUnit") private EntityManager manager;
        public boolean isAlive() {
            return true;
        public boolean addCompany(Company company) {
            manager.persist(company);
            return true;
        public boolean addShipmentAddress(long companyId) {
            return false;
        public boolean addBillingAddress(long companyId) {
            return false;
        public boolean addEmployee(long companyId) {
            return false;
        public boolean addBankAccount(long companyId) {
            return false;
    }That you guys and gals will have a complete overview of whats really going on, here is the Entity as well.
    package ejb;
    import java.io.Serializable;
    import javax.persistence.*;
    @Entity
    @Table(name="COMPANY")
    public class Company implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        @Column(name="COMPANY_NAME")
        private String name;
        public Long getId() {
            return id;
        public void setId(Long id) {
            this.id = id;
       public String getName() {
            return name;
        public void setName(String name) {
            this.name = name;
            System.err.println("SUCCESS:  CompanyName SET");
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (id != null ? id.hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Company)) {
                return false;
            Company other = (Company) object;
            if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
                return false;
            return true;
        @Override
        public String toString() {
            return "ejb.Company[id=" + id + "]";
    }And the persistence.xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
      <persistence-unit name="PersistenceUnit" transaction-type="JTA">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <jta-data-source>jdbc/sample</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
          <property name="toplink.ddl-generation" value="create-tables"/>
        </properties>
      </persistence-unit>
    </persistence>And this is the error message
    08.06.2009 10:30:46 com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNUNG: ACC003: Ausnahmefehler bei Anwendung.
    javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.; nested exception is:
            javax.transaction.RollbackException: Transaktion für Zurücksetzung markiert.
            at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
            at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
            at ejb.__EntryRemote_Remote_DynamicStub.addCompany(ejb/__EntryRemote_Remote_DynamicStub.java)I spend half the night figuring out whats wrong, however I couldnt find any solution.
    If you have any idea pls let me know
    Best regards and happy coding
    Taggert
    Edited by: Taggert_77 on Jun 8, 2009 2:27 PM

    Well I don't understand this. If Netbeans created a Stateless Session Bean as a facade then it works -and it is implemented as a CMP, not as a BMP as you suggested.
    I defenitely will try you suggestion, just for curiosity and to learn the technology, however I dont have see why BMP will work and CMP won't.
    I also don't see why a stateless bean can not be a CMP. As far as I read it should not matter. Also on the link you sent me, I can't see anything related to that.
    Maybe you can help me answering these questions.
    I hope the above lines don't sound harsh. I really appreciate your input.
    Best regards
    Taggert

  • Stateless bean giving error when deployed through j2ee 1.3RI

    I have written a simple stateless bean and deployed through j2ee 1.3 RI
    Context initial = new InitialContext(h);
    Object obj = initial.lookup("SampleObject"); // SampleObject -jndi name
    SampleHome home = (SampleHome)PortableRemoteObject.narrow(obj, SampleHome.class);
    But when running the Client , getting the error
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PoartableRemoteObject.narrow(Unknown Source)
    at javax.rmi.PortableRemoteObject.narrow(Unknown Source)     at SampleClient.main(SampleClient.java:27)
    Is it a system error or what

    Hi sessionbean,
    The most common cause of this exception is when the RMI-IIOP stubs are not found within the client's classpath. The client stubs are returned from the deployment step.
    Also, it's better to use the no-arg initial context constructor "new InitialContext()" and let the J2EE 1.3 RI code bootstrap the correct naming service.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How write rmi-iiop over ssl with weblogic server 6.1 - No server found

    //New
    Hello,
    I have written an appication like this:
    - An EJB server running on Weblogic server 6.1
    (named: BankServerHome)
    -A java client calling the BankServer.
    Platform: windows 2000 - jdk1.3
    Now I want to secure the communication with SSL protocol.
    I have done this:
    -generate a key peer with weblogic service named certificate.
    -send the CSR to a CA and place the answer into the weblogic
    server certificate directory.
    -update path for ServerCertificateChainFileName,
    ServerCertificateFileName, ServerKeyFileName into config.xml.
    -launch weblogicServer
         -> server certificate is recognized
         -> listening port 7001 and 7002.
    (-stop weblogicServer!)
    At now, all is all right, errors come hereafter:
    Then I follow the guideline "Programming weblogic Security" (version of 30/07/2001).
    "To use RMI over IIOP over SSL with a Java client, do the following:
    2. Extend the java.rmi.server.RMISocketFactory class to handle SSL socket
    connections. Be sure to specify the port on which WebLogic Server listens for
    SSL connections. For an example of a class that extends the
    java.rmi.server.RMISocketFactory class, see Listing 4-22.
    3. Run the ejbc compiler with the -d option.
    4. Add your extension of the java.rmi.server.RMISocketFactory class to the
    CLASSPATH of the Java client.
    5. Use the following command options when starting the Java client:
    -xbootclasspath/a:%CLASSPATH%
    -Dorg.omg.CORBA.ORBSocketFactoryClass=implementation of java.rmi.server.RMISocketFactory
    -Dssl.certs=directory location of digital certificate for Java client
    -Dssl.key=directory location of private key for Java client"
    At step 3. I found into documentation that -d is linked to a directory name.
    When I run ejbc with this option -d I have the message:
    "ERROR: You must specify an output directory or jar with the -d option to weblogic.ejbc."
    % So what option can I use to run ejbc for secure usage?
    At step 5. Whatever I write for -Dorg.omg.CORBA.ORBSocketFactoryClass,
    this pointed class is not instanciated.
    Then I can not create a socket with my client.
    The folowing exception is raised:
    javax.naming.CommunicationException [Root exception is java.net.ConnectException:
    No server found at T3S://localhost:7002]
    So, my questions are:
    % Why -Dorg.omg.CORBA.ORBSocketFactoryClass must be known by the client and not
    the server?
    My java client part, managing connection is:
    -------------------BEGIN OF CONNECTION MANAGER-------------------
    Properties env = new Properties ();
    // Shouldn't have to do this, but for now you must
    if ( factory.equals ("weblogic.jndi.WLInitialContextFactory") ) {
    env.put ("java.naming.provider.url", "t3s://localhost:7002");
    InitialContext context = new InitialContext (env);
    BankSessionServerHome bssh = (BankServerHome) context.lookup("BankServerHome");
    BankServer = bssh.create();
    -------------------END OF CONNECTION MANAGER-------------------
    I have also try
    env.put ("java.naming.provider.url", "corbaloc:iiop://localhost:7002");
    but it throws the following error
    javax.naming.InvalidNameException: url does not conatin !!!
    % What is the code for the java client allowing connection with the ejb?
    % And better, can I have a sample example for rmi-iiop over ssl?
    (...wlserver6.1\samples\examples\iiop\ejb\stateless\rmiclient\client.java do not
    speak ssl!)
    Any help will be appreciate from you...
    Best Regards.
    Oliver

    "oliver" <[email protected]> writes:
    The SSL support is poorly doc'd right now. We have fixed this and
    updated the way you do things in SP2. Please either wait for SP2 or
    contact support.
    andy
    I have written an appication like this:
    - An EJB server running on Weblogic server 6.1
    (named: BankServerHome)
    -A java client calling the BankServer.
    Platform: windows 2000 - jdk1.3
    Now I want to secure the communication with SSL protocol.
    I have done this:
    -generate a key peer with weblogic service named certificate.
    -send the CSR to a CA and place the answer into the weblogic
    server certificate directory.
    -update path for ServerCertificateChainFileName,
    ServerCertificateFileName, ServerKeyFileName into config.xml.
    -launch weblogicServer
         -> server certificate is recognized
         -> listening port 7001 and 7002.
    (-stop weblogicServer!)
    At now, all is all right, errors come hereafter:
    Then I follow the guideline "Programming weblogic Security" (version of 30/07/2001).
    "To use RMI over IIOP over SSL with a Java client, do the following:
    2. Extend the java.rmi.server.RMISocketFactory class to handle SSL socket
    connections. Be sure to specify the port on which WebLogic Server listens for
    SSL connections. For an example of a class that extends the
    java.rmi.server.RMISocketFactory class, see Listing 4-22.
    3. Run the ejbc compiler with the -d option.
    4. Add your extension of the java.rmi.server.RMISocketFactory class to the
    CLASSPATH of the Java client.
    5. Use the following command options when starting the Java client:
    -xbootclasspath/a:%CLASSPATH%
    -Dorg.omg.CORBA.ORBSocketFactoryClass=implementation of java.rmi.server.RMISocketFactory
    -Dssl.certs=directory location of digital certificate for Java client
    -Dssl.key=directory location of private key for Java client"
    At step 3. I found into documentation that -d is linked to a directory name.
    When I run ejbc with this option -d I have the message:
    "ERROR: You must specify an output directory or jar with the -d option to weblogic.ejbc."
    % So what option can I use to run ejbc for secure usage?
    At step 5. Whatever I write for -Dorg.omg.CORBA.ORBSocketFactoryClass,
    this pointed class is not instanciated.
    Then I can not create a socket with my client.
    The folowing exception is raised:
    javax.naming.CommunicationException [Root exception is java.net.ConnectException:
    No server found at T3S://localhost:7002]
    So, my questions are:
    % Why -Dorg.omg.CORBA.ORBSocketFactoryClass must be known by the client and not
    the server?
    My java client part, managing connection is:
    -------------------BEGIN OF CONNECTION MANAGER-------------------
    Properties env = new Properties ();
    // Shouldn't have to do this, but for now you must
    if ( factory.equals ("weblogic.jndi.WLInitialContextFactory") ) {
    env.put ("java.naming.provider.url", "t3s://localhost:7002");
    InitialContext context = new InitialContext (env);
    BankSessionServerHome bssh = (BankServerHome) context.lookup("BankServerHome");
    BankServer = bssh.create();
    -------------------END OF CONNECTION MANAGER-------------------
    I have also try
    env.put ("java.naming.provider.url", "corbaloc:iiop://localhost:7002");
    but it throws the following error
    javax.naming.InvalidNameException: url does not conatin !!!
    % What is the code for the java client allowing connection with the ejb?
    % And better, can I have a sample example for rmi-iiop over ssl?
    (...wlserver6.1\samples\examples\iiop\ejb\stateless\rmiclient\client.java do not
    speak ssl!)
    Any help will be appreciate from you...
    Best Regards.
    Oliver

Maybe you are looking for