MS Java Language Conversion Assistant Problem with CF 1.0 SP2

J

John

Hello,

We are testing the Microsoft Java Language Conversion Assistant 2.0 and have
run into a problem with a simple test program converted by the tool to run
on the compact framework.

The Java source is as follows:

----------------------------------------------------
static public void Main(String[] args) {
Socket lsnskt; // the socket to listen on
Socket acpskt; // the socket which was accepted
try {
System.Console.Out.WriteLine("Running socket accept application.");
lsnskt=new
Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
lsnskt.Bind(new IPEndPoint(IPAddress.Any,8080));
lsnskt.Listen(1);
System.Console.Out.WriteLine("Waiting for connection...");
acpskt=lsnskt.Accept();
System.Console.Out.WriteLine("Connection accepted
from"+acpskt.RemoteEndPoint+'.');
acpskt.Close();
lsnskt.Close();
}
catch(SocketException thr) {
System.Console.Out.WriteLine("Exception: "+thr);
System.Console.Out.WriteLine("Exception Error Code:"+thr.ErrorCode);
}
catch(Exception thr) {
System.Console.Out.WriteLine("Exception: "+thr);
}
System.Console.Out.WriteLine("Program ended.");
}
----------------------------------------------------

The resulting conversion runs fine on the 1.1 *PC* Framework but the same
..exe crashes on the PocketPC 2003 Platform with the following error message:

httpServer.exe
TypeLoadException
Could not load type
System.Net.Sockets.Tcplistener from assembly System,
Version=1.0.5000.0, Culture-neutral,PublicKeyToken=B77A5C561934E089

--

Any ideas as to why? Documentation indicates that the TCP Listener Class is
implemented in the compact framework but "could not load type" seems to
state otherwise.

Thanks,
John
 
L

Lloyd Dupont

ho....
you tried the java conversion assistant on the CF !!

I see you have some problem, but does it woks well ?
is it possible to convert RMI ?
 
J

John

re: I see you have some problem, but does it woks well ?

doesn't work at all
-----Original Message-----
ho....
you tried the java conversion assistant on the CF !!

I see you have some problem, but does it woks well ?
is it possible to convert RMI ?

John said:
Hello,

We are testing the Microsoft Java Language Conversion
Assistant 2.0 and
have
run into a problem with a simple test program converted by the tool to run
on the compact framework.

The Java source is as follows:

----------------------------------------------------
static public void Main(String[] args) {
Socket lsnskt; // the socket to listen on
Socket acpskt; // the socket which was accepted
try {
System.Console.Out.WriteLine("Running socket
accept
application.");
(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.
Tcp);
lsnskt.Bind(new IPEndPoint(IPAddress.Any,8080));
lsnskt.Listen(1);
System.Console.Out.WriteLine("Waiting for connection...");
acpskt=lsnskt.Accept();
System.Console.Out.WriteLine("Connection accepted
from"+acpskt.RemoteEndPoint+'.');
acpskt.Close();
lsnskt.Close();
}
catch(SocketException thr) {
System.Console.Out.WriteLine("Exception: "+thr);
System.Console.Out.WriteLine("Exception Error Code:"+thr.ErrorCode);
}
catch(Exception thr) {
System.Console.Out.WriteLine("Exception: "+thr);
}
System.Console.Out.WriteLine("Program ended.");
}
following error
message:
httpServer.exe
TypeLoadException
Could not load type
System.Net.Sockets.Tcplistener from assembly System,
Version=1.0.5000.0, Culture- neutral,PublicKeyToken=B77A5C561934E089
TCP Listener Class
is
implemented in the compact framework but "could not load type" seems to
state otherwise.

Thanks,
John


.
 
A

Alex Feinman [MVP]

Have you built this against CF or Desktop assemblies? You need to create a
CF project and import your classes into it. The assembly built against the
desktop framework will not run on CF while the other way around - it likely
will
 
L

Lawrence Dol

We are using the command line compiler (csc.ese) as opposed
to Visual Studio. How can we instruct the compiler to bind
against the CF instead of the DF?

-- Lawrence.
-----Original Message-----
Have you built this against CF or Desktop assemblies? You need to create a
CF project and import your classes into it. The assembly built against the
desktop framework will not run on CF while the other way around - it likely
will

John said:
Hello,

We are testing the Microsoft Java Language Conversion
Assistant 2.0 and
have
run into a problem with a simple test program converted by the tool to run
on the compact framework.

The Java source is as follows:

----------------------------------------------------
static public void Main(String[] args) {
Socket lsnskt; // the socket to listen on
Socket acpskt; // the socket which was accepted
try {
System.Console.Out.WriteLine("Running socket accept application.");
lsnskt=new
Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
lsnskt.Bind(new IPEndPoint(IPAddress.Any,8080));
lsnskt.Listen(1);
System.Console.Out.WriteLine("Waiting for connection...");
acpskt=lsnskt.Accept();
System.Console.Out.WriteLine("Connection accepted
from"+acpskt.RemoteEndPoint+'.');
acpskt.Close();
lsnskt.Close();
}
catch(SocketException thr) {
System.Console.Out.WriteLine("Exception: "+thr);
System.Console.Out.WriteLine("Exception Error Code:"+thr.ErrorCode);
}
catch(Exception thr) {
System.Console.Out.WriteLine("Exception: "+thr);
}
System.Console.Out.WriteLine("Program ended.");
}
following error
message:
httpServer.exe
TypeLoadException
Could not load type
System.Net.Sockets.Tcplistener from assembly System,
Version=1.0.5000.0, Culture-neutral,PublicKeyToken=B77A5C561934E089
TCP Listener Class
is
implemented in the compact framework but "could not load type" seems to
state otherwise.

Thanks,
John


.
 
A

Alex Feinman [MVP]

By using /reference switch to force the compiler to bind to assemblies in
CompactFrameworkSDK directory of Visual Studio installation (or you can
download a developer redistributable and bind to it)

Lawrence Dol said:
We are using the command line compiler (csc.ese) as opposed
to Visual Studio. How can we instruct the compiler to bind
against the CF instead of the DF?

-- Lawrence.
-----Original Message-----
Have you built this against CF or Desktop assemblies? You need to create a
CF project and import your classes into it. The assembly built against the
desktop framework will not run on CF while the other way around - it likely
will

John said:
Hello,

We are testing the Microsoft Java Language Conversion
Assistant 2.0 and
have
run into a problem with a simple test program converted by the tool to run
on the compact framework.

The Java source is as follows:

----------------------------------------------------
static public void Main(String[] args) {
Socket lsnskt; // the socket to listen on
Socket acpskt; // the socket which was accepted
try {
System.Console.Out.WriteLine("Running socket accept application.");
lsnskt=new
Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
lsnskt.Bind(new IPEndPoint(IPAddress.Any,8080));
lsnskt.Listen(1);
System.Console.Out.WriteLine("Waiting for connection...");
acpskt=lsnskt.Accept();
System.Console.Out.WriteLine("Connection accepted
from"+acpskt.RemoteEndPoint+'.');
acpskt.Close();
lsnskt.Close();
}
catch(SocketException thr) {
System.Console.Out.WriteLine("Exception: "+thr);
System.Console.Out.WriteLine("Exception Error Code:"+thr.ErrorCode);
}
catch(Exception thr) {
System.Console.Out.WriteLine("Exception: "+thr);
}
System.Console.Out.WriteLine("Program ended.");
}
following error
message:
httpServer.exe
TypeLoadException
Could not load type
System.Net.Sockets.Tcplistener from assembly System,
Version=1.0.5000.0, Culture-neutral,PublicKeyToken=B77A5C561934E089
TCP Listener Class
is
implemented in the compact framework but "could not load type" seems to
state otherwise.

Thanks,
John


.
 
L

Lawrence Dol

Ahh. Thanks - I wondered about that. I will install the
SDK and try it.

-- Lawrence.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top