Jump to content
Excelsior Forums

ClassCastException and IOException / Java NIO

Recommended Posts

Dear Support Team,

I have written a java http proxy and would like to compile the projects into native code.

If it would work, I would be more than happy to buy the software and use it since it offers many advantages.

The project actually only uses a few java classes and mostly relies on the java.nio package.

The rest of the code consits of parsers, which are handling the http protocoll.

The problem I have is that I get very strange behaviour and that the progam exits after a while.

I get the following two Exceptions:



The strange thing is that those exception of course do not pop up when I run the java program so there must be some kind of incompatability?

The IOException occurs after having sent a http request. I can see this because the server gets a connection but then says that the client has disconnected.

However, I have no idea why I get a ClassCastException. I do not load any classes dynamically and I since I don't get the exception when I run it using "java" I should not get it running it as native code.

I would really appreciate some help here since I would really like to buy the software and use it. Could you give me some hints on what I could do to resolve thos issues?

I have read somewhere that the keyword static is problematic. Are there other java coding forms which I should avoid? Here are all and the only java classes I use in my program:

mport java.io.IOException;

import java.io.StringReader;

import java.io.StringWriter;

import java.io.UnsupportedEncodingException;

import java.net.ConnectException;

import java.net.InetSocketAddress;

import java.nio.BufferOverflowException;

import java.nio.ByteBuffer;

import java.nio.channels.ClosedChannelException;

import java.nio.channels.SelectionKey;

import java.nio.channels.Selector;

import java.nio.channels.ServerSocketChannel;

import java.nio.channels.SocketChannel;

import java.nio.channels.spi.SelectorProvider;

import java.nio.charset.Charset;

import java.util.ArrayList;

import java.util.Date;

import java.util.Enumeration;

import java.util.Hashtable;

import java.util.Iterator;

import java.util.LinkedHashMap;

import java.util.LinkedList;

import java.util.List;

import java.util.Map;

import java.util.Properties;

import java.util.StringTokenizer;

import java.util.TreeMap;

import java.util.TreeSet;

import java.util.Vector;

import javax.xml.parsers.ParserConfigurationException;

import javax.xml.parsers.SAXParser;

import javax.xml.parsers.SAXParserFactory

Share this post

Link to post
Share on other sites

This forum is not intended for formal technical support. Please contact our Support Dept., I'm sure the guys will help you.

BTW, where do you read about the problems with 'static'? It is interesting for me, because there are no (and never were) such problems with JET.

Share this post

Link to post
Share on other sites