7 Replies Latest reply: Jun 6, 2014 7:11 PM by memus RSS

    restful web service and NoSql Database.

    memus

      I configured an Oracle NoSQL database version 3.0.5.

      I wrote the RestFul web service below Under JDev 12c.

       

      the RestFul run well but when performing request (GET) it returns the following error.

       

      I don't know how to correct it. Need Help

       

      package store;

      import com.hp.hpl.jena.query.Query;
      import com.hp.hpl.jena.query.QueryExecution;
      import com.hp.hpl.jena.query.QueryExecutionFactory;
      import com.hp.hpl.jena.query.QueryFactory;
      import com.hp.hpl.jena.query.ResultSet;
      import com.hp.hpl.jena.query.ResultSetFormatter;
      import com.hp.hpl.jena.query.Syntax;
      import com.hp.hpl.jena.rdf.model.Model;

       

       

      import javax.ws.rs.GET;
      import javax.ws.rs.Path;
      import javax.ws.rs.Produces;

      import oracle.kv.impl.api.ops.Get;

      import oracle.rdf.kv.client.jena.OracleModelNoSql;
      import oracle.rdf.kv.client.jena.OracleNoSqlConnection;

      @Path("store")
      public class StoreResourceHandle {
          public StoreResourceHandle() {
              super();
          }

       

       

      public static String queryStoreNoSQL()  {
           String StoreName  = "semep";
           String HostName   = "localhost";
           String HostPort   = "5000";
           //    String szModelName  = "http://example.org/Captation";
           String ModelName  = "http://Repository";
           OracleNoSqlConnection conn = OracleNoSqlConnection.createInstance(StoreName, HostName, HostPort);
           Model model = OracleModelNoSql.createOracleModelNoSql(ModelName, conn);
        
           String szQuery = "SELECT  ?s  ?p  ?o\n" +
            "where  {\n" + 
            "  { ?s  ?p  ?o}\n" +
            "}";
       

                
           System.out.println("Execute query     " + szQuery);
          
           Query query = QueryFactory.create(szQuery, Syntax.syntaxARQ);
           QueryExecution qexec = QueryExecutionFactory.create(query, model);
           ResultSet results = qexec.execSelect();
           String textResults = ResultSetFormatter.asText(results);
          
           qexec.close();
           model.close();
           conn.dispose();
        return textResults;
      }


          @GET
          @Produces("text/plain")
          public String getStoreQuery()  {
           String result = StoreResourceHandle.queryStoreNoSQL();
      //    System.out.println(result);
           return result;
      }

      }

       

      [Running application StoreResource on IntegratedWebLogicServer...]
      [09:45:44 PM] Web Module StoreWebApp.war recognized in project Store.jpr
      [Another instance of application StoreResource is running on the server.  JDeveloper will redeploy the application.]
      [09:45:44 PM] ----  Deployment started.  ----
      [09:45:44 PM] Target platform is  (Weblogic 12.x).
      [09:45:44 PM] Retrieving existing application information
      [09:45:44 PM] Running dependency analysis...
      [09:45:44 PM] Deploying 2 profiles...
      [09:45:44 PM] Wrote Web Application Module to C:\Users\memus\AppData\Roaming\JDeveloper\system12.1.2.0.40.66.68\o.j2ee\drs\StoreResource\StoreWebApp.war
      [09:45:44 PM] Wrote Enterprise Application Module to C:\Users\memus\AppData\Roaming\JDeveloper\system12.1.2.0.40.66.68\o.j2ee\drs\StoreResource
      [09:45:44 PM] Application will not be redeployed
      [09:45:44 PM] The following URL context root(s) were defined and can be used as a starting point to test your application:
      [09:45:44 PM] http://localhost:7101/StoreResource-Store-context-root
      [09:45:44 PM] Elapsed time for deployment:  1 second
      [09:45:44 PM] ----  Deployment finished.  ----
      Run startup time: 554 ms.
      [Application StoreResource running on IntegratedWebLogicServer]

      Target Application WADL -- http://localhost:7101/StoreResource-Store-context-root/resources/application.wadl

      Target URL -- http://localhost:7101/StoreResource-Store-context-root/resources/store
      <25 mai 2014 21 h 45 CEST> <Error> <com.sun.jersey.spi.container.ContainerResponse> <BEA-000000> <The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
      java.lang.NoClassDefFoundError: oracle/rdf/kv/client/jena/OracleNoSqlConnection
      at store.StoreResourceHandle.queryStoreNoSQL(StoreResourceHandle.java:41)
      at store.StoreResourceHandle.getStoreQuery(StoreResourceHandle.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      Truncated. see log file for complete stacktrace
      >
      <25 mai 2014 21 h 45 CEST> <Error> <HTTP> <BEA-101017> <[ServletContext@10446167[app:StoreResource module:StoreResource-Store-context-root path:null spec-version:3.0], request: weblogic.servlet.internal.ServletRequestImpl@1e35577[
      GET /StoreResource-Store-context-root/resources/store HTTP/1.1
      Connection: TE
      TE: trailers, deflate, gzip, compress
      User-Agent: Oracle HTTPClient Version 10h
      Accept: text/plain
      X-HTTPAnalyzer-Rules: 1@localhost:8099

      ]] Root cause of ServletException.
      java.lang.NoClassDefFoundError: oracle/rdf/kv/client/jena/OracleNoSqlConnection
      at store.StoreResourceHandle.queryStoreNoSQL(StoreResourceHandle.java:41)
      at store.StoreResourceHandle.getStoreQuery(StoreResourceHandle.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      Truncated. see log file for complete stacktrace
      >
      <25 mai 2014 21 h 45 CEST> <Notice> <Diagnostics> <BEA-320068> <Watch "UncheckedException" in module "Module-FMWDFW" with severity "Notice" on server "DefaultServer" has triggered at 25 mai 2014 21 h 45 CEST. Notification details:
      WatchRuleType: Log
      WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
      WatchData: DATE = 25 mai 2014 21 h 45 CEST SERVER = DefaultServer MESSAGE = [ServletContext@10446167[app:StoreResource module:StoreResource-Store-context-root path:null spec-version:3.0], request: weblogic.servlet.internal.ServletRequestImpl@1e35577[
      GET /StoreResource-Store-context-root/resources/store HTTP/1.1
      Connection: TE
      TE: trailers, deflate, gzip, compress
      User-Agent: Oracle HTTPClient Version 10h
      Accept: text/plain
      X-HTTPAnalyzer-Rules: 1@localhost:8099

      ]] Root cause of ServletException.
      java.lang.NoClassDefFoundError: oracle/rdf/kv/client/jena/OracleNoSqlConnection
      at store.StoreResourceHandle.queryStoreNoSQL(StoreResourceHandle.java:41)
      at store.StoreResourceHandle.getStoreQuery(StoreResourceHandle.java:68)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
      at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
      at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
      at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
      at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
      at weblogic.jaxrs.server.portable.servlet.ServletContainer.service(ServletContainer.java:218)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.j2ee.ws.server.jaxrs.TenantServletFilter.doFilter(TenantServletFilter.java:81)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:225)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3367)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
      SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101017 MACHINE = mustapha TXID =  CONTEXTID = 6a226c0c-6115-47df-833a-8465cd21cc68-0000002f TIMESTAMP = 1401047153802 
      WatchAlarmType: AutomaticReset
      WatchAlarmResetPeriod: 30000
      >
      <25 mai 2014 21 h 46 CEST> <Emergency> <oracle.dfw.incident> <BEA-000000> <incident 65 créé avec la clé de problème "DFW-99998 [java.lang.NoClassDefFoundError][oracle.j2ee.ws.server.jaxrs.TenantServletFilter.doFilter][StoreResource]">