Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

jaxp 1.4 on jre 1.4.2

Thread view: 
Matt Rose - 25 May 2007 16:38 GMT
Dear all,

I am trying to use the jaxp 1.4 standalone download from java.net with
Sun JRE 1.4.2. Here is a minimal test class:

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;

import org.w3c.dom.Document;

public class TestJaxp {
    public static void main(String[] args) throws Exception {
        Document doc = DocumentBuilderFactory.newInstance()
                .newDocumentBuilder().newDocument();
        XPath xpath = XPathFactory.newInstance().newXPath();
        xpath.evaluate("/", doc);
    }
}

It fails with:

java.lang.NoClassDefFoundError: com/sun/org/apache/xalan/internal/
extensions/ExpressionContext
    at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:
201)
    at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:
275)
    at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:
365)
    at TestJaxp.main(TestJaxp.java:13)
Exception in thread "main"

My classpath consists of this class followed by jaxp-api.jar then jaxp-
ri.jar.

What am I doing wrong?

Thanks,

Matt
Arne Vajhøj - 25 May 2007 22:45 GMT
> I am trying to use the jaxp 1.4 standalone download from java.net with
> Sun JRE 1.4.2. Here is a minimal test class:
[quoted text clipped - 18 lines]
> java.lang.NoClassDefFoundError: com/sun/org/apache/xalan/internal/
> extensions/ExpressionContext

> My classpath consists of this class followed by jaxp-api.jar then jaxp-
> ri.jar.

Have you read http://java.sun.com/webservices/jaxp/reference/faqs/index.html
question 14 ?

Arne
Matt Rose - 29 May 2007 14:13 GMT
> > I am trying to use the jaxp1.4 standalone download from java.net with
> > Sun JRE 1.4.2. Here is a minimal test class:
[quoted text clipped - 25 lines]
>
> Arne

I hadn't read that but I don't think it addresses my problem. I tried
fiddling with the settings as described and set it to both explicitly
use the jaxp xerces implementation (which it was doing by default) and
the JRE crimson implementation but received the same error on each
occasion.

The problem goes away if I execute it with a 1.5 JRE.

Matt
Matt Rose - 29 May 2007 16:41 GMT
> > > I am trying to use the jaxp1.4 standalone download from java.net with
> > > Sun JRE 1.4.2. Here is a minimal test class:
[quoted text clipped - 35 lines]
>
> Matt

For the record, this is a bug in the packaging of the 1.4.1 release
that omitted a few classes needed to run on JRE1.4, one of which is
ExpressionContext. The JAXP folks are aware of it and I believe a fix
is likely soon.

Matt


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.