• Post Reply Bookmark Topic Watch Topic
  • New Topic

sun.io.MalformedInputException  RSS feed

 
medhaj hambi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,

We have a SAP ESB adapter that is throwing below error while communicating to a target system

java.lang.NoClassDefFoundError: sun/io/MalformedInputException; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException; nested exception is: javax.ejb.EJBTransactionRolledbackException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException

Based on my understanding of the error, as of JVM 8/ Java 1.8, the class sun/io/MalformedInputException is decommissioned. We are in a critical project and have come across this unanticipated road block and my question is is there a way we can make it backward compatible by adding some other Jar that provide the patches for this error ? Is the solution in this case to identify the exception calls and modify those and redeploy the application ?
I would really appreciate it if I can get prompt feedback and some suggestions on the topic.

Tx
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is exactly the reason why nobody should ever use these internal classes...

Anyway, what's the class that is using this exception class? Because my first attempt to fix the issue would be to remove this dependency. Are you using this class yourself? Or is it some 3rd party library or even your JEE container that is using it? Have you made sure that your JEE container even supports Java 8? Because I know that some older versions of WebLogic, JBoss and several other don't support Java 8 yet (one of the reasons why I have to work with Java 7 at work for one project...).
 
medhaj hambi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob. I am not sure if this is part of the actual codebase or whether it belongs some external jar files. Basically I have one SCA file that is used to deploy in our landscape. To give you some more context on the actual issue, we are a third party adapter that sits on top of SAP ESB. As of recently SAP has certified the usage of its Std. adapters on JVM 8, whereas our adapter is not. We had a customer using the adapter on JVM 8 and that's where the issue began.

I am not the developer who worked on it, so I have no idea where to look for. What I do know is that the root cause of the exception is that this class is deprecated and is not available in Java 1.8 (I wrote a simple import statement in eclipse with JVM 1.8 and with 1.7 the code compiles fine). Now my question would be is there a way for me look at the code base from the SCA file ? What would those steps be ? I basically extracted all the jars out of the SCA file, but not sure where to go from there. If there is anyone who can point me in the right direction, I would very much appreciate that.

Thanks a lot.
 
Paul Clapham
Sheriff
Posts: 22379
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would help if you had a stack trace, rather than just the bare description of the exception. That would tell you exactly what class was trying to use the sun.io class. Perhaps you can find one in a log somewhere? Or change the configuration so that stack traces are included in error logs?
 
medhaj hambi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[EXCEPTION]
javax.ejb.EJBTransactionRolledbackException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException
javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException
java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:99)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:172)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:99)
at com.sun.proxy.$Proxy231.process(Unknown Source)
at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:264)
at sun.reflect.GeneratedMethodAccessor625.invoke(Unknown Source)

Caused by: java.lang.NoClassDefFoundError: sun/io/MalformedInputException
at com.ariba.asc.sap.netweaver.xiadapter.ra.CCIInteraction.execute(CCIInteraction.java:197)
at com.sap.aii.af.app.endpoint.ModuleProcessorExitBean.process(ModuleProcessorExitBean.java:206)
at sun.reflect.GeneratedMethodAccessor628.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
... 90 more
Caused by: java.lang.ClassNotFoundException: sun.io.MalformedInputException
------------------------- Loader Info -------------------------
ClassLoader name: [ariba.com/com.an.asc.sap.netweaver.xiadapter.ra]
Loader hash code: 116852c0
Living status: alive
Direct parent loaders:
[system:Frame]
[service:servlet_jsp]
[service:ejb]
[interface:com.sap.aii.af.ifc.facade]
[service:engine.security.facade]
[library:com.sap.aii.af.lib.facade]
[service:com.sap.aii.af.svc.facade]
Resources:
D:\\usr\\sap\\DP1\\J00\\j2ee\\cluster\\apps\\ariba.com\\com.ariba.asc.sap.netweaver.xiadapter.ra\\connector\\bin\\AribaNetworkAdapterSAPNetweaver.rar\\AribaNetworkAdapterSAPNetweaver.jar
D:\\usr\\sap\\DP1\\J00\\j2ee\\cluster\\apps\\ariba.com\\com.ariba.asc.sap.netweaver.xiadapter.ra\\connector\\bin\\AribaNetworkAdapterSAPNetweaver.rar\\commons-httpclient.jar
D:\\usr\\sap\\DP1\\J00\\j2ee\\cluster\\apps\\ariba.com\\com.ariba.asc.sap.netweaver.xiadapter.ra\\connector\\bin\\AribaNetworkAdapterSAPNetweaver.rar\\commons-codec.jar
D:\\usr\\sap\\DP1\\J00\\j2ee\\cluster\\apps\\ariba.com\\com.ariba.asc.sap.netweaver.xiadapter.ra\\connector\\bin\\AribaNetworkAdapterSAPNetweaver.rar\\xercesImpl.jar

javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: sun/io/MalformedInputException
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:99)
 
Paul Clapham
Sheriff
Posts: 22379
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So there you go, those stack traces tell you which classes are calling the problematic method.

But I'm a bit surprised -- you're using SAP which from what I've heard is a large and complex system which costs a lot of money. So do you not have a support contract with SAP, or whatever expensive consultants installed this code? That's the first approach I would be taking.
 
medhaj hambi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, I have already started that thread. This is just being a curious me and wanted to dig deep into the root cause analysis.

Anyway thanks for your help,

Cheers
 
medhaj hambi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious, is there a way for anyone to find out the list of the classes that are part of the SCA file that are obsolete ? I am hoping there is some kind of a command line utility that tells us that. Any thoughts ?
 
medhaj hambi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I managed to find the list of classes/methods that are deprecated. Is there anyway I can get the alternatives to these ? I couldnt find anywhere on this at Oracles website. Pl suggest.

These are the classes and methods I am interested in.
sun.io.ByteToCharConverter
sun.io.MalformedInputException


 
Campbell Ritchie
Sheriff
Posts: 55366
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have those sun... classes been deprecated or simply removed?
 
medhaj hambi
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears they have been removed. Although I could find one link
http://www.docjar.com/docs/api/sun/io/ByteToCharConverter.html

and thats where my second question lies, is there a way for me to use ByteToChar conversion functionality from within java.nio.charset ? If yes, can I please get a code snippet ? I have trying to find with no luck and would really appreciate it if I could get one.

Regards
 
Dave Tolls
Ranch Hand
Posts: 2846
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first question would be, is the version of whatever SAP thing you are using certified against Java 8?
I suspect not, and you need to upgrade maybe to a newer version of the SAP software.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!