|
David, Thanks for the explination. I tried creating one AS400Text object with the AS/400 early in the code. Once I did that, the table got loaded, and the rest worked. This was much easier than trying to find and change them all. I guess that I could complain that the Toolbox sure didn't make it clear that was the problem, or what the solution was. Nick dawall@us.ibm.com@midrange.com on 04/06/2000 09:40:30 PM Please respond to JAVA400-L@midrange.com Sent by: owner-java400-l@midrange.com To: JAVA400-L@midrange.com cc: Subject: Re: Unexpected CCSID The problem is browsers don't ship ebcdic <--> unicode conversion tables. JDKs and most JREs ship them but browsers don't. Toolbox does conversion by first asking the JVM to do it. Second it looks for a table shipped with the Toolbox, and third it downloads the table from the AS/400. If the JVM cannot convert the string and the Toolbox does not ship the table (it contains mostly double byte EBCDIC tables that re not practicle to download), the Toolbox can download the table from the AS/400 only if the AS400Text object is contains an AS400 object. The AS400 object is the only 'path' to the AS/400 so if AS400Text is not given (c'tored) with an AS400 object, it cannot download the table. This is your case, the browser JVM does not contain conversion tables, the Toolbox did not ship the one you want to use and there is no path to the AS/400. AS400Text cannot convert and throws an unsupported encoding exception. The fix is to change the AS400Text c'tors to include an AS400 object. David Wall AS/400 Toolbox for Java Nick_Vrtis@amway.com on 04/05/2000 03:33:07 PM Please respond to JAVA400-L@midrange.com To: java400-l@midrange.com cc: Subject: Unexpected CCSID Help, I am having a problem getting a JAVA applet to run in an IE4 brower. I get "Unexpected CCSID returned from getBestAS400CCSID=37" when I try to fill in an AS400Text object. I tried to simplify the code as much as possible... here's the little Applet: package TestAS400; import java.awt.*; import java.awt.event.*; import java.applet.*; import com.ibm.as400.access.*; public class SimpleAS400 extends Applet { boolean isStandalone = false; AS400 theAS400; public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } public SimpleAS400() { } public void init() { this.setSize(400,300); try { Trace.setTraceDiagnosticOn(true); Trace.setTraceInformationOn(true); Trace.setTraceWarningOn(true); Trace.setTraceErrorOn(true); Trace.setTraceDatastreamOn(true); Trace.setTraceOn(true); theAS400 = new AS400("AMWUSACS"); AS400Text testingText = new AS400Text(10); byte [] theconverted = testingText.toBytes("NickVrtis"); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } Trace.setTraceOn(false); System.out.println("Version 1"); } public void start() {} public void stop() {} public void destroy() {} public String getAppletInfo() { return "Applet Information"; } public String[][] getParameterInfo() { return null; } } It works fine in the ILE. It never even accesses the AS/400 (I do not even get the logon screen), but that is to be expected. When I run it from the following HTML page: <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <TITLE>Sample to test the AS/400 Text</TITLE> </HEAD> <BODY> TestAS400.SimpleTest will appear below in a Java enabled browser.<BR> <APPLET CODEBASE = "." CODE = "TestAS400.SimpleAS400.class" NAME = "TestTheAS400" WIDTH = 400 HEIGHT = 300 HSPACE = 0 VSPACE = 0 ALIGN = middle ARCHIVE = "SimpleAS400.jar,jt400.jar" > </APPLET></BODY></HTML> It does not work. I get the following from the Java Console log: Version 4 Release 2 Modification level 0.5 Fri Mar 17 13:07:33 EST 2000 Detected os.name : Windows 95 Fri Mar 17 13:07:33 EST 2000 Constructing AS400 object Fri Mar 17 13:07:33 EST 2000 Initializing server table Fri Mar 17 13:07:33 EST 2000 System name is 'AMWUSACS' Fri Mar 17 13:07:33 EST 2000 User ID is: '' Fri Mar 17 13:07:33 EST 2000 Unexpected CCSID returned from getBestGuessAS400Ccsid: 37 java.io.UnsupportedEncodingException at com/ibm/as400/access/ConvTable.getTableNoSwapChars at com/ibm/as400/access/ConvTable.getTable at com/ibm/as400/access/Converter.<init> at com/ibm/as400/access/Converter.getConverter at com/ibm/as400/access/Converter.getConverter at com/ibm/as400/access/AS400Text.<init> at TestAS400/SimpleAS400.init at com/ms/applet/AppletPanel.securedCall0 at com/ms/applet/AppletPanel.securedCall at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.run at java/lang/Thread.run An unknown problem has occurred. com.ibm.as400.access.InternalErrorException: An unknown problem has occurred. at com/ibm/as400/access/InternalErrorException.<init> at com/ibm/as400/access/Converter.getConverter at com/ibm/as400/access/AS400Text.<init> at TestAS400/SimpleAS400.init at com/ms/applet/AppletPanel.securedCall0 at com/ms/applet/AppletPanel.securedCall at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.run at java/lang/Thread.run Version 1 Some further debug info is that I put a few println's in to read the System Properties. The user.language and user.region are available within the ILE, but I get a java security exception when I run it from the browser. Any suggestions would be helpful... Nick +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.