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

Monday, March 31, 2008

Lesson of the Day

"We learn something new everyday!" As a tribute to this saying...

We have this large million of records table. An audit table exists to record every single update or deletion of a row in this table. We were thinking of creating an index on this audit table where no indexes existed before. However, every update/deletion would require an update of this new index, therefore, slowing the performance of write operations on this table.

Lesson of the Day: Indexes, although improves the performance of read operations, leads to more overheard if this table is often updated.

I know i'm dumb..

Saturday, March 29, 2008

Flex Error: ReferenceError: Error #1065

This error often refers to missing assets in the swf file that is expected to be there. For example, if you get the following error:

Variable ExampleView__embed_mxml__assets_png_example_picture_png_1012766830 is not defined.

It refers to a missing asset in an mxml file called ExampleView attempting to reference a png file as in the VBox below:

<mx:VBox backgroundImage="@Embed(source='/assets/png/example_picture.png')" width="100%"

In this instance, you must remember to include these assets into the compiled swf files.

Friday, March 14, 2008

Flash Global Security Settings: Windows vs. Macs

There seems to be a slight difference between how global security settings are set on Windows and Macs browsers. To note, when you set the global security settings, they are set "globally" for the machine and not for the particular browser where the security setting was set.

On Macs, you can just specify the swf file in the global security settings. The swf file will load successfully and any external interface registered functions can be successfully called.

On Windows, however, specifying the swf file in the global security settings will allow the swf file to load correctly. But, this does not allow registered external interface functions to be called. It will cause the following js error:

Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.].
In order for external interface functions to be called, you must also specify the folder/file where the swf file is located.