Monday, April 28, 2008

NoSuchMethodError: javax.xml.parsers.DocumnentBuilderFactory.getSchema()

java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.getSchema()Ljavax/xml/validation/Schema;
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)

Cause: You are using a different version of the DocumentBuilderFactory class

Solution:

This version of the javax.xml.parsers.DocumentBuilderFactory is used by the xercesImpl.jar and is defined in the jaxp-api.jar

This class is defined in the following jars:
xml-apis.jar
xmlParserAPIs.jar
xercesImpl-2.8.1.jar
jaxp-api.jar

In addition, this class is also include in the JVM. The JVM implementation of this class does not define a getSchema() method.

The only jar that contains an implementation of the DocmentBuilderFactory with the getSchema() method defined is the jaxp-api.jar. In order for this implementation to be used instead of the JVM's implementation or the other jar's implementation, you must either endorse this jar or put this jaxp-api.jar at the top of the classpath.

NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl

java.lang.NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl
at java.lang.ClassLoader.defineClass0(Native Method)
..........
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.(SOAPPartImpl.java:63)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.(SOAPPart1_1Impl.java:29)
at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:52)
at

Cause: Missing a class
Solution:
There are two versions of the xercesImpl.jar that define the different classes in different packages. These packages are the following:

com.sun.org.apache
org.apache

The DocumentImpl class is defined in the following packages of each corresponding jar:
com.sun.org.apache.exerces.internal.dom
org.apache.xerces.dom

The jar that contains the DocumentImpl of the NoClassDefFoundError is contained in the first jar. Please include this jar in the classpath before the second version of the jar.

Reference:
http://mail-archives.apache.org/mod_mbox/xerces-j-users/200407.mbox/%3C40F0D3AD.3050201@sun.com%3E

Monday, April 21, 2008

Mule Error: Application does not seem to be starting or is hanging

Error:
Launching a JVM...
Error [125] in bind() call!
err:: Address already in use
Socket transport failed to init.
Transport dt_socket failed to initialize, rc = -1.
FATAL ERROR in native method: No transports initialized
JVM exited while loading the application.
------------------------------------------------------------------------
The JVM is being launched with a debugger enabled and could possibly be
suspended. To avoid unwanted shutdowns, timeouts will be disabled,
removing the ability to detect and restart frozen JVMs.
------------------------------------------------------------------------

The logs display the above error.

This indicates that the port for debugging is already in use, and not the actual mule application's port.

Change the debug port in the wrapper.conf.

wrapper.java.additional.5=-Xrunjdwp:transport=dt_socket,address=5295,server=y,suspend=y

Tuesday, April 8, 2008

CSS

So, I'm creating a website and I'm noting some things down about CSS I'm learning from an actual site. Cool dudes.

CSS Styles

position: relative |

color: #ABC123
background-color: #ABC123
font:
font-size: XXXpx | XXX
width: XXXpx
margin: XXXpx
margin-bottom: XXXpx
margin-right:
padding:
text-align: center |
border: XXX