Hi,
I'm trying to use the API to access a remote registry to fetch a resource
(using the nightly snapshot). My example is very simple:

public class TestRemoteRegistry {

    public static void main(String[] args) throws Exception {

        RemoteRegistry remoteRegistry;

        remoteRegistry = new RemoteRegistry(new URL("
http://localhost:8080/wso2registry";), "admin", "admin");


        System.out.println("resource is " +
remoteRegistry.get("/Test/synapse.xml"));

    }

}

The error I get is:

Exception in thread "main" java.lang.ExceptionInInitializerError
at
org.apache.abdera.parser.stax.FOMParser.getXMLInputFactory(FOMParser.java:154)
at
org.apache.abdera.parser.stax.FOMParser.createXMLStreamReader(FOMParser.java:187)
at org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:145)
at
org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(AbstractClientResponse.java:119)
at
org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(AbstractClientResponse.java:96)
at
org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(AbstractClientResponse.java:74)
at org.wso2.registry.app.RemoteRegistry.get(RemoteRegistry.java:118)
at opensoa.registry.FileSampleUtils.main(FileSampleUtils.java:24)
Caused by: java.lang.IllegalStateException: No valid ObjectCreator found.
at org.apache.axiom.om.util.StAXUtils$Pool.<init>(StAXUtils.java:64)
at org.apache.axiom.om.util.StAXUtils.<clinit>(StAXUtils.java:88)
... 8 more

I proxy'd the request through TCPMon, and it looks like valid Atom is being
returned (but I am not Atom expert):

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom"; xmlns:ns="
http://wso2.org/registry";>
    <link href="
http://127.0.0.1:8111/wso2registry/atom/Test/synapse.xml/synapse.xml";
        rel="alternate"/>
    <link href="/Test/synapse.xml" rel="path"/>
    <snapshotID xmlns="http://wso2.org/registry";>2</snapshotID>
    <lastUpdatedUser xmlns="http://wso2.org/registry
">admin</lastUpdatedUser>
    <mediaType xmlns="http://wso2.org/registry";>application/xml</mediaType>
    <ns:properties/>
    <link href="
http://127.0.0.1:8111/wso2registry/atom/Test/synapse.xml/synapse.xml";
rel="edit"/>
    <id>urn:uuid:70e53fad-5899-44f4-8279-f152de3b598e</id>
    <title type="text">/Test/synapse.xml</title>
    <updated>2008-11-26T02:08:57.549Z</updated>
    <author>
        <name>admin</name>
    </author>
    <summary type="text"/>
    <content type="application/xml"
        src="http://127.0.0.1:8111/wso2registry/resource/Test/synapse.xml"/>
    <link href="http://127.0.0.1:8111/wso2registry/resource/Test/synapse.xml";
rel="edit-media"/>
    <source>
        <id>urn:uuid:70e53fad-5899-44f4-8279-f152de3b598e</id>
        <title type="text"/>
        <link href=""/>
        <link href="" rel="self"/>
        <author>
            <name>admin</name>
        </author>
        <updated>2008-11-26T03:27:17.623Z</updated>
    </source>
</entry>

Thanks!

jeff

p.s., I did notice in the User Guide that they include the "/atom" prefix on
the URL, but that appears to be incorrect (but maybe is correct in the
existing released version, since I am using the nightly snapshot).
_______________________________________________
Registry-user mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/registry-user

Reply via email to