Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 02-20-2003
dipakyadav dipakyadav is offline
Registered User
 
 
Join Date: Feb 2003
Posts: 6
error running Java server on XP

I am trying to run the Hello Server in Java. Initially the code would not compile because I didnot have the ice.jar in the classpath. ( I had the directory in the classpath as mentioned in the documentation - 3.4 - Writing an Ice application with Java and it doesn't work). Once I added the jar, I went past compilation and ended up with error below.

F:\iceproject>set ICEJ_HOME=F:\IceJ-1.0.0

F:\iceproject>javac -d classes -classpath classes;F:/IceJ-1.0.0/lib/ice.jar -sou
rce 1.4 Server.java HelloI.java generated/*.java

F:\iceproject>javac -d classes -classpath classes;F:/IceJ-1.0.0/lib/ice.jar -sou
rce 1.4 Client.java HelloI.java generated/*.java

F:\iceproject>java -classpath classes;F:/IceJ-1.0.0/lib/ice.jar;. Server
Ice.SyscallException
error = 0
at Ice.PropertiesI.load(PropertiesI.java:171)
at Server.main(Server.java:37)
Caused by: java.io.FileNotFoundException: config (The system cannot find the fil
e specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.jav a:103)
at java.io.FileInputStream.<init>(FileInputStream.jav a:66)
at java.io.FileReader.<init>(FileReader.java:39)
at Ice.PropertiesI.load(PropertiesI.java:165)
... 1 more

F:\iceproject>java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
Reply With Quote
  #2 (permalink)  
Old 02-20-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Re: error running Java server on XP

Quote:
Originally posted by dipakyadav

F:\iceproject>java -classpath classes;F:/IceJ-1.0.0/lib/ice.jar;. Server
Ice.SyscallException
error = 0
at Ice.PropertiesI.load(PropertiesI.java:171)
This means that the server cannot find the file "config", which contains the properties for the hello demo. "config" is in demo/Ice/hello, so if you start the server from within this directory, this file should be found.

Quote:
Originally posted by dipakyadav

F:\iceproject>java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
I don't think this is related to the problem, but you should definitely upgrade to version 1.4.1. The NIO implementation in 1.4.0 was badly broken.
Reply With Quote
  #3 (permalink)  
Old 02-20-2003
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,055
Hi,

Quote:
Initially the code would not compile because I didnot have the ice.jar in the classpath. ( I had the directory in the classpath as mentioned in the documentation - 3.4 - Writing an Ice application with Java and it doesn't work).
.jar files have to be added individually to your CLASSPATH. After re-reading the documentation I think it could be a little more precise.

Quote:
F:\iceproject>java -classpath classes;F:/IceJ-1.0.0/lib/ice.jar;. Server
Ice.SyscallException
error = 0
at Ice.PropertiesI.load(PropertiesI.java:171)
at Server.main(Server.java:37)
The hello world demo that comes bundled with the icej distribution expects to be run from the demo/Ice/hello directory since it loads a confiiguration file (config) from that directory - hence the error.

Regards, Matthew
Reply With Quote
  #4 (permalink)  
Old 02-20-2003
dipakyadav dipakyadav is offline
Registered User
 
 
Join Date: Feb 2003
Posts: 6
Mark/Mathew,

I don't see a config file under demo/Ice/hello. There is a config directory under ICEJ_ROOT.
I downloaded the following file IceJ-1.0.0.zip. Can you confirm if this zip file includes the config file under demo/Ice/hello.

Mark,
Thanks for the advice about upgrading Java. I will try to find time to do that.

thanks,
Dipak
Reply With Quote
  #5 (permalink)  
Old 02-20-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
It's definitely in the .zip file:

[...]
6641 02-04-03 17:32 IceJ-1.0.0/demo/Ice/hello/Client.java
549 02-04-03 17:32 IceJ-1.0.0/demo/Ice/hello/Hello.ice
860 02-04-03 17:32 IceJ-1.0.0/demo/Ice/hello/HelloI.java
1638 02-04-03 17:32 IceJ-1.0.0/demo/Ice/hello/Server.java
1630 02-04-03 17:32 IceJ-1.0.0/demo/Ice/hello/build.xml
1117 02-06-03 18:56 IceJ-1.0.0/demo/Ice/hello/config <--- here it is
[...]
Reply With Quote
  #6 (permalink)  
Old 02-20-2003
dipakyadav dipakyadav is offline
Registered User
 
 
Join Date: Feb 2003
Posts: 6
Somehow I missed this file when I unzipped the zip file. I started the server and then ran the client and ended up with this error.

F:\IceJ-1.0.0\demo\Ice\hello>java -classpath classes;F:\IceJ-1.0.0\lib\ice.jar C
lient
usage:
t: send greeting as twoway
o: send greeting as oneway
O: send greeting as batch oneway
d: send greeting as datagram
D: send greeting as batch datagram
f: flush all batch requests
T: set a timeout
S: switch secure mode on/off
s: shutdown server
x: exit
?: help

==> t
Ice.ConnectFailedException
error = 0
at IceInternal.Network.doConnect(Network.java:205)
at IceInternal.TcpConnector.connect(TcpConnector.java :30)
at IceInternal.OutgoingConnectionFactory.create(Outgo ingConnectionFactor
y.java:254)
at Ice._ObjectDelM.setup(_ObjectDelM.java:322)
at Ice.ObjectPrxHelper.__getDelegate(ObjectPrxHelper. java:697)
at HelloPrxHelper.sayHello(Unknown Source)
at HelloPrxHelper.sayHello(Unknown Source)
at Client.run(Unknown Source)
at Client.main(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: no further information

at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketC hannelImpl.java:334
)
at IceInternal.Network.doConnect(Network.java:177)
... 8 more
Reply With Quote
  #7 (permalink)  
Old 02-20-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Most likely this is because of the broken NIO in the JDK version you're using. Please upgrade to JDK1.4.1 and try again.
Reply With Quote
  #8 (permalink)  
Old 02-20-2003
dipakyadav dipakyadav is offline
Registered User
 
 
Join Date: Feb 2003
Posts: 6
I have downloaded java 1.4.1 and the sample seems to work for TCP. However if i use the option 'd' on the client it throws the following exception. Do I need to change something so that the server accepts UDP connections? I am attaching the trace of my server and client sessions.

warning: connection exception:
Ice.SocketException
error = 0
at IceInternal.UdpTransceiver.read(UdpTransceiver.jav a:150)
at IceInternal.Connection.read(Connection.java:676)
at IceInternal.ThreadPool.read(ThreadPool.java:654)
at IceInternal.ThreadPool.run(ThreadPool.java:604)
at IceInternal.ThreadPool.access$100(ThreadPool.java: 17)
at IceInternal.ThreadPool$EventHandlerThread.run(Thre adPool.java:886)
Caused by: java.net.PortUnreachableException
at sun.nio.ch.DatagramChannelImpl.receive0(Native Method)
at sun.nio.ch.DatagramChannelImpl.receiveIntoNativeBu ffer(DatagramChann
lImpl.java:185)
at sun.nio.ch.DatagramChannelImpl.receive(DatagramCha nnelImpl.java:174)
at sun.nio.ch.DatagramChannelImpl.receive(DatagramCha nnelImpl.java:122)
at IceInternal.UdpTransceiver.read(UdpTransceiver.jav a:141)
... 5 more
Caused by:

java.net.PortUnreachableException
at sun.nio.ch.DatagramChannelImpl.receive0(Native Method)
at sun.nio.ch.DatagramChannelImpl.receiveIntoNativeBu ffer(DatagramChann
lImpl.java:185)
at sun.nio.ch.DatagramChannelImpl.receive(DatagramCha nnelImpl.java:174)
at sun.nio.ch.DatagramChannelImpl.receive(DatagramCha nnelImpl.java:122)
at IceInternal.UdpTransceiver.read(UdpTransceiver.jav a:141)
at IceInternal.Connection.read(Connection.java:676)
at IceInternal.ThreadPool.read(ThreadPool.java:654)
at IceInternal.ThreadPool.run(ThreadPool.java:604)
at IceInternal.ThreadPool.access$100(ThreadPool.java: 17)
at IceInternal.ThreadPool$EventHandlerThread.run(Thre adPool.java:886)
Attached Files
File Type: txt tracelog.txt (9.4 KB, 161 views)
Reply With Quote
  #9 (permalink)  
Old 02-20-2003
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
I can reproduce this problem. Thanks for the bug report!
Reply With Quote
  #10 (permalink)  
Old 02-21-2003
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Dipak,

A fix for this problem will be included in the next release. If you would like a patch sooner, let me know.

Thanks again,
- Mark
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate naming error while running slice2java Sameerrele Help Center 3 10-02-2006 09:52 AM
encoding error when Ice java client get string from Ice c++ server casper Help Center 1 09-16-2005 04:01 AM
Error running allTests.py (certificate problem?) PeteH Help Center 1 03-09-2005 03:28 AM
err: java Server jschina Help Center 3 10-26-2004 02:47 AM
running sample server error on rh9 a2234 Help Center 1 10-12-2004 11:50 PM


All times are GMT -4. The time now is 08:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.