|
Hello,
I apologize ahead of time for the length of this e-mail:
I am having an interesting problem, and I was wondering if any
of you have run across it and if you were able to fix it.
I keep getting a ClassCastException when using the Toolbox to
connect to a V5R1 system using an IFSFile. I get the same error whether
I am trying to mkdirs() or check if the file .exists().
I have found one other person that has had this problem and they
posted about it in the JTOpen forums. However, a true resolution was
never discovered. The problem just went away after an update of their
TCP configuration.
The original post is here:
http://www-912.ibm.com/j_dir/JTOpen.nsf/8178b1c14b1e9b6b8525624f0062fe9f
/763E3292C49D375F86256DEF00600926?OpenDocument
I borrowed his example program and tweaked it to run my own trace. He
was running his on the 400, I am running mine on a PC. Here is the
program and the trace it gives me. If anyone has any idea at all I'd
appreciate it a great deal!
I tried this with a couple old versions of JT400 and the new JTOpen off
the web site, and I get the same error.
I can run this code on many other machines connecting to other 400's and
I have no problem. The target as400 where this is happening is a v5r1
system has the recent Java group PTF's and all that good stuff.
The only odd thing I can think of is that when testing this I was not
able to update the jt400.jar on the 400 with the latest and greatest,
only the one on the PC. So, those don't match. However, even when they
do when I am using the older version, I get the exact same error, just
different line numbers.
This is running with jdk version 1.4.2 on the PC, and 1.3.1 on the 400.
The PC is a Win2k box.
Program:
========================================================================
====
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.IFSFile;
import com.ibm.as400.access.Trace;
/**
* @author dfeather
* Type: JT400Test
* TODO: Add description of this type.
*/
public class JT400Test {
/**
*
*/
public JT400Test() {
super();
}
public static void main(String[] args) {
AS400 as400 = null;
try {
as400 = new AS400("10.0.0.10",
"xxxxxx","xxxxxx");
Trace.setTraceDiagnosticOn(true);
Trace.setTraceErrorOn(true);
Trace.setTraceInformationOn(true);
Trace.setTraceWarningOn(true);
Trace.setTraceOn(true);
if (as400 != null) {
as400.connectService(AS400.FILE);
as400.connectService(AS400.COMMAND);
as400.connectService(AS400.DATAQUEUE);
as400.connectService(AS400.RECORDACCESS);
String testDirPath = "/test/";
IFSFile tmpDir = new IFSFile(as400,
testDirPath);
boolean dirsx = false;
try {
dirsx = tmpDir.mkdir();
}
catch (java.io.IOException ex) {
System.out.println("Failed to
create temporary directory [" + args[0] + args[1].toLowerCase() + "]");
ex.printStackTrace();
dirsx = false;
}
}
}
catch (Exception ex) {
System.out.println("Other Exception:");
ex.printStackTrace();
}
finally{
if(as400 != null){
as400.disconnectAllServices();
}
}
System.exit(0);
}
}
========================================================================
====
And here's the trace and exception:
========================================================================
====
Toolbox for Java - Version 5 Release 1 Modification level 0.6
Thu Jun 10 13:14:39 CDT 2004 Connecting service: 0
Thu Jun 10 13:14:39 CDT 2004 Setting up AS400 implementation object:
Thu Jun 10 13:14:39 CDT 2004 Enable SSL connections: null
Thu Jun 10 13:14:39 CDT 2004 Native optimizations allowed: false
Thu Jun 10 13:14:39 CDT 2004 Use threaded communications: true
Thu Jun 10 13:14:39 CDT 2004 User specified CCSID: 0
Thu Jun 10 13:14:39 CDT 2004 Socket properties:
com.ibm.as400.access.SocketProperties@1833955
Thu Jun 10 13:14:39 CDT 2004 User ID: 'JHADOCIMG'
Thu Jun 10 13:14:39 CDT 2004 Signing-on with prompting turned on.
Thu Jun 10 13:14:39 CDT 2004 Validate security...
Thu Jun 10 13:14:39 CDT 2004 Signing-on without prompting...
Thu Jun 10 13:14:39 CDT 2004 Opening a socket to verify security...
Thu Jun 10 13:14:39 CDT 2004 Loading browser security classes.
Thu Jun 10 13:14:39 CDT 2004 Netscape browser security classes not
loaded.
Thu Jun 10 13:14:39 CDT 2004 IE browser security classes not loaded.
Thu Jun 10 13:14:39 CDT 2004 Connecting to port mapper...
Thu Jun 10 13:14:39 CDT 2004 Sending port mapper request...
Thu Jun 10 13:14:39 CDT 2004 Receiving port mapper reply...
Thu Jun 10 13:14:39 CDT 2004 Adding entry to Service Port table: system
10.0.0.4, service as-signon, port 8476
Thu Jun 10 13:14:39 CDT 2004 Opening socket to server...
Thu Jun 10 13:14:39 CDT 2004 Setting socket options...
Thu Jun 10 13:14:39 CDT 2004 Socket properties:
Thu Jun 10 13:14:39 CDT 2004 Remote address: /10.0.0.4
Thu Jun 10 13:14:39 CDT 2004 Remote port: 8476
Thu Jun 10 13:14:39 CDT 2004 Local address: /10.0.0.165
Thu Jun 10 13:14:39 CDT 2004 Local port: 1184
Thu Jun 10 13:14:39 CDT 2004 Keep alive: false
Thu Jun 10 13:14:39 CDT 2004 Receive buffer size: 8192
Thu Jun 10 13:14:39 CDT 2004 Send buffer size: 8192
Thu Jun 10 13:14:39 CDT 2004 So linger: -1
Thu Jun 10 13:14:39 CDT 2004 So timeout: 0
Thu Jun 10 13:14:39 CDT 2004 TCP no delay: false
Thu Jun 10 13:14:39 CDT 2004 Starting an inet socket to as-signon
Thu Jun 10 13:14:39 CDT 2004 Sending signon server exchange
client/server attributes request...
Thu Jun 10 13:14:39 CDT 2004 Receiving signon server exchange
client/server attributes reply...
Thu Jun 10 13:14:39 CDT 2004 Server vrm:
00 05 01 00
Thu Jun 10 13:14:39 CDT 2004 Server level: 2
Thu Jun 10 13:14:39 CDT 2004 Socket opened successfully.
Thu Jun 10 13:14:39 CDT 2004 Retrieving encrypted password.
Thu Jun 10 13:14:39 CDT 2004 Sending retrieve signon information
request...
Thu Jun 10 13:14:39 CDT 2004 Receiving retrieve signon information
reply...
Thu Jun 10 13:14:39 CDT 2004 Read security validation reply...
Thu Jun 10 13:14:39 CDT 2004 Security validated successfully.
Thu Jun 10 13:14:39 CDT 2004 Signon server reports CCSID: 37
Thu Jun 10 13:14:39 CDT 2004 Sign-on completed.
Thu Jun 10 13:14:39 CDT 2004 Sending end job data stream to signon
server...
Thu Jun 10 13:14:39 CDT 2004 Sending end signon server request...
Thu Jun 10 13:14:39 CDT 2004 Service disconnected implementation:
as-signon
Thu Jun 10 13:14:39 CDT 2004 Establishing connection to server: as-file
Thu Jun 10 13:14:39 CDT 2004 Loading browser security classes.
Thu Jun 10 13:14:39 CDT 2004 Netscape browser security classes not
loaded.
Thu Jun 10 13:14:39 CDT 2004 IE browser security classes not loaded.
Thu Jun 10 13:14:39 CDT 2004 Connecting to port mapper...
Thu Jun 10 13:14:39 CDT 2004 Sending port mapper request...
Thu Jun 10 13:14:39 CDT 2004 Receiving port mapper reply...
Thu Jun 10 13:14:39 CDT 2004 Adding entry to Service Port table: system
10.0.0.4, service as-file, port 8473
Thu Jun 10 13:14:39 CDT 2004 Opening socket to server...
Thu Jun 10 13:14:39 CDT 2004 Setting socket options...
Thu Jun 10 13:14:39 CDT 2004 Socket properties:
Thu Jun 10 13:14:39 CDT 2004 Remote address: /10.0.0.4
Thu Jun 10 13:14:39 CDT 2004 Remote port: 8473
Thu Jun 10 13:14:39 CDT 2004 Local address: /10.0.0.165
Thu Jun 10 13:14:39 CDT 2004 Local port: 1186
Thu Jun 10 13:14:39 CDT 2004 Keep alive: false
Thu Jun 10 13:14:39 CDT 2004 Receive buffer size: 8192
Thu Jun 10 13:14:39 CDT 2004 Send buffer size: 8192
Thu Jun 10 13:14:39 CDT 2004 So linger: -1
Thu Jun 10 13:14:39 CDT 2004 So timeout: 0
Thu Jun 10 13:14:39 CDT 2004 TCP no delay: false
Thu Jun 10 13:14:39 CDT 2004 Starting an inet socket to as-file
Thu Jun 10 13:14:39 CDT 2004 Sending exchange random seeds request...
Thu Jun 10 13:14:39 CDT 2004 Receiving exchange random seeds reply...
Thu Jun 10 13:14:39 CDT 2004 Exchange of random seeds successful.
Thu Jun 10 13:14:39 CDT 2004 Retrieving encrypted password.
Thu Jun 10 13:14:39 CDT 2004 Sending start server request...
Thu Jun 10 13:14:39 CDT 2004 Receiving start server reply...
Thu Jun 10 13:14:39 CDT 2004 Server started successfully.
Thu Jun 10 13:14:39 CDT 2004 Service connected: as-file
Thu Jun 10 13:14:39 CDT 2004 run(): Waiting for reply...
Thu Jun 10 13:14:39 CDT 2004 Connecting service: 2
Thu Jun 10 13:14:39 CDT 2004 Establishing connection to server:
as-rmtcmd
Thu Jun 10 13:14:39 CDT 2004 Loading browser security classes.
Thu Jun 10 13:14:39 CDT 2004 Netscape browser security classes not
loaded.
Thu Jun 10 13:14:39 CDT 2004 IE browser security classes not loaded.
Thu Jun 10 13:14:39 CDT 2004 Connecting to port mapper...
Thu Jun 10 13:14:39 CDT 2004 Sending port mapper request...
Thu Jun 10 13:14:39 CDT 2004 Receiving port mapper reply...
Thu Jun 10 13:14:39 CDT 2004 Adding entry to Service Port table: system
10.0.0.4, service as-rmtcmd, port 8475
Thu Jun 10 13:14:39 CDT 2004 Opening socket to server...
Thu Jun 10 13:14:39 CDT 2004 Setting socket options...
Thu Jun 10 13:14:39 CDT 2004 Socket properties:
Thu Jun 10 13:14:39 CDT 2004 Remote address: /10.0.0.4
Thu Jun 10 13:14:39 CDT 2004 Remote port: 8475
Thu Jun 10 13:14:39 CDT 2004 Local address: /10.0.0.165
Thu Jun 10 13:14:39 CDT 2004 Local port: 1188
Thu Jun 10 13:14:39 CDT 2004 Keep alive: false
Thu Jun 10 13:14:39 CDT 2004 Receive buffer size: 8192
Thu Jun 10 13:14:39 CDT 2004 Send buffer size: 8192
Thu Jun 10 13:14:39 CDT 2004 So linger: -1
Thu Jun 10 13:14:39 CDT 2004 So timeout: 0
Thu Jun 10 13:14:39 CDT 2004 TCP no delay: false
Thu Jun 10 13:14:39 CDT 2004 Starting an inet socket to as-rmtcmd
Thu Jun 10 13:14:39 CDT 2004 Sending exchange random seeds request...
Thu Jun 10 13:14:39 CDT 2004 Receiving exchange random seeds reply...
Thu Jun 10 13:14:40 CDT 2004 Exchange of random seeds successful.
Thu Jun 10 13:14:40 CDT 2004 Retrieving encrypted password.
Thu Jun 10 13:14:40 CDT 2004 Sending start server request...
Thu Jun 10 13:14:40 CDT 2004 Receiving start server reply...
Thu Jun 10 13:14:40 CDT 2004 Server started successfully.
Thu Jun 10 13:14:40 CDT 2004 Service connected: as-rmtcmd
Thu Jun 10 13:14:40 CDT 2004 Connecting service: 3
Thu Jun 10 13:14:40 CDT 2004 Establishing connection to server: as-dtaq
Thu Jun 10 13:14:40 CDT 2004 Loading browser security classes.
Thu Jun 10 13:14:40 CDT 2004 Netscape browser security classes not
loaded.
Thu Jun 10 13:14:40 CDT 2004 IE browser security classes not loaded.
Thu Jun 10 13:14:40 CDT 2004 Connecting to port mapper...
Thu Jun 10 13:14:40 CDT 2004 run(): Waiting for reply...
Thu Jun 10 13:14:40 CDT 2004 Sending port mapper request...
Thu Jun 10 13:14:40 CDT 2004 Receiving port mapper reply...
Thu Jun 10 13:14:40 CDT 2004 Adding entry to Service Port table: system
10.0.0.4, service as-dtaq, port 8472
Thu Jun 10 13:14:40 CDT 2004 Opening socket to server...
Thu Jun 10 13:14:40 CDT 2004 Setting socket options...
Thu Jun 10 13:14:40 CDT 2004 Socket properties:
Thu Jun 10 13:14:40 CDT 2004 Remote address: /10.0.0.4
Thu Jun 10 13:14:40 CDT 2004 Remote port: 8472
Thu Jun 10 13:14:40 CDT 2004 Local address: /10.0.0.165
Thu Jun 10 13:14:40 CDT 2004 Local port: 1190
Thu Jun 10 13:14:40 CDT 2004 Keep alive: false
Thu Jun 10 13:14:40 CDT 2004 Receive buffer size: 8192
Thu Jun 10 13:14:40 CDT 2004 Send buffer size: 8192
Thu Jun 10 13:14:40 CDT 2004 So linger: -1
Thu Jun 10 13:14:40 CDT 2004 So timeout: 0
Thu Jun 10 13:14:40 CDT 2004 TCP no delay: false
Thu Jun 10 13:14:40 CDT 2004 Starting an inet socket to as-dtaq
Thu Jun 10 13:14:40 CDT 2004 Sending exchange random seeds request...
Thu Jun 10 13:14:40 CDT 2004 Receiving exchange random seeds reply...
Thu Jun 10 13:14:40 CDT 2004 Exchange of random seeds successful.
Thu Jun 10 13:14:40 CDT 2004 Retrieving encrypted password.
Thu Jun 10 13:14:40 CDT 2004 Sending start server request...
Thu Jun 10 13:14:40 CDT 2004 Receiving start server reply...
Thu Jun 10 13:14:40 CDT 2004 Server started successfully.
Thu Jun 10 13:14:40 CDT 2004 Service connected: as-dtaq
Thu Jun 10 13:14:40 CDT 2004 run(): Waiting for reply...
Thu Jun 10 13:14:40 CDT 2004 Connecting service: 5
Thu Jun 10 13:14:40 CDT 2004 Establishing connection to server: as-ddm
Thu Jun 10 13:14:40 CDT 2004 Loading browser security classes.
Thu Jun 10 13:14:40 CDT 2004 Netscape browser security classes not
loaded.
Thu Jun 10 13:14:40 CDT 2004 IE browser security classes not loaded.
Thu Jun 10 13:14:40 CDT 2004 Opening socket to server...
Thu Jun 10 13:14:40 CDT 2004 Setting socket options...
Thu Jun 10 13:14:40 CDT 2004 Socket properties:
Thu Jun 10 13:14:40 CDT 2004 Remote address: /10.0.0.4
Thu Jun 10 13:14:40 CDT 2004 Remote port: 446
Thu Jun 10 13:14:40 CDT 2004 Local address: /10.0.0.165
Thu Jun 10 13:14:40 CDT 2004 Local port: 1191
Thu Jun 10 13:14:40 CDT 2004 Keep alive: false
Thu Jun 10 13:14:40 CDT 2004 Receive buffer size: 8192
Thu Jun 10 13:14:40 CDT 2004 Send buffer size: 8192
Thu Jun 10 13:14:40 CDT 2004 So linger: -1
Thu Jun 10 13:14:40 CDT 2004 So timeout: 0
Thu Jun 10 13:14:40 CDT 2004 TCP no delay: false
Thu Jun 10 13:14:40 CDT 2004 Starting an inet socket to as-ddm
Thu Jun 10 13:14:40 CDT 2004 Exchanging DDM security information with a
V4R2 or newer system.
Thu Jun 10 13:14:40 CDT 2004 Sending DDM: V4R2 or newer system: EXCSAT
request...
Thu Jun 10 13:14:40 CDT 2004 Receiving DDM: V4R2 or newer system:
EXCSAT Reply...
Thu Jun 10 13:14:40 CDT 2004 DDM: Running to V4R4 or newer system.
Thu Jun 10 13:14:40 CDT 2004 Sending DDM: V4R4 or newer system: ACCSEC
request...
Thu Jun 10 13:14:40 CDT 2004 Receiving DDM: V4R4 or newer system:
ACCSEC reply...
Thu Jun 10 13:14:40 CDT 2004 Retrieving encrypted password.
Thu Jun 10 13:14:40 CDT 2004 Receiving DDM: V4R4 or newer system:
SECCHK reply...
Thu Jun 10 13:14:40 CDT 2004 DDM: V4R4 or newer system: SECCHK
succeeded.
Thu Jun 10 13:14:40 CDT 2004 DDM: Exchange of security attributes
completed.
Thu Jun 10 13:14:40 CDT 2004 Server started successfully.
Thu Jun 10 13:14:40 CDT 2004 Service connected: as-ddm
Thu Jun 10 13:14:40 CDT 2004 run(): Waiting for reply...
Thu Jun 10 13:14:40 CDT 2004 Connecting service: 0
Thu Jun 10 13:14:40 CDT 2004 Establishing connection to server: as-file
Thu Jun 10 13:14:40 CDT 2004 Reusing previous server object...
Thu Jun 10 13:14:40 CDT 2004 Service connected: as-file
Thu Jun 10 13:14:40 CDT 2004 Establishing connection to server: as-file
Thu Jun 10 13:14:40 CDT 2004 Reusing previous server object...
Thu Jun 10 13:14:40 CDT 2004 Getting implementation VRM.
Thu Jun 10 13:14:40 CDT 2004 Implementation VRM:
00 05 01 00
Thu Jun 10 13:14:40 CDT 2004 send and receive(): ...
Thu Jun 10 13:14:40 CDT 2004 send(): send request...
Thu Jun 10 13:14:40 CDT 2004 AS400Server.receive
Thu Jun 10 13:14:40 CDT 2004 receive(): Reply not found. Waiting...
Thu Jun 10 13:14:40 CDT 2004 run(): Reply received:
com.ibm.as400.access.IFSReturnCodeRep@8001
Thu Jun 10 13:14:40 CDT 2004 run(): Adding reply: 1
Thu Jun 10 13:14:40 CDT 2004 run(): Notifying threads.
Thu Jun 10 13:14:40 CDT 2004 run(): Threads notified.
Thu Jun 10 13:14:40 CDT 2004 receive(): Valid reply found: 1
Thu Jun 10 13:14:40 CDT 2004 run(): Waiting for reply...
Other Exception:
java.lang.ClassCastException
at
com.ibm.as400.access.IFSFileDescriptorImplRemote.exchangeServerAttribute
s(IFSFileDescriptorImplRemote.java:262)
at
com.ibm.as400.access.IFSFileDescriptorImplRemote.connect(IFSFileDescript
orImplRemote.java:203)
at
com.ibm.as400.access.IFSFileImplRemote.mkdir0(IFSFileImplRemote.java:123
8)
at com.ibm.as400.access.IFSFile.mkdir0(IFSFile.java:2021)
at com.ibm.as400.access.IFSFile.mkdir(IFSFile.java:2042)
at JT400Test.main(JT400Test.java:51)
========================================================================
====
Thanks!
Dan Feather
dfeather@xxxxxxxxxxxxx
NOTICE: This electronic mail message and any files transmitted with it are
intended exclusively for the individual or entity to which it is addressed. The
message, together with any attachment, may contain confidential and/or
privileged information. Any unauthorized review, use, printing, saving,
copying, disclosure or distribution is strictly prohibited. If you have
received this message in error, please immediately advise the sender by reply
email and delete all copies.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.