Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: JDK 1.7 migration issue: java.lang.ExceptionInInitializerError

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JDK 1.7 migration issue: java.lang.ExceptionInInitializerError

    We migrated our project to JDK 1.7 from 1.6. Getting below run time exception for few JUNITS which worked fine with JDK 1.6.
    Found that we may be hitting below bugs in JDK 1.7 related to specifying file.encoding=UTF-8 while running java.
    Does any one have hit this issue? Looking for any workaround and possible solutions.

    7181721,7050570


    java.lang.ExceptionInInitializerError
    at java.nio.file.FileSystems.getDefault(FileSystems.j ava:176)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.TimeZone.getTimeZone(TimeZone.java:571)
    at java.util.TimeZone.setDefaultZone(TimeZone.java:66 8)
    at java.util.TimeZone.getDefaultRef(TimeZone.java:635 )
    at java.util.Calendar.getInstance(Calendar.java:968)
    at org.eclipse.persistence.internal.helper.Helper.ini tCalendarCache(Helper.java:165)
    at org.eclipse.persistence.internal.helper.Helper.<cl init>(Helper.java:81)
    at org.eclipse.persistence.descriptors.ClassDescripto r.getAlias(ClassDescriptor.java:1902)
    at org.eclipse.persistence.sessions.Project.addDescri ptor(Project.java:371)
    at org.eclipse.persistence.sessions.Project.addDescri ptor(Project.java:1)
    at org.eclipse.persistence.jaxb.compiler.MappingsGene rator.generateDescriptor(MappingsGenerator.java:51 5)
    at org.eclipse.persistence.jaxb.compiler.MappingsGene rator.generateProject(MappingsGenerator.java:231)
    at org.eclipse.persistence.jaxb.compiler.Generator.ge nerateProject(Generator.java:188)
    at org.eclipse.persistence.jaxb.JAXBContext$ContextPa thInput.createContextState(JAXBContext.java:883)
    at org.eclipse.persistence.jaxb.JAXBContext$ContextPa thInput.createContextState(JAXBContext.java:876)
    at org.eclipse.persistence.jaxb.JAXBContext$ContextPa thInput.createContextState(JAXBContext.java:812)
    at org.eclipse.persistence.jaxb.JAXBContext.<init>(JA XBContext.java:174)
    at org.eclipse.persistence.jaxb.JAXBContextFactory.cr eateContext(JAXBContextFactory.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at javax.xml.bind.ContextFinder.newInstance(ContextFi nder.java:172)
    at javax.xml.bind.ContextFinder.newInstance(ContextFi nder.java:132)
    at javax.xml.bind.ContextFinder.find(ContextFinder.ja va:294)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext .java:431)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext .java:394)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext .java:298)
    at com.cisco.ccbu.uccx.adminapi.common.Util.getContex t(Util.java:47)
    <---our project source calls JAXBContext.newInstance()---->


  2. #2
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: JDK 1.7 migration issue: java.lang.ExceptionInInitializerError

    Quote Originally Posted by raghavanak View Post
    We migrated our project to JDK 1.7 from 1.6. Getting below run time exception for few JUNITS which worked fine with JDK 1.6.
    Found that we may be hitting below bugs in JDK 1.7 related to specifying file.encoding=UTF-8 while running java.
    Does any one have hit this issue? Looking for any workaround and possible solutions.
    One comment states "-Dfile.encoding is not a supported usage". So the question is: why do you need this?
    Andrea, www.andbin.net — SCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginners – My new project Java Examples on Google Code

  3. The Following User Says Thank You to andbin For This Useful Post:

    GregBrannon (January 13th, 2014)

  4. #3
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JDK 1.7 migration issue: java.lang.ExceptionInInitializerError

    Quote Originally Posted by andbin View Post
    One comment states "-Dfile.encoding is not a supported usage". So the question is: why do you need this?
    Confirmed we dont use -Dfile.encoding. Code works in 1.6 but fails in 1.7. Below simple code fails in 1.7

    JAXBContext.newInstance("com.a.b");

Similar Threads

  1. Replies: 2
    Last Post: July 2nd, 2013, 04:59 PM
  2. MS SQL server 2005 to 2008 R2 migration
    By sandeep23k in forum JDBC & Databases
    Replies: 3
    Last Post: April 9th, 2011, 10:53 AM
  3. Help with jdk/Java software
    By IpodHero in forum Java IDEs
    Replies: 1
    Last Post: December 16th, 2010, 10:05 AM
  4. Replies: 2
    Last Post: November 3rd, 2009, 05:28 AM
  5. Replies: 2
    Last Post: August 4th, 2009, 11:25 PM