0

I am trying to integrate spring 3.0, hibernate 3.0 with db2 8.x database but i am found following exception. Please any body can help me regarding this.

Thanks in Advance.

type Exception report

message Handler processing failed; nested exception is java.lang.NoClassDefFoundError: sun/io/ByteToCharConverter

description The server encountered an internal error that prevented it from fulfilling this request.

exception 

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: sun/io/ByteToCharConverter`
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


root cause 

java.lang.NoClassDefFoundError: sun/io/ByteToCharConverter
    com.ibm.db2.jcc.a.o.a(o.java:149)
    com.ibm.db2.jcc.b.d.a(d.java:923)
    com.ibm.db2.jcc.b.bd.a(bd.java:1575)
Cuzz
  • 428
  • 2
  • 4
  • 20

3 Answers3

0

May be your lower java version. Check below link to java version for db2 database.


http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.server.doc/doc/r0011932.html?cp=SSEPGG_10.5.0%2F2-0-1-1

Ye Win
  • 2,020
  • 14
  • 21
0

I encountered the same problem with WildFly. I am not sure, but could it be that your Java EE container has a classloader which does not allow Java classes in sun.io.*?

Some answers on Stackoverflow indicate that the sun.jdk module has to be activated in the server configuration to allow usage of sun.* classes.

mjn
  • 36,362
  • 28
  • 176
  • 378
0

Update the artifactId db2jcc to version 1.4.2 and update db2jcc_license_cu to 1.4.2 the groupId is cn.guoyukun.jdbc

<dependency>
<groupId>cn.guoyukun.jdbc</groupId>
<artifactId>db2jcc</artifactId>
<version>1.4.2</version>
</dependency>

<dependency>
<groupId>cn.guoyukun.jdbc</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>1.4.2</version>
</dependency>
JakeYu
  • 1
  • 1