Posts

Showing posts with the label maven

Up Next

I think it was back in March that I first blogged about DropWizard .  DropWizard is one of those funny technologies that I find falls into the category of sometimes making folks uncomfortable.  This usually initially comes off as looking down upon unconventional solutions but if you can have a conversation about it there may be something more. Sure there are organizations full of folks who won't discuss anything that's either "not supported" or even slightly off the beaten path.  It's not always part of the reason but it's worth keeping the "resume padding" factor in the back of your mind when having these discussions.  The other thought from days gone by is the "No one ever got fired for recommending ____________" (fill in the blank with your favorite currently popular and profitable software giant). The last time I blogged about DropWizard it was still new to me but I got it pretty quickly and I think you will too if it fits your use ...

ClassCastException: JAXB

Image
A particular Java application I co-developed leverages both SOAP/WSDL and REST web services.  We use maven to manage the build process of this application which has been in production for a few years now.  It's been around long enough to have moved from Java 5 to Java 6 and now Java 7 (with limited testing using Java 8).  We have also had the experience of initially including JAXB jar files with our application and dealing with the "endorsed" directory because JAXB versions were a bit of a moving target for a while. Now that JAXB is neatly included with Java as it should be so we no longer include it.  I thought all of this was behind us (and unfortunately somewhat forgotten) until recently when we added Jersey 1.17 to the application to call some newer REST services. When trying to connect to the server, my stack trace included this: Caused by: java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.internal.bin...
Proguard on the Mac... In trying to do a maven build on OS X which includes the proguard plugin for obfuscation we ran into an issue. Three jar files which are included in the runtime library in the Sun, I mean Oracle, Java version are not found. The solution we chose was to create three symbolic links like this (from JAVA_HOME/lib): sudo ln -s ../../Classes/classes.jar rt.jar sudo ln -s ../../Classes/jsse.jar . sudo ln -s ../../Classes/charsets.jar . If you don't know where your JAVA_HOME is, run this command: /usr/libexec/java_home