Unable to compile RMI-IIOP C++ Example
I get this message when I try to compile the
HelloClient cpp example in WebLogic 5.1. I
am using VBC++ 4.1 and MSVC++ 6.0. The message
is:
Linking...
LINK : fatal error LNK1104: cannot open file "orb_rd.lib"
Brett Heroux
Andy Piper <[email protected]> wrote:
"Brett Heroux" <[email protected]> writes:
I get this message when I try to compile the
HelloClient cpp example in WebLogic 5.1. I
am using VBC++ 4.1 and MSVC++ 6.0. The message
is:
Linking...
LINK : fatal error LNK1104: cannot open file "orb_rd.lib"You need to add the visibroker lib directory to your link
line.
andyNot only that, also rename orb_r.lib to orb_rd.lib, and
similarly rename some other libraries.
Brett
Similar Messages
-
Re: Errors compiling the rmi-iiop example.
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 picking up 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.3\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.3\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.3\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.3\jre\lib\rt.jar(org/omg/CosNaming/NameComponent.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CosNaming/NamingContextHelper.class)]
[loading
D:\jdk1.3\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.3\jre\lib\rt.jar(org/omg/CORBA/portable/InputStream.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/portable/OutputStream.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/portable/Streamable.class)]
[checking examples.rmi_iiop.hello._HelloWorldStub]
[loading
D:\jdk1.3\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.3\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:\weblogic\myserver\corbaclient\examples\rmi_iiop\hello\_HelloWorldStub.
class]
[checking examples.rmi_iiop.hello.HelloWorld]
[wrote
D:\weblogic\myserver\corbaclient\examples\rmi_iiop\hello\HelloWorld.class
[checking examples.rmi_iiop.hello.HelloWorldOperations]
[wrote
D:\weblogic\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.3\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.3\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.3\jre\lib\rt.jar(org/omg/CosNaming/NamingContextPackage/CannotP
roceed.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CosNaming/NamingContextPackage/Invalid
Name.class)]
[wrote
D:\weblogic\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]test
"Hallam, David [CAR:5e10:EXCH]" wrote:
Eduardo,
These directions worked perfectly, thank-you. One point though, this is
COMPLETELY different to the directions on the index.html page in the
examples directory.
Regards,
David Hallam.
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 picking upanother 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.3\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.3\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.3\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.3\jre\lib\rt.jar(org/omg/CosNaming/NameComponent.class)]
[loading
D:\jdk1.
\jre\lib\rt.jar(org/omg/CosNaming/NamingContextHelper.class)]
[loading
D:\jdk1.3\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.3\jre\lib\rt.jar(org/omg/CORBA/portable/InputStream.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/portable/OutputStream.class)]
[loading
D:\jdk1.3\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
Developer Relations Engineer
BEA Support -
Errors compiling the rmi-iiop example.
Hello,
I have WebLogic Server 5.1, jdk1.3, Inprise's Visibroker for Java 4.0
and Visibroker for C++ 4.0 all on Windows NT.
I am following the steps on the index.html page in the
examples/rmi_iiop/hello directory in my weblogic directory. The errors
occur at step 5 of the section "Build the client".
The errors are output by the java compiler. They are:
examples\rmi_iiop\hello\_HelloWorld_Stub.java:17:
examples.rmi_iiop.hello._HelloWorld_Stub should be declared abstract; it
does not define bind() in examples.rmiiiop.hello._HelloWorld_Stub
public class HelloWorldStub extends javax.rmi.CORBA.Stub implements
HelloWorld {
^
examples\rmi_iiop\hello\HelloImpl.java:12:
examples.rmi_iiop.hello.HelloImpl should be declared abstract; it does
not define isa(java.lang.String) in examples.rmi_iiop.hello.HelloImpl
public class HelloImpl implements HelloWorld {
Are there issues with jdk1.3? Or have I misapplied some steps?
Any help would be greatly appreciated.
David Hallam
[email protected]The problem you are having is that the compiler is picking up 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.3\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.3\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.3\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.3\jre\lib\rt.jar(org/omg/CosNaming/NameComponent.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CosNaming/NamingContextHelper.class)]
[loading
D:\jdk1.3\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.3\jre\lib\rt.jar(org/omg/CORBA/portable/InputStream.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/portable/OutputStream.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CORBA/portable/Streamable.class)]
[checking examples.rmi_iiop.hello._HelloWorldStub]
[loading
D:\jdk1.3\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.3\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:\weblogic\myserver\corbaclient\examples\rmi_iiop\hello\_HelloWorldStub.
class]
[checking examples.rmi_iiop.hello.HelloWorld]
[wrote
D:\weblogic\myserver\corbaclient\examples\rmi_iiop\hello\HelloWorld.class
[checking examples.rmi_iiop.hello.HelloWorldOperations]
[wrote
D:\weblogic\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.3\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.3\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.3\jre\lib\rt.jar(org/omg/CosNaming/NamingContextPackage/CannotP
roceed.class)]
[loading
D:\jdk1.3\jre\lib\rt.jar(org/omg/CosNaming/NamingContextPackage/Invalid
Name.class)]
[wrote
D:\weblogic\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 -
Help!!!I can not pass the Logger example of Rmi-iiOP
I am using the j2sdk1.4.0 and j2sdkee1.3.1 as back ground.And use Win2000
I try the rmi-iiop example given by Sun.But it doesn't work.
Firstly , compile Logger.java LoggerHome.java LogMessage.java LoggerEJB.java to class
javac -classpath "c:\j2sdkee1.3.1\lib\j2ee.jar;c:\wytestejb\" Logger.java LoggerHome.java LogMessage.java LoggerEJB.java
that was ok.
Then I draw idl from that just like
rmic -idl -noValueMethods -classpath "c:\j2sdkee1.3.1\lib\j2ee.jar;c:\wytestejb\" Logger LoggerHome
then I got Logger.idl LoggerHome.idl javax\ejb\...idl java\lang\...idl
After that I create one directory named client.copying all idl file into it,I transfered idl to java using
idlj -i C:\j2sdk1.4.0\lib -i c:\wytestejb\client -i C:\j2sdkee1.3.1\lib -emitAll -fclient Logger.idl
idlj -i C:\j2sdk1.4.0\lib -i c:\wytestejb\client -i C:\j2sdkee1.3.1\lib -emitAll -fclient LoggerHome.idl
Then I got *.java such as Logger.java LoggerHome.java .....java java\lang\***.class javax\ejb\****.class
I put the LogClient.java in this directory and compile *.java like
C:\wytestejb\client>javac -classpath "c:\j2sdkee1.3.1\lib\j2ee.jar;c:\wytestejb\
client;c:\j2sdk1.4.0\lib;c:\j2sdk1.4.0\bin" *.java
And I got
c:\wytestejb\client\java\lang\_Exception.java:23: cannot resolve symbol
symbol : method _read (org.omg.CORBA.portable.InputStream)
location: class java.lang.Throwable
super._read (istream);
^
c:\wytestejb\client\java\lang\_Exception.java:28: cannot resolve symbol
symbol : method _write (org.omg.CORBA.portable.OutputStream)
location: class java.lang.Throwable
super._write (ostream);
^
LogClient.java:20: cannot resolve symbol
symbol : method println (java.lang.String)
location: interface java.io.PrintStream
System.out.println("Looking for: " + loggerHomeURL);
^
LogClient.java:38: cannot resolve symbol
symbol : method println (java.lang.String)
location: interface java.io.PrintStream
System.out.println("Logging...");
^
LogClient.java:47: cannot resolve symbol
symbol : method println (java.lang.String)
location: interface java.io.PrintStream
System.out.println("Done");
^
LogClient.java:59: cannot resolve symbol
symbol : method println (java.lang.String)
location: interface java.io.PrintStream
System.out.println("Args: corbaname URL of LoggerHome");
^
LogClient.java:66: cannot resolve symbol
symbol : method printStackTrace ()
location: class java.lang.Throwable
t.printStackTrace();
^
7 errors
C:\wytestejb\client>By the way
My java file is as
Logger.java
The file Logger.java is the enterprise bean's remote interface, and as such, it extends EJBObject . A remote interface provides the remote client view of an EJB object and defines the business methods callable by a remote client.
//Code Example 1: Logger.java
package ejbinterop;
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
* Accepts simple String log messages and prints
* them on the server.
public interface Logger extends EJBObject
* Logs the given message on the server with
* the current server time.
void logString(String message) throws RemoteException;
LoggerHome.java
The file LoggerHome.java extends EJBHome . The EJBHome interface must be extended by all EJB component's remote home interfaces. A home interface defines the methods that allow a remote client to create, find, and remove EJB objects, as well as home business methods that are not specific to an EJB instance.
//Code Example 2: LoggerHome.java
package ejbinterop;
import java.rmi.RemoteException;
import javax.ejb.EJBHome;
import javax.ejb.CreateException;
public interface LoggerHome extends EJBHome
Logger create() throws RemoteException, CreateException;
LoggerEJB.java
The file LoggerEJB.java contains the code for a session bean. A session bean is an enterprise bean that is created by a client and that usually exists only for the duration of a single client-server session. A session bean performs operations such as calculations or accessing a database for the client. In this example, the enterprise bean accepts simple String log messages from the client and prints them on the server.
//LoggerEJB.java
package ejbinterop;
import javax.ejb.*;
import java.util.*;
import java.rmi.*;
import java.io.*;
* Accepts simple String log messages and prints
* them on the server.
public class LoggerEJB implements SessionBean {
public LoggerEJB() {}
public void ejbCreate() {}
public void ejbRemove() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void setSessionContext(SessionContext sc) {}
* Logs the given message on the server with
* the current server time.
public void logString(String message) {
LogMessage msg = new LogMessage(message);
System.out.println(msg);
LogMessage.java
The file LogMessage.java takes the current date and time, creates a formatted String showing the message, and prints the message to the server.
//LogMessage.java
package ejbinterop;
import java.io.Serializable;
import java.util.Date;
import java.text.*;
* Simple message class that handles pretty
* printing of log messages.
public class LogMessage implements Serializable
private String message;
private long datetime;
* Constructor taking the message. This will
* take the current date and time.
public LogMessage(String msg) {
message = msg;
datetime = (new Date()).getTime();
* Creates a formatted String showing the message.
public String toString() {
StringBuffer sbuf = new StringBuffer();
DateFormat dformat
= DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
DateFormat.LONG);
FieldPosition fpos = new
FieldPosition(DateFormat.DATE_FIELD);
dformat.format(new Date(datetime), sbuf, fpos);
sbuf.append(": ");
sbuf.append(message);
return sbuf.toString();
//Code Example: LogClient.java
package ejbinterop;
import java.rmi.RemoteException;
import javax.rmi.*;
import java.io.*;
import javax.naming.*;
import javax.ejb.*;
* Simple Java RMI-IIOP client that uses an EJB component.
public class LogClient
* Given a corbaname URL for a LoggerHome,
* log a simple String message on the server.
public static void run(String loggerHomeURL)
throws CreateException, RemoveException,
RemoteException, NamingException
System.out.println("Looking for: " + loggerHomeURL);
// Create an InitialContext. This will use the
// CosNaming provider we will specify at runtime.
InitialContext ic = new InitialContext();
// Lookup the LoggerHome in the naming context
// pointed to by the corbaname URL
Object homeObj = ic.lookup(loggerHomeURL);
// Perform a safe downcast
LoggerHome home
= (LoggerHome)PortableRemoteObject.narrow(homeObj,
LoggerHome.class);
// Create a Logger EJB reference
Logger logger = home.create();
System.out.println("Logging...");
// Log our message
logger.logString("Message from a Java RMI-IIOP client");
// Tell the application server we won't use this
// EJB reference anymore
logger.remove();
System.out.println("Done");
* Simple main method to check arguments and handle
* exceptions.
public static void main(String args[])
try {
if (args.length != 1) {
System.out.println("Args: corbaname URL of LoggerHome");
System.exit(1);
LogClient.run(args[0]);
} catch (Throwable t) {
t.printStackTrace();
System.exit(1); -
RMI-IIOP Example for Java SE 6
Hi.
Can someone provide me an example (link or code) of how to write an RMI-IIOP remote object, bind it to jndi (glassfish) and then call it from within the glassfish application server (I'm calling from an EJB).
The guide available at http://java.sun.com/javase/6/docs/technotes/guides/rmi-iiop/tutorial.html is unfortunately not helpful because it the code there does not work when binding the remote object in glassfish JNDI (using empty InitialContext constructor) as opposed to the orbd daemon that is described in the guide.
Am I not allowed to bind RMI-IIOP objects in glassfish application server JNDI, i.e. do I have to use orbd?
Do you have to generate stubs for the remote objects in Java SE6? The tutorial says to do it but the exception I get on glassfish application server is not from the _<interface-name>Stub.java but rather from <interface-name>_DynamicStub.java.
Any help is greatly appreciated!Are you trying to create an RMI-IIOP server inside an
Application Server (Glassfish)?I'm not really sure about how it all works but I don't think so. I am exporting my Remote objects (using PortableRemoteObject) from a standalone Java SE client app. Relating this to normal RMI I had assumed that this automatically started an RMI-IIOP server on an anonomous port, although I now see that the javadoc says that the export method only "Makes a server object ready to receive remote calls.", whatever that means. So if calling the export method doesn't start an RMI-IIOP server then I'm guessing I would have to start one, and then yes, if possible, I would like to do it in glassfish and avoid starting up more applications.
I am guessing I am missing something fundamental here..
The tutorial uses the JNDI Registry (tnameserv). (and
it works fine)Is that what is automatically started when glassfish application server is started?
Have you looked into using a Portable Object Adapter?No, I have not. I want to keep it as simple and close to regular RMI though, so if possible I would like to avoid POA. -
RMI-IIOP client - CORBA Server
I already have a CORBA server in C++ which has already been written. I am trying to develop an RMI-IIOP client which would talk to this CORBA Server.
The CORBA server has several interfaces that I would like to use with my RMI-IIOP client. How do I proceed?? Can somebody give me an example of an RMI-IIOP client? Basically my question is: how do I take the IDL and build an RMI-IIOP client with it???Hello
I already have a CORBA server in C++ which has already
been written. I am trying to develop an RMI-IIOP
client which would talk to this CORBA Server.
The CORBA server has several interfaces that I would
like to use with my RMI-IIOP client. How do I
proceed?? Can somebody give me an example of an
RMI-IIOP client? Basically my question is: how do I
take the IDL and build an RMI-IIOP client with it???The steps to do are the following:
* Creating the Remote interface
* Using the rmic compiler to genarate the IDL and the client stub.
* Generating stub and skeleton of the C++ server using that IDL (the one you already made is no longer compatible)
* Bulding up the new C++ server
* Using a nameservice (tnameserver for example) and binding your server to that.
* Writing the RMI-IIOP client
I proceeded like this (using Visibroker 4.5 on the server side) and I was able to do it... but as you can see from my last post, I wasn't able to pass Strings from the client to the server.
Bye -
I got the rmi-iiop example code to work just fine, but I tried extending
it a little and strangeness ensues. Here's what I did:
I'm using a stock weblogic 6.0 install on solaris 8 (sparc). I added
the following new method to the Trader interface:
public void func(javax.naming.Name n) throws RemoteException;
and I added the implementation of that method to TraderBean like so:
public void func(javax.naming.Name n) {
System.out.prinltn("n [" + n + "]");
I then added a call to the new Trader function to the end of the
example() method in Client, just before the trader is removed:
try {
com.sun.jndi.ldap.LdapName lname =
new com.sun.jndi.ldap.LdapName("a=b");
trader.func(lname);
} catch (javax.naming.NamingException ne) {
ne.printStackTrace();
Then I compiled everything using the supplied build.sh, copied the
ejb_over_iiop.jar into config/mydomain/applications, and ran
startWebLogic.sh int the config/mydomain directory to start the server.
I then run the client like so (using the 1.3 java version included with
weblogic 6.0):
java -cp
/opt/bea/wlserver6.0/config/examples/clientclasses:/opt/bea/wlserver6.0/config/mydomain/applications:/opt/bea/wlserver6.0/lib/weblogic.jar
examples.rmi_iiop.ejb.rmi_iiop.Client iiop://localhost:7001
And I get the following output:
Beginning statelessSession.Client...
Creating a trader
Buying 100 shares of BEAS.
Buying 200 shares of MSFT.
Buying 300 shares of AMZN.
Buying 400 shares of HWP.
Selling 100 shares of BEAS.
Selling 200 shares of MSFT.
Selling 300 shares of AMZN.
Selling 400 shares of HWP.
There was an exception while creating and using the Trader.
This indicates that there was a problem communicating with the server:
java.rmi.RemoteException: CORBA UNKNOWN 0 No; nested exception is:
org.omg.CORBA.UNKNOWN: minor code: 0 completed: No
End statelessSession.Client...
Basically the call to the new method fails, and the server communication
error it produces doesn't provide much information. So question #1 is,
what's going on here?
And here's the really weird part: if I change the method signatures in
Trader and TraderBean so that the argument type is the concrete class
com.sun.jndi.ldap.LdapName instead of the interface javax.naming.Name
(which does extend java.io.Serializable, incidentally), it works fine!
I tried this with my own interfaces and concrete classes, and I get the
same strange behavior: calling methods with interface argument types on
the ejb via rmi-iiop fails with the above cryptic error, but methods
with concrete argument types work fine.
I also tried this out on a non-ejb rmi-iiop server object using jdk 1.3
but not weblogic. In that case both interfaces and concrete method
argument types work just fine.
Now I'm wondering if this could be a bug in weblogic.ejbc's iiop
generation. Can anyone else verify this problem?
Edwin Park
[email protected]Comments in line...
Edwin Park wrote:
I got the rmi-iiop example code to work just fine, but I tried extending
it a little and strangeness ensues. Here's what I did:
I'm using a stock weblogic 6.0 install on solaris 8 (sparc). I added
the following new method to the Trader interface:
public void func(javax.naming.Name n) throws RemoteException;
and I added the implementation of that method to TraderBean like so:
public void func(javax.naming.Name n) {
System.out.prinltn("n [" + n + "]");
I then added a call to the new Trader function to the end of the
example() method in Client, just before the trader is removed:
try {
com.sun.jndi.ldap.LdapName lname =
new com.sun.jndi.ldap.LdapName("a=b");
trader.func(lname);
} catch (javax.naming.NamingException ne) {
ne.printStackTrace();
Then I compiled everything using the supplied build.sh, copied the
ejb_over_iiop.jar into config/mydomain/applications, and ran
startWebLogic.sh int the config/mydomain directory to start the server.
I then run the client like so (using the 1.3 java version included with
weblogic 6.0):
java -cp
/opt/bea/wlserver6.0/config/examples/clientclasses:/opt/bea/wlserver6.0/config/mydomain/applications:/opt/bea/wlserver6.0/lib/weblogic.jar
examples.rmi_iiop.ejb.rmi_iiop.Client iiop://localhost:7001
And I get the following output:
Beginning statelessSession.Client...
Creating a trader
Buying 100 shares of BEAS.
Buying 200 shares of MSFT.
Buying 300 shares of AMZN.
Buying 400 shares of HWP.
Selling 100 shares of BEAS.
Selling 200 shares of MSFT.
Selling 300 shares of AMZN.
Selling 400 shares of HWP.
There was an exception while creating and using the Trader.
This indicates that there was a problem communicating with the server:
java.rmi.RemoteException: CORBA UNKNOWN 0 No; nested exception is:
org.omg.CORBA.UNKNOWN: minor code: 0 completed: No
End statelessSession.Client...
Basically the call to the new method fails, and the server communication
error it produces doesn't provide much information. So question #1 is,
what's going on here?
Marshaling through the interface apparently fails. What orb are you using on the client?
>
And here's the really weird part: if I change the method signatures in
Trader and TraderBean so that the argument type is the concrete class
com.sun.jndi.ldap.LdapName instead of the interface javax.naming.Name
(which does extend java.io.Serializable, incidentally), it works fine!It appears that marshaling an interface (or abstract class) fails, but marshaling a concrete class succeeds.
>
>
I tried this with my own interfaces and concrete classes, and I get the
same strange behavior: calling methods with interface argument types on
the ejb via rmi-iiop fails with the above cryptic error, but methods
with concrete argument types work fine.
I also tried this out on a non-ejb rmi-iiop server object using jdk 1.3
but not weblogic. In that case both interfaces and concrete method
argument types work just fine.
Now I'm wondering if this could be a bug in weblogic.ejbc's iiop
generation. Can anyone else verify this problem?I'll look into this.
>
>
Edwin Park
[email protected] -
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 -
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 -
Hi -
I'm working to modify a C program (gnuplot) so that it can remotely call functions in Java.
My current plan is to use RMI-IIOP on the Java side. I'd like to create a class that implements java.rmi.Remote via some local implementation class, instantiate it, then obtain a stringified IOR for that object and pass it to gnuplot, which can then use the IOR to call remote methods.
Also, I'm planning to use CORBA DII on the client side, since I want a generic program where the remote method names can be set by user options at run time.
Does this make sense? I'm working with this tutorial code:
http://java.sun.com/j2se/1.5.0/docs/guide/rmi-iiop/tutorial.html
and am stuck on obtaining an IOR in the server code.
Any help would be appreciated...Well, I figured it out. The key method is remoteToCorba in com.sun.jndi.toolkit.corba.CorbaUtils. Here's my server code:
//HelloServer.java
import java.io.*;
import org.omg.CORBA.ORB;
import com.sun.jndi.toolkit.corba.CorbaUtils;
public class HelloServer {
public static void main(String[] args) {
try {
// Step 1: Instantiate the Hello servant
HelloImpl helloRef = new HelloImpl();
// Step 2: Initialize the ORB
ORB orb = ORB.init(args, null);
// Step 3: Convert the Hello servant to a CORBA object
org.omg.CORBA.Object corba_obj;
corba_obj = CorbaUtils.remoteToCorba(helloRef, orb);
// Step 4a: Announce the IOR to STDOUT
String ior = orb.object_to_string(corba_obj);
System.out.println("IOR: " + ior);
// Step 4b: Announce the IOR to a file
FileWriter fw = new FileWriter("hello.ior");
fw.write(ior);
fw.close();
System.out.println("Hello Server: Ready...");
} catch (Exception e) {
System.out.println("Trouble: " + e);
e.printStackTrace();
}And here's the matching client code:
//HelloClient.java
import java.io.*;
import org.omg.CORBA.ORB;
import javax.rmi.PortableRemoteObject;
public class HelloClient {
public static void main( String args[] ) {
HelloInterface hi;
try {
// Step 1: Initialize the ORB
ORB orb = ORB.init(args, null);
// Step 2: Obtain the stringified IOR from a file
FileReader fr = new FileReader("hello.ior");
BufferedReader br = new BufferedReader(fr);
String ior = br.readLine();
// Step 3: Convert the IOR to a CORBA object reference
org.omg.CORBA.Object objref = orb.string_to_object(ior);
// Step 4: Narrow the CORBA object reference to the concrete type
hi = (HelloInterface) PortableRemoteObject.narrow(
objref, HelloInterface.class);
// Step 5: Invoke the method.
hi.sayHello( " MARS " );
} catch( Exception e ) {
System.err.println( "Exception " + e + "Caught" );
e.printStackTrace( );
return;
}The other two files are unchanged from the original example:
//HelloInterface.java
import java.rmi.Remote;
public interface HelloInterface extends java.rmi.Remote {
public void sayHello( String from ) throws java.rmi.RemoteException;
//HelloImpl.java
import javax.rmi.PortableRemoteObject;
public class HelloImpl extends PortableRemoteObject implements HelloInterface {
public HelloImpl() throws java.rmi.RemoteException {
super(); // invoke rmi linking and remote object initialization
public void sayHello( String from ) throws java.rmi.RemoteException {
System.out.println( "Hello from " + from + "!!" );
System.out.flush();
}Compilation and usage is straightforward:
javac *.java
rmic -iiop HelloImpl
java -cp . HelloServer
java -cp . HelloClientIt gives warnings about using a Sun proprietary interface, but that's the only problem that I've had with the Java end. Getting the C end working has been more challenging. ORBit seems to have some serious interoperability problems. I haven't gotten it working yet with Java. -
Classcastexception with rmi-iiop
Hi,
I try the rmi-iiop example in examples/rmi_iiop/hello using Sun's JDK 1.3rc1 on Linux. I use weblogic.rmic to generate an IDL file from HelloImpl.class. Next, I use idlj (comes with the JDK) to generate those help .java files from IDL. Then, I compile these files and HelloClient.java. I start Weblogic(SP6) and launch HelloClient using the command,
java examples.rmi_iiop.hello.HelloClient {long IOR number string}
Weblogic server throws this exception when the client make a contact,
Sun Dec 17 16:52:33 GMT+08:00 2000:<I> <WebLogicServer> WebLogic Server started
Sun Dec 17 16:52:40 GMT+08:00 2000:<I> <ListenThread> Adding address: localhost/127.0.0.1 to licensed client list
Sun Dec 17 16:52:40 GMT+08:00 2000:<E> <Adapter> Exception thrown by rmi server: [-8596339638698095515S127.0.0.1:[7001,7001,7002,7002,7001,-1]/8]
java.lang.ClassCastException: examples.rmi_iiop.hello.HelloImpl
at weblogic.cos.naming.NamingContextImpl.resolve(NamingContextImpl.java:138)
at weblogic.cos.naming.NamingContext_WLSkel.invoke(NamingContext_WLSkel.java:53)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java:347)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:69)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
Why there is a ClassCastException? If there a compatiblity problem with idlj that comes with the JDK? Please advise.Generally, this is a classpath problem. You must ensure that the classes that are produced by jidl are not in the WLS classpath; similarly, the RMI interfaces must not be visible to the java CORBA client.
IMO, a java CORBA client is not a viable development platform.
TH Lim wrote:
Hi,
I try the rmi-iiop example in examples/rmi_iiop/hello using Sun's JDK 1.3rc1 on Linux. I use weblogic.rmic to generate an IDL file from HelloImpl.class. Next, I use idlj (comes with the JDK) to generate those help .java files from IDL. Then, I compile these files and HelloClient.java. I start Weblogic(SP6) and launch HelloClient using the command,
java examples.rmi_iiop.hello.HelloClient {long IOR number string}
Weblogic server throws this exception when the client make a contact,
Sun Dec 17 16:52:33 GMT+08:00 2000:<I> <WebLogicServer> WebLogic Server started
Sun Dec 17 16:52:40 GMT+08:00 2000:<I> <ListenThread> Adding address: localhost/127.0.0.1 to licensed client list
Sun Dec 17 16:52:40 GMT+08:00 2000:<E> <Adapter> Exception thrown by rmi server: [-8596339638698095515S127.0.0.1:[7001,7001,7002,7002,7001,-1]/8]
java.lang.ClassCastException: examples.rmi_iiop.hello.HelloImpl
at weblogic.cos.naming.NamingContextImpl.resolve(NamingContextImpl.java:138)
at weblogic.cos.naming.NamingContext_WLSkel.invoke(NamingContext_WLSkel.java:53)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java:347)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:69)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
Why there is a ClassCastException? If there a compatiblity problem with idlj that comes with the JDK? Please advise. -
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] -
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,
- deepakDeepak 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 -
Hi !
When I try to compile in JDev with javac and the java 1.3.1 library, I get the following error :
Error: javac: invalid flag: -source
The command line generated by JDev looks like :
C:\jdk1.3.1_03\bin\javac.exe -J-mx512m -verbose -deprecation -source 1.3 -target 1.3 -encoding Cp1252 -g -classpath [...] -sourcepath [...] -d [...] @C:\DOCUME~1\user\LOCALS~1\Temp\javac54193.tmp
It seems that -source and -target flags do not exist in this version of javac.
But it does not seem possible to remove these flags generated by JDev, so I'm unable to compile with javac 1.3.1 and JDev.
So i'm looking for :
- A workaround to prevent JDev from adding the -source and -target flags.
- A future release of JDev where you could disable these flags, or, much better, where JDev automatically disables these flags when it detects a 1.3.1 library (there may be other incompatible flags I did not mention).
Thank you for your answers :)Hi,
when you open the project properties and choose the compiler option to tht the compiler to "javac" and then the "source" and "target" to 1.3, wouldn't this compile it for Java 3? I don't think that it is necesary to use JDK 1.3 for compiling the sources
Cross-Compilation Options
By default, classes are compiled against the bootstrap and extension classes of the platform that javac shipped with. But javac also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation. It is important to use -bootclasspath and -extdirs when cross-compiling; see Cross-Compilation Example below.
-target version
Generate class files that will work on VMs with the specified version. The default is to generate class files to be compatible with the 1.2 VM in the Java 2 SDK. The versions supported by javac in the Java 2 SDK are:
1.1
Ensure that generated class files will be compatible with 1.1 and VMs in the Java 2 SDK.
1.2
Generate class files that will run on VMs in the Java 2 SDK, v 1.2 and later, but will not run on 1.1 VMs. This is the default.
1.3
Generate class files that will run on VMs in the Java 2 SDK, v 1.3 and later, but will not run on 1.1 or 1.2 VMs.
1.4
Generate class files that are compatible only with 1.4 VMs.
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html
Frank -
Unable to compile class for JSP. apache-tomcat-6. What could be wrong?
Hello, I am new to JSP and I am trying a very basic jsp and class file on Windows XP. I get the Unable to compile class for JSP.
Steps that I have done:
javac ch06_01.java , placed the ch06_01.class under
C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes
Then grabbed the ch06_02.jsp and placed it under
C:\Apps\apache-tomcat-6.0.16\webapps\ch06\
When I run it (by placing this into Explorer or Firefox URL
http://localhost:8080/ch06/ch06_02.jsp) I get the error further
below. Things I have done and made sure they are in place are:
set up JAVA_HOME to C:\Apps\jdk1.6.0_06
Using CATALINA_BASE: C:\Apps\apache-tomcat-6.0.16
Using CATALINA_HOME: C:\Apps\apache-tomcat-6.0.16
Using CATALINA_TMPDIR: C:\Apps\apache-tomcat-6.0.16\temp
Using JRE_HOME: C:\Apps\jre1.6.0_06
I did a google on the error and I found people saying to place the
tools.jar from the jsk into the lib directory under CATALINA_HOME. But
the examples still don't work. What step could I be missing? Your help is greatly
appreciated.
This is the simple jsp file:
<%@ page import="ch06_01" %>
<HTML>
<HEAD>
<TITLE>Using a JavaBean</TITLE>
</HEAD>
<BODY>
<H1>Using a JavaBean</H1>
<% ch06_01 messager = new ch06_01(); %>
The message is: <%= messager.msg() %>
</BODY>
</HTML>
this is the simple ch6_01 java file:
public class ch06_01
public ch06_01()
public String msg()
return "Hello from JSP!";
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 6 in the generated java file
The import ch06_01 cannot be resolved
An error occurred at line: 9 in the jsp file: /ch06_02.jsp
ch06_01 cannot be resolved to a type
6: <BODY>
7: <H1>Using a JavaBean</H1>
8:
9: <% ch06_01 messager = new ch06_01(); %>
10:
11: The message is: <%= messager.msg() %>
12:
An error occurred at line: 9 in the jsp file: /ch06_02.jsp
ch06_01 cannot be resolved to a type
6: <BODY>
7: <H1>Using a JavaBean</H1>
8:
9: <% ch06_01 messager = new ch06_01(); %>
10:
11: The message is: <%= messager.msg() %>
12:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Edited by: indikon1 on Jun 12, 2008 1:18 PM
I just updated the directories of the variables to reflect the current status of my system.What is wrong is that you are using an "old" jsp tutorial :-)
Since Java 1.4, JSPs have been unable to access classes in the "default" package.
What you need to do:
Put the java class ch06_01 in a package.
Steps to do this
- Edit ch06_01 and add the following to the very top of the file (without the quotes): "package mypackage;"
- create a folder "mypackage"
- move ch06_01.java into that folder
- compile that class (now in the mypackage package)
- place ch06_01.class under C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes\mypackage
In your jsp:
<%@ page import="mypackage.ch06_01" %>
I would suggest using a more up-to-date tutorial that uses JSTL.
Take a look at this [Apache Tomcat tutorial|http://www.coreservlets.com/Apache-Tomcat-Tutorial/index.html]
Maybe you are looking for
-
hi, i would like to talk about the apple tv with people. i am thinking of getting it for christmas for my family. i am hoping anyone can explain to me if what i want to do is capable to any degree. what i want to do is as follows: it will be in my
-
Crystal Reports 2008 SP1 needed
I need to download SP1 english language but I dont see it in the list of downloadable files. Can someone point me in the right direction? Thanks!
-
My MacBook Pro that is running on Mac OS X 10.6.8 won't update software that I need in order to download the newest iTunes software to connect to my iPhone 6. Problem is that when I go to update, it restarts the computer but never updates any of the
-
Information on Dynamic Routing
Hello! I am writing my diploma thesis as Oracle Germany. At the moment I am interested in Application Server's load balancing feature called "Dynamic Routing" ([1] p11, middle). But I cannot find any detailed information about it. Can you help me? Th
-
Dump while loading data from 1 cube to other cube
Hi, We created a direct mapping between 2 cubes ( no start/end routines, formula exist in the mapping). Strange part is while I am loading data from one cube to other cube all data packages executing successfully only last data package giving dump wi