Configuration problem?

85 views
Skip to first unread message

Тхано

unread,
May 12, 2010, 8:18:11 AM5/12/10
to Hazelcast
When I tried to use Hazelcast with Apache Felix, I got the error:

java.lang.NoClassDefFoundError: org/w3c/dom/Node
at
com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(FactoryImpl.java:
89)
at
com.hazelcast.core.Hazelcast.getDefaultInstance(Hazelcast.java:73)
at com.hazelcast.core.Hazelcast.getTopic(Hazelcast.java:97)
...
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.Node
at
org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:
564)
at org.apache.felix.framework.searchpolicy.ModuleImpl.access
$100(ModuleImpl.java:58)
at org.apache.felix.framework.searchpolicy.ModuleImpl
$ModuleClassLoader.loadClass(ModuleImpl.java:1405)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

What should I do to fix it?

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To post to this group, send email to haze...@googlegroups.com.
To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.

Vivek Pandey

unread,
May 12, 2010, 1:21:28 PM5/12/10
to haze...@googlegroups.com
A quick look at hazelcast.jar MANIFEST, it looks like its OSGified,

Import-Package: javax.xml.parsers, javax.xml.transform

Can you try by adding org.w3c.dom in the Import-Package list? I guess, if the MANIFEST was generated by bnd maven plugin, it should have picked up all the packages hazelcast depends on in the import list.

-vivek.

Тхано

unread,
May 13, 2010, 11:13:41 AM5/13/10
to Hazelcast
It was first what I checked. Is is there already...

> Can you try by adding org.w3c.dom in the Import-Package list?

Тхано

unread,
May 31, 2010, 5:22:40 AM5/31/10
to Hazelcast
Added this code in the my bundle activator:

try {

System.out.println("##########################################################################################");
javax.xml.parsers.DocumentBuilderFactory factory =
javax.xml.parsers.DocumentBuilderFactory.newInstance();
System.out.println("######### Factory class = " +
factory.getClass().getName());
javax.xml.parsers.DocumentBuilder builder =
factory.newDocumentBuilder();
System.out.println("######### Builder class = " +
builder.getClass().getName());
org.w3c.dom.Document document = builder.newDocument();
System.out.println("######### document class = " +
document.getClass().getName());
org.w3c.dom.Element root = document.createElement("root");
System.out.println("######### Element class = " +
root.getClass().getName());
document.appendChild(root);
root.setTextContent("test");
org.w3c.dom.NodeList nodeList = root.getChildNodes();
System.out.println("######### NodeList class = " +
nodeList.getClass().getName());
System.out.println("######### NodeList length = " +
nodeList.getLength());
for (int i = 0; i < nodeList.getLength(); i++) {
System.out.println("######### ### Node class = " +
nodeList.item(i).getClass().getName());
}
} catch (Exception e) {
System.out.println(e.toString());
} finally {

System.out.println("##########################################################################################");
}

Output:

##########################################################################################
######### Factory class =
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
######### Builder class =
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl
######### document class =
com.sun.org.apache.xerces.internal.dom.DocumentImpl
######### Element class =
com.sun.org.apache.xerces.internal.dom.ElementImpl
######### NodeList class =
com.sun.org.apache.xerces.internal.dom.ElementImpl
######### NodeList length = 1
######### ### Node class =
com.sun.org.apache.xerces.internal.dom.TextImpl
##########################################################################################


And Hazelcast still output same error.
Reply all
Reply to author
Forward
0 new messages