[jacorb-bugs] [Bug 920] using jacorb 3.0rc1 on android platform
bugzilla-daemon at jacorb.org
bugzilla-daemon at jacorb.org
Thu May 3 08:53:38 CEST 2012
http://www.jacorb.org/cgi-bin/bugzilla/show_bug.cgi?id=920
------- Comment #5 from j.locatelli at ill.fr 2012-05-03 08:53 -------
Hello,
I'am try the demo case bidir. I just change source for using namespace instead
ior file. The server is on the linux desktop. It is working fine when I start
the linux client. But when I start the client on the android machine, it's
failled. There the source codes and results:
ServerImpl:
package demo.bidir;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Properties;
import org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE;
import org.omg.BiDirPolicy.BOTH;
import org.omg.BiDirPolicy.BidirectionalPolicyValueHelper;
import org.omg.CORBA.Any;
import org.omg.CORBA.Policy;
import org.omg.CosNaming.NamingContextExt;
import org.omg.CosNaming.NamingContextExtHelper;
import org.omg.PortableServer.IdAssignmentPolicyValue;
import org.omg.PortableServer.ImplicitActivationPolicyValue;
import org.omg.PortableServer.LifespanPolicyValue;
import org.omg.PortableServer.POA;
/**
* ServerImpl.java
*
*
* Created: Mon Sep 3 19:28:34 2001
*
* @author Nicolas Noffke
* @version $Id: ServerImpl.java,v 1.1 2009-11-09 16:10:56 alexander.bykov Exp
$
*/
public class ServerImpl extends ServerPOA
{
private ClientCallback ccb = null;
public ServerImpl ()
{
}
public void register_callback (ClientCallback ccb)
{
this.ccb = ccb;
}
public void callback_hello (String message)
{
System.out.println ("Server object received hello message >" + message
+ '<');
if (ccb != null) ccb.hello (message);
}
public static void main (String[] args) throws Exception
{
Properties props = new Properties ();
props.put
("org.omg.PortableInterceptor.ORBInitializerClass.bidir_init",
"org.jacorb.orb.giop.BiDirConnectionInitializer");
props.setProperty("ORBInitRef.NameService",
"corbaloc::gamma12.ill.fr:2809/NameService");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
Any any = orb.create_any ();
BidirectionalPolicyValueHelper.insert (any, BOTH.value);
POA root_poa = (POA) orb.resolve_initial_references ("RootPOA");
Policy[] policies = new Policy[4];
policies[0] = root_poa.create_lifespan_policy
(LifespanPolicyValue.TRANSIENT);
policies[1] = root_poa.create_id_assignment_policy
(IdAssignmentPolicyValue.SYSTEM_ID);
policies[2] = root_poa.create_implicit_activation_policy
(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION);
policies[3] = orb.create_policy (BIDIRECTIONAL_POLICY_TYPE.value, any);
POA bidir_poa = root_poa.create_POA ("BiDirPOA",
root_poa.the_POAManager (),
policies);
bidir_poa.the_POAManager ().activate ();
org.omg.CORBA.Object o = bidir_poa.servant_to_reference (new ServerImpl
());
// PrintWriter ps = new PrintWriter (new FileOutputStream (new File
(args[0])));
// ps.println (orb.object_to_string (o));
// ps.close ();
// register server with naming context
NamingContextExt nc =
NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
nc.bind( nc.to_name("AnyServer.service"), o);
if (args.length == 2)
{
File killFile = new File (args[1]);
while (!killFile.exists ())
{
Thread.sleep (1000);
}
orb.shutdown (true);
}
else
{
orb.run ();
}
}
}// ServerImpl
Client:
package demo.bidir;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Properties;
import org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE;
import org.omg.BiDirPolicy.BOTH;
import org.omg.BiDirPolicy.BidirectionalPolicyValueHelper;
import org.omg.CORBA.Any;
import org.omg.CORBA.Policy;
import org.omg.CosNaming.NamingContextExt;
import org.omg.CosNaming.NamingContextExtHelper;
import org.omg.PortableServer.IdAssignmentPolicyValue;
import org.omg.PortableServer.ImplicitActivationPolicyValue;
import org.omg.PortableServer.LifespanPolicyValue;
import org.omg.PortableServer.POA;
/**
* Client.java
*
*
* Created: Mon Sep 3 19:28:34 2001
*
* @author Nicolas Noffke
* @version $Id: Client.java,v 1.1 2009-11-09 16:10:56 alexander.bykov Exp $
*/
public class Client extends ClientCallbackPOA
{
public Client ()
{
}
public void hello (String message)
{
System.out.println ("Client callback object received hello message >"
+ message + '<');
}
public static void main (String[] args) throws Exception
{
Properties props = new Properties ();
props.put
("org.omg.PortableInterceptor.ORBInitializerClass.bidir_init",
"org.jacorb.orb.giop.BiDirConnectionInitializer");
props.setProperty("ORBInitRef.NameService",
"corbaloc::gamma12.ill.fr:2809/NameService");
props.setProperty("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
props.setProperty("org.omg.CORBA.ORBSingletonClass",
"org.jacorb.orb.ORBSingleton");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
Any any = orb.create_any ();
BidirectionalPolicyValueHelper.insert (any, BOTH.value);
POA root_poa = (POA) orb.resolve_initial_references ("RootPOA");
Policy[] policies = new Policy[4];
policies[0] = root_poa.create_lifespan_policy
(LifespanPolicyValue.TRANSIENT);
policies[1] = root_poa.create_id_assignment_policy
(IdAssignmentPolicyValue.SYSTEM_ID);
policies[2] = root_poa.create_implicit_activation_policy
(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION);
policies[3] = orb.create_policy (BIDIRECTIONAL_POLICY_TYPE.value, any);
POA bidir_poa = root_poa.create_POA ("BiDirPOA",
root_poa.the_POAManager (),
policies);
bidir_poa.the_POAManager ().activate ();
ClientCallback ccb = ClientCallbackHelper.narrow
(bidir_poa.servant_to_reference (new Client ()));
// get hold of the naming service
NamingContextExt nc =
NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
Server server =
ServerHelper.narrow(nc.resolve(nc.to_name("AnyServer.service")));
server.register_callback (ccb);
server.callback_hello ("A test string");
}
}// Client
Android Client which using demo as jar:
package demo.bidir;
import demo.hello.R;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
public class BidirandroidActivity extends Activity {
class Test extends AsyncTask<String, String, String> {
@Override
protected String doInBackground(String... params) {
try {
Client.main(null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new Test().execute();
setContentView(R.layout.main);
}
}
Results:
05-03 08:51:36.039: D/OpenGLRenderer(3108): Flushing caches (mode 0)
05-03 08:51:36.570: D/OpenGLRenderer(3108): Flushing caches (mode 1)
05-03 08:51:52.640: W/dalvikvm(10195): VFY: unable to find class referenced in
signature (Ljava/applet/Applet;)
05-03 08:51:52.640: I/dalvikvm(10195): Could not find method
java.applet.Applet.getParameter, referenced from method org.omg.CORBA.ORB.init
05-03 08:51:52.640: W/dalvikvm(10195): VFY: unable to resolve virtual method
135: Ljava/applet/Applet;.getParameter (Ljava/lang/String;)Ljava/lang/String;
05-03 08:51:52.640: D/dalvikvm(10195): VFY: replacing opcode 0x6e at 0x0002
05-03 08:51:52.742: D/jacorb.config(10195): jacorb.home unset! Will use '.'
05-03 08:51:52.757: W/jacorb.config(10195): no properties found for
configuration jacorb
05-03 08:51:52.773: D/libEGL(10195): loaded /system/lib/egl/libGLES_android.so
05-03 08:51:52.789: I/jacorb.orb.singleton(10195): created ORBSingleton
05-03 08:51:52.789: D/jacorb.config(10195): jacorb.home unset! Will use '.'
05-03 08:51:52.804: D/libEGL(10195): loaded
/system/lib/egl/libEGL_POWERVR_SGX540_120.so
05-03 08:51:52.812: D/libEGL(10195): loaded
/system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
05-03 08:51:52.820: D/libEGL(10195): loaded
/system/lib/egl/libGLESv2_POWERVR_SGX540_120.so
05-03 08:51:52.929: D/jacorb.orb.factory(10195): defaulting to
DefaultSocketFactory
05-03 08:51:52.953: D/OpenGLRenderer(10195): Enabling debug mode 0
05-03 08:51:52.953: I/AndroidLoggerFactory(10195): Logger name
'org.jacorb.interceptors.ior_init' exceeds maximum length of 23 characters,
using 'o*.j*.i*.ior_init' instead.
05-03 08:51:53.007: I/AndroidLoggerFactory(10195): Logger name
'jacorb.giop.bidir.interceptor' exceeds maximum length of 23 characters, using
'j*.g*.b*.interceptor' instead.
05-03 08:51:53.015: I/jacorb.orb.interceptors(10195): InterceptorManager
started with 1 Server Interceptors, 1 Client Interceptors and 0 IOR
Interceptors
05-03 08:51:53.031: E/dalvikvm(10195): Could not find class 'java.rmi.Remote',
referenced from method org.jacorb.orb.TypeCode.create_tc
05-03 08:51:53.031: W/dalvikvm(10195): VFY: unable to resolve const-class 225
(Ljava/rmi/Remote;) in Lorg/jacorb/orb/TypeCode;
05-03 08:51:53.031: D/dalvikvm(10195): VFY: replacing opcode 0x1c at 0x005d
05-03 08:51:53.031: E/dalvikvm(10195): Could not find class
'java.rmi.RemoteException', referenced from method
org.jacorb.orb.TypeCode.isMappedToAnAbstractInterface
05-03 08:51:53.031: W/dalvikvm(10195): VFY: unable to resolve const-class 226
(Ljava/rmi/RemoteException;) in Lorg/jacorb/orb/TypeCode;
05-03 08:51:53.031: D/dalvikvm(10195): VFY: replacing opcode 0x1c at 0x001c
05-03 08:51:53.054: I/AndroidLoggerFactory(10195): Logger name
'jacorb.poa.manager_monitor' exceeds maximum length of 23 characters, using
'j*.p*.manager_monitor' instead.
05-03 08:51:53.101: D/jacorb.orb.giop(10195): created org.omg.ETF.Factories:
org.jacorb.orb.iiop.IIOPFactories
05-03 08:51:53.187: I/AndroidLoggerFactory(10195): Logger name
'jacorb.giop.server.listener' exceeds maximum length of 23 characters, using
'j*.g*.s*.listener' instead.
05-03 08:51:53.187: D/jacorb.orb.factory(10195): created ServerSocketFactory:
org.jacorb.orb.factory.DefaultServerSocketFactory
05-03 08:51:53.218: W/jacorb.iiop.address(10195): init_host, /0.0.0.0
unresolvable
05-03 08:51:53.226: I/jacorb.poa(10195): oid: 00 14 06 23 2B 0A 3F 3D 24 3D 07
1F 1F 2A 46 24 28 1F ...#+.?=$=...*F$(.object is activated
05-03 08:51:53.226: I/jacorb.poa(10195): Using server ID (8242716836) for
transient POA
05-03 08:51:53.226: D/jacorb.poa.controller(10195): reset a previous completion
call
05-03 08:51:53.226: D/jacorb.poa.controller(10195): reset a previous completion
call
05-03 08:51:53.320: D/dalvikvm(10195): GC_CONCURRENT freed 221K, 4% free
6709K/6983K, paused 3ms+12ms
05-03 08:51:53.398: E/dalvikvm(10195): Could not find class
'javax.rmi.CORBA.ClassDesc', referenced from method
org.jacorb.orb.CDROutputStream.write_value_internal
05-03 08:51:53.398: W/dalvikvm(10195): VFY: unable to resolve const-class 321
(Ljavax/rmi/CORBA/ClassDesc;) in Lorg/jacorb/orb/CDROutputStream;
05-03 08:51:53.398: D/dalvikvm(10195): VFY: replacing opcode 0x1c at 0x0053
05-03 08:51:53.445: E/dalvikvm(10195): Could not find class 'java.rmi.Remote',
referenced from method org.jacorb.orb.CDRInputStream.read_Object
05-03 08:51:53.445: W/dalvikvm(10195): VFY: unable to resolve const-class 225
(Ljava/rmi/Remote;) in Lorg/jacorb/orb/CDRInputStream;
05-03 08:51:53.445: D/dalvikvm(10195): VFY: replacing opcode 0x1c at 0x005d
05-03 08:51:53.484: I/jacorb.orb.giop(10195): ClientConnectionManager: created
new ClientGIOPConnection to 172.17.17.75:2809 (41131680)
05-03 08:51:53.500: I/AndroidLoggerFactory(10195): Logger name
'jacorb.orb.client_interceptors' exceeds maximum length of 23 characters, using
'j*.o*.client_intercept*' instead.
05-03 08:51:53.500: I/jacorb.orb.delegate(10195): Adding new retry group for
172.17.17.75:2809
05-03 08:51:53.500: I/AndroidLoggerFactory(10195): Logger name
'jacorb.orb.socketfactory' exceeds maximum length of 23 characters, using
'j*.o*.socketfactory' instead.
05-03 08:51:53.500: D/jacorb.orb.factory(10195): created SocketFactory:
org.jacorb.orb.factory.DefaultSocketFactory
05-03 08:51:53.507: I/jacorb.orb.iiop(10195): Connected to 172.17.17.75:2809
from local port 60013
05-03 08:51:53.539: I/jacorb.orb.giop(10195): ClientConnectionManager: created
new ClientGIOPConnection to 127.0.0.2:43220 (41118078)
05-03 08:51:53.554: D/jacorb.giop.conn(10195): No CodeSetComponentInfo in IOR.
Will use default CodeSets
05-03 08:51:53.554: I/jacorb.orb.delegate(10195): Adding new retry group for
127.0.0.2:43220
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): Exception
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): java.net.ConnectException: failed
to connect to /127.0.0.2 (port 43220) after 90000ms: isConnected failed:
ECONNREFUSED (Connection refused)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
libcore.io.IoBridge.isConnected(IoBridge.java:214)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
libcore.io.IoBridge.connectErrno(IoBridge.java:152)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
libcore.io.IoBridge.connect(IoBridge.java:112)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.net.Socket.connect(Socket.java:842)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.factory.DefaultSocketFactory.doCreateSocket(DefaultSocketFactory.java:46)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.factory.AbstractSocketFactory.createSocket(AbstractSocketFactory.java:61)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.iiop.ClientIIOPConnection.createSocket(ClientIIOPConnection.java:315)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.iiop.ClientIIOPConnection.connect(ClientIIOPConnection.java:150)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:1045)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:990)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:309)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:290)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.Delegate._invoke_internal(Delegate.java:1326)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1151)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.jacorb.orb.Delegate.invoke(Delegate.java:1139)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:80)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
demo.bidir._ServerStub.register_callback(_ServerStub.java:36)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
demo.bidir.Client.main(Client.java:79)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
demo.bidir.BidirandroidActivity$Test.doInBackground(BidirandroidActivity.java:15)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
demo.bidir.BidirandroidActivity$Test.doInBackground(BidirandroidActivity.java:1)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
android.os.AsyncTask$2.call(AsyncTask.java:264)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.util.concurrent.FutureTask.run(FutureTask.java:137)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
java.lang.Thread.run(Thread.java:856)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): Caused by:
libcore.io.ErrnoException: isConnected failed: ECONNREFUSED (Connection
refused)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): at
libcore.io.IoBridge.isConnected(IoBridge.java:201)
05-03 08:51:53.609: D/jacorb.orb.iiop(10195): ... 28 more
05-03 08:51:53.609: I/jacorb.orb.iiop(10195): Retrying to connect to
127.0.0.2:43220
05-03 08:51:54.117: D/jacorb.orb.iiop(10195): Exception
05-03 08:51:54.117: D/jacorb.orb.iiop(10195): java.net.ConnectException: failed
to connect to /127.0.0.2 (port 43220) after 90000ms: isConnected failed:
ECONNREFUSED (Connection refused)
I'm still working also, on classpath compilation...
Thank you,
Regards
--
Configure bugmail: http://www.jacorb.org/cgi-bin/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the jacorb-bugs
mailing list