Reputation: 33
Our server was updated to java 8 and the code below no longer works. I am using the latest version of jtopen and can not get it to work in java 7 or 8.
The code uses the jtopen (java toolkit) to access the integrated file system on the IBM i.
AS400 as400 = new AS400("myip","myuser","mypassword")
IFSFile file = new IFSFile(as400, params.path);
if (file.exists()){
Ifs ifs = new Ifs()
ifs.CopyFile(as400,params.path,response)
as400.disconnectAllServices();
}
else {
redirect(action: "fileNotFound")
}
I am getting the following error:
java.beans.IntrospectionException: Method not found: setLastModified. Stacktrace follows: java.lang.reflect.InvocationTargetException: null at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_77] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77] Caused by: java.lang.Error: java.beans.IntrospectionException: Method not found: setLastModified at com.ibm.as400.access.IFSFileBeanInfo.(IFSFileBeanInfo.java:126) ~[jt400-8.7.jar:JTOpen 8.7] at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_77] at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:96) ~[na:1.8.0_77] at com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:66) ~[na:1.8.0_77] at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:448) ~[na:1.8.0_77] at java.beans.Introspector.(Introspector.java:398) ~[na:1.8.0_77] at java.beans.Introspector.getBeanInfo(Introspector.java:173) ~[na:1.8.0_77] at PageController.getBoardReport(PageController.groovy:113) ~[main/:na]
Any ides how to resolve this problem?
Upvotes: 2
Views: 3598
Reputation: 586
It looks like the Java beans infrastructure changed in 1.7 to require that setter methods have a return type of void (see Why did PropertyDescriptor behavior change from Java 1.6 to 1.7?). The setLastModified method has a return type of boolean to match the similar method in java.io.File. A fix for IFSFileBeanInfo.java has been checked into the JTOpen CVS respository. You will either need to build JTOpen yourself, ask IBM service for a jt400.jar containing the fix, or wait for the next release of JTOpen.
Upvotes: 2