Hello,<br>I&#39;m a newbie to mulgara. I&#39;m trying to follow the integration with JRDF tutorial provided on the mulgara website. When I cut and past it in and run it I get a class cast exception:<br><br><span style="color: rgb(0, 102, 0);">org.mulgara.server.rmi.RemoteSessionWrapperJRDFSession</span><br style="color: rgb(0, 102, 0);">
<span style="color: rgb(0, 102, 0);">Exception in thread &quot;main&quot; java.lang.ClassCastException: org.mulgara.server.rmi.RemoteSessionWrapperJRDFSession</span><br style="color: rgb(0, 102, 0);"><span style="color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; at org.twopaths.jrdf.Sandbox.main(Sandbox.java:36)</span><br>
<br><br>According to the documentation, if you set the boolean parameter for&nbsp; SessionFactoryFinder.newSessionFactory(serverURI, false) to false, it should return a LocalJRDFSession however, it returns a remote session. <br>
<br>I&#39;ve also tried to use the JRDF client rather than server and I get a no such method exception<br><br><span style="color: rgb(0, 102, 0);">Exception in thread &quot;main&quot; java.lang.NoSuchMethodError: org.jrdf.graph.AbstractTripleFactory: method &lt;init&gt;()V not found</span><br>
<br>I checked the source for the class and the method isn&#39;t there. <br><br>I&#39;m using Mulgara 2.0.6 on am Mac running OSX. I&#39;m developing in Eclipse.<br><br>Any guidance you could provide would be appreciated.<br>
<br>The code that I&#39;m running is as follows:<br><br><span style="color: rgb(0, 102, 0);">package org.twopaths.jrdf;<br><br>import java.net.InetAddress;<br>import java.net.URI;<br>import java.net.URISyntaxException;<br>
import java.net.UnknownHostException;<br><br>import org.jrdf.graph.Graph;<br>import org.jrdf.graph.GraphException;<br>import org.mulgara.client.jrdf.AbstractGraphFactory;<br>import org.mulgara.jrdf.JRDFGraph;<br>import org.mulgara.jrdf.LocalJRDFSession;<br>
import org.mulgara.query.QueryException;<br>import org.mulgara.server.JRDFSession;<br>import org.mulgara.server.NonRemoteSessionException;<br>import org.mulgara.server.SessionFactory;<br>import org.mulgara.server.driver.SessionFactoryFinder;<br>
import org.mulgara.server.driver.SessionFactoryFinderException;<br><br>public class Sandbox {<br>&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Create the host name<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String hostname = InetAddress.getLocalHost().getCanonicalHostName();<br>
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Create the URI of the server<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; URI serverURI = new URI(&quot;rmi&quot;, hostname, &quot;/&quot; + &quot;server1&quot;, null);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Create a new session factory, ensure that it&#39;s local<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SessionFactory sessionFactory = SessionFactoryFinder.newSessionFactory(serverURI, false);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Get a local JRDF Session (local)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Object o = sessionFactory.newJRDFSession();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(o.getClass().getName());<br>//&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; JRDFSession session = (JRDFSession) sessionFactory.newJRDFSession();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LocalJRDFSession session = (LocalJRDFSession) sessionFactory.newJRDFSession();<br>
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //create a new Model<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; URI modelURI = new URI(&quot;rmi&quot;, hostname, &quot;/&quot; + &quot;server1&quot;, &quot;exampleGraph&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; URI modelType = new URI(&quot;<a href="http://mulgara.org/mulgara#Model">http://mulgara.org/mulgara#Model</a>&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; session.createModel(modelURI, modelType);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //create a JRDF Graph for the model<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Graph graph = new JRDFGraph(session, modelURI);<br>//&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Graph graph = AbstractGraphFactory.createGraph(serverURI, modelURI);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (UnknownHostException uhe) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; uhe.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (URISyntaxException urise) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; urise.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (SessionFactoryFinderException sffe) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sffe.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (NonRemoteSessionException nrse) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; nrse.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (QueryException qe) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; qe.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (GraphException ge) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ge.printStackTrace();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br></span><br><br><br><blockquote style="margin: 1.5em 0pt;"><br><br>
<hr style="border: 1px none ; color: rgb(142, 166, 27); background-color: rgb(142, 166, 27); height: 1px;">
<br>
<div style="float: left; width: 70px; margin-left: 20px;">
    <a href="http://www.2paths.com" target="_blank"><img src="http://www.2paths.com/img/2paths.gif" border="0" height="73" width="58"></a>
</div>
<div style="float: left; width: 300px; margin-left: 20px;">
    <div style="font-family: Arial; font-weight: bold; font-size: 13px;">Omar Khan</div>
    <div style="color: rgb(142, 166, 27); font-family: Arial; font-size: 12px;">Technical Architect</div>
    <br>
    <div style="font-family: Arial; font-size: 12px;"><b>e:</b> <a href="mailto:okhan@2paths.com" style="color: rgb(142, 166, 27); font-family: Arial; font-size: 12px;" target="_blank">okhan@2paths.com</a></div>
    <div style="font-family: Arial; font-size: 12px;"><b>p:</b> 604-689-4123 ext 13</div>
    <div style="font-family: Arial; font-size: 12px;"><b>w:</b> <a href="http://www.2paths.com" style="color: rgb(142, 166, 27); font-family: Arial; font-size: 12px;" target="_blank">http://www.2paths.com</a></div>
</div>
<div style="float: left;">
    <div> <a href="http://www.2paths.com" style="color: rgb(142, 166, 27); font-family: Arial; font-weight: bold; font-size: 12px;" target="_blank">2Path Solutions</a></div>
    <div style="font-family: Arial; font-size: 12px;">Suite 502-1540 West 2nd Avenue</div>
    <div style="font-family: Arial; font-size: 12px;">Vancouver, BC</div>
    <div style="font-family: Arial; font-size: 12px;">V6J 1H2</div>
</div>
<div style="clear: both;"><br></div></blockquote><br>