Jena adapter and glassfish

I have been trying to get the Jena adapter , joseki and glassfish to work with 11g.
No success so far. Glassfish just throws an error because somewhere in the code there is a cast to (OracleConnection) that is incorrect.
My glassfish connection pool is setup using oracle.jdbc.pool.OracleDataSource.
Has anyone got any ideas ?
trace:
WARN [httpSSLWorkerThread-8080-1] (Configuration.java:115) - Failed to build dataset from description (service name: updat
e/service): caught: open: the connection from the datasource is not of OracleConnection type
com.hp.hpl.jena.assembler.exceptions.AssemblerException: caught: open: the connection from the datasource is not of OracleConnection type
doing:
root: file:///export/apps/phil/glassfish/domains/domain1/config/joseki-config.ttl#oracle with type: http://www.oracle.com/2009/05/orardf/jena-joseki-ns#Da
taset assembler class: class oracle.spatial.rdf.client.jena.assembler.OracleDatasetAssembler
at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:126)
at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:105)
at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:69)
at com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:37)
at com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:34)
UPDATE: I believe this is because glassfish wraps its connections, so I'd need to create a new data source that gets the physical OracleConnection for me.
As discussed here: http://forums.sun.com/thread.jspa?threadID=5100748
Edited by: user2570981 on 12-Mar-2010 08:30

Hi, I managed to get Joseki working on Tomcat 6 with just this META-INF/context.xml file (no <resource-ref> section in web.xml needed):
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource name="OracleSemDS"
     auth="Container"
     type="oracle.jdbc.pool.OracleDataSource"
     factory="oracle.jdbc.pool.OracleDataSourceFactory"
     user="rdfuser"
     password="rdfuser"
     driverClassName="oracle.jdbc.driver.OracleDriver"
     url="jdbc:oracle:thin:@ec2-184-72-150-221:1521:tseval"
     validationQuery="select 1 from dual"
     maxActive="10"
     maxIdle="2"/>
</Context>
However, it took a patched version of the sdordfclient.jar to get it working, the problem being that, in accordance with the J2EE spec, Tomcat (and Glassfish as well, I believe) puts the datasource in the "java:comp/env" JNDI namespace. The sdordfclient.jar has code responsible for finding that datasource but looks for it under simply "OracleSemDS".
your context.xml file looks good, I'll bet if you dig around, you'll find that "java:comp/env/OracleSemDS" is bound in Tomcat, you just need a sdordfclient.jar that is looking for it there.

Similar Messages

  • Jena Adapter and SPARQL web service endpoint

    As I understand, with Jena adapter java interface, the client can connect to Oracle RDF database directly. Why does it still need SPARQL web service endpoint? Does the query request from Jena adapter at client side have to go through SPARQL webservice first then route to Oracle server? Or the query with SPARQL need to go through webservice and non SPARQL query directly go to Oracle server?
    Thanks.

    Hi,
    You are right that a client can connect to Oracle RDF directly through the Jena Adapter. The reason for providing a SPARQL web service endpoint is to give additional interoperability and flexibility. With the SPARQL web service endpoint, one does not even need to write any Java code to interact with the underlying database. It also makes SPARQL federation a lot easier.
    Hope it helps,
    Zhe Wu

  • PREFIX ORACLE_SEM_FS_NS timeout via Jena Adapter

    Hi,
    I am executing SPARQL via Jena Adapter and would like to specify timeout.
    I use PREFIX ORACLE_SEM_FS_NS: <http://oracle.com/semtech#timeout=5> , according the the sem dev guide Jena examples, but the timeout value has no effect at all.
    For some heavy queries QueryExecution->execSelect() never returns
    I found this thread - Re: Query IDs in ORACLE_SEM_FS_NS : 32 or 64 bits? , which discuss the similar subject. I tried to add qid to the prefix, but that did not help. I don't use Joseki endpoint nor OracleQueryMgtServlet to manage(kill) long queries. Maybe I will provide the latter function in the future, but I would like to start with that users specify the timeout and query would interrupt itself if not ready.
    So, is there anything else I have to do in Java/Jena code or somewhere else?
    Thanks, best regards
    Jürgen
    After some more testing it turns that the problem with timeout is related to certain type of queries only. Normally the timeout works.
    But when LET statement is used in some way, then timeout does not occur and it seems the query simply hangs:
    This query works and times out (if timeout value is set short enough):
    SELECT DISTINCT
    ?HR_Zone
    (count(?e) AS ?major_count)
    WHERE {
    ?e rdf:type r:ST_Episode .
    OPTIONAL
    ?e r:isClassifiedAs rn:major_st_episode .
    OPTIONAL{
    ?e r:mappedHRZone ?zone .
    ?zone r:index ?HR_Zone
    GROUP BY ?HR_Zone
    This query does not finsih (in boundaries of my patients) and does not time out:
    SELECT DISTINCT
    ?HR_Zone
    (count(?e) AS ?major_count)
    WHERE {
    ?e rdf:type r:ST_Episode .
    OPTIONAL
    ?e r:isClassifiedAs rn:major_st_episode .
    LET( ?emajor := ?e )
    OPTIONAL{
    ?e r:mappedHRZone ?zone .
    ?zone r:index ?HR_Zone
    GROUP BY ?HR_Zone
    However, one might think that LET is not supported - but without ARQ functions it works. This query works and times out (with short timeout value)
    SELECT DISTINCT
    ?emajor ?HR_Zone
    WHERE {
    ?e rdf:type r:ST_Episode .
    OPTIONAL
    ?e r:isClassifiedAs rn:major_st_episode .
    LET( ?emajor := ?e )
    OPTIONAL{
    ?e r:mappedHRZone ?zone .
    ?zone r:index ?HR_Zone
    Edited by: user8793616 on 2010-sep-29 04:51

    Hi Jurgen,
    The timeout pragma is most effective when used with SPARQL 1.0 queries, since they are supported natively. Once you start using ARQ features - which are not available in Oracle so they are processed in the mid-tier - timeout becomes less reliable.
    Cheers,
    Vladimir

  • How to do a count(*) with Jena Adapter?

    Hi, I am trying to do a count(*). I know it's not part of the SPARQL 1.0 standard, but it is supported in ARQ, and presumably by the Jena Adapter too then?
    Other examples I have been able to find do an iteration over the resultset to get a count, but that is not acceptable since I have millions of triples. In my tests it took 15 seconds to return the count by using iteration. Oracle Semantic is advertised as scaling to "hundreds of millions of triples"; so how do I do a simple count(*) aggregation?
    Below is the code I tried. It works with a regular jena default model, returning the expected result of "2", but the result is empty if I use the Oracle Jena adapter.
    import oracle.spatial.rdf.client.jena.ModelOracleSem;
    import oracle.spatial.rdf.client.jena.Oracle;
    import com.hp.hpl.jena.graph.Node;
    import com.hp.hpl.jena.graph.Triple;
    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.rdf.model.Model;
    public class OracleJenaAdapterCountTest {
         public static void main(String[] args) throws Exception {
              String szJdbcURL = "jdbc:oracle:thin:@dragon12:1521:mydb";
              String szUser = "mydb";
              String szPasswd = "yeahright";
              String szModelName = "kp_mydb_model";
              Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
              Model model = ModelOracleSem.createOracleSemModel(oracle,
              szModelName);
              // this one works
              //Model model = ModelFactory.createDefaultModel();
              model.getGraph().add(
                        Triple.create(Node.createURI("http://example.com/John"),
                                  Node.createURI("http://example.com/fatherOf"),
                                  Node.createURI("http://example.com/Mary")));
              model.getGraph().add(
                        Triple.create(Node.createURI("http://example.com/John"),
                                  Node.createURI("http://example.com/fatherOf"),
                                  Node.createURI("http://example.com/Bob")));
              Query query = QueryFactory
                        .create("select (count(*) as ?count) {?f <http://example.com/fatherOf> ?k .}");
              QueryExecution qexec = QueryExecutionFactory.create(query, model);
              ResultSet results = qexec.execSelect();
              ResultSetFormatter.out(System.out, results, query);
              model.close();
              oracle.dispose();
    }

    Hi,
    Which version of Jena/Jena Adapter are you using?
    I am a bit surprised that your query did not throw out an exception. I need to set Syntax.syntaxARQ
    in the query creation, as follows. (Without it, I got com.hp.hpl.jena.query.QueryParseException when
    executing the same code.)
    Query query = QueryFactory
    .create("select (count(*) as ?count) {?f <http://example.com/fatherOf> ?k .}",
    Syntax.syntaxARQ);
    Once I have the above change, I did get the right count.
    | count |
    =========
    | 2 |
    The above query is not the most efficient one in terms of getting the count. Because we have to select out all projection and send the data from the database to the Java client. If you are using the latest Jena Adapter, you can use the count_only which will instruct the underlying query to return the count directly from the database.
    Query query = QueryFactory
    .create("PREFIX ORACLE_SEM_FS_NS: <http://oracle.com/semtech#count_only> select ?count {?f <http://example.com/fatherOf> ?k .}",
    Syntax.syntaxARQ);
    Cheers,
    Zhe Wu

  • Jena adapter 2

    Hi,
    I was trying to connect to an oracle instance yesterday via the jena adapter 2. The connection seemed to work and i then tried to store some n3 data into the database.
    For that reason I followed the code samples, that came with the adapters readme. But then I get a ClassNotFoundException for the OracleSemThingie inside eclipse, saying it can't find one of the jena classes... jena.jar is as well in the classpath as the other required jars are. Any clues for that problem?
    Another question, that I have, is: what is the best way to store n3 data via jena adapter in an oracle database?
    best regards,
    udo

    Hi,
    yes, I'm sorry I didn't do it in the first post...
    Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/engine/main/StageBasic
         at oracle.spatial.rdf.client.jena.GraphOracleSem.<init>(GraphOracleSem.java:733)
         at oracle.spatial.rdf.client.jena.GraphOracleSem.<init>(GraphOracleSem.java:545)
         at oracle.spatial.rdf.client.jena.GraphOracleSem.<init>(GraphOracleSem.java:450)
    The exception comes up from this line:
              GraphOracleSem graph = new GraphOracleSem(oracle, modelName);
    I've got jena.jar 2.5.6 in the classpath, as well as arq.jar, commons-logging-1.1.1, icu4j_3_4, log4j-1.2.12, sdordfclient, concurrent, iri, xercesImpl, ojdbc5.
    I don't need Pellet.

  • How do I configure logging for Jena Adapter?

    The software I'm developing uses the jdk logger, and sends the output to a log file. I'd like to send log messages from the Jena adapter to the same location. Also, what are the names of the logged components, and how can you adjust the log levels?

    Those are internal logs. Behind the scene, Jena Adaptor is using apache commons logging.
    To disable those verbose logging output, you can set the following JVM properties.
    -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
    -Dorg.apache.commons.logging.simplelog.defaultlog=warn
    Thanks,
    Zhe Wu

  • Difference between Jena/Joseki and sem_match

    Dear All,
    There are different ways for us fire SPARQL queries into the Spatial and Graph extension. The two methods we are using at this moment are Jena/Joseki and sem_match. Where Jena/Joseki is an end-point on a WLS.
    The same SPARQL queries fired either by sem_match or Jena/Joseki do not result in the same execution plan. We are wondering if it is possible in anyway to let Jena/Joseki use the same rules as sem_match to receive the same execution plan.
    If there is not such a method, is there than a plan to bring these two optimizers closer together?
    Kind regards,
    Max

    Hi Max,
    Can you please adding s2s and strict_default flags to the beginning of your query?
    e.g.
    PREFIX ORACLE_SEM_FS_NS: <http://oracle.com/semtech#s2s=f,strict_default=f>
    select ?s ?p ?o
    where {
      graph ?g {?s ?p ?o }
    To answer your question on convergence, Jena Adapter uses SEM_MATCH to answer SPARQL queries.
    By default, however, Jena Adapter first constructs a SEM_MATCH and then invokes a server-side logic to translate
    the SEM_MATCH in a pure SQL query. This feature is called S2S. S2S has a few benefits including the support
    of large queries, read-only database, and a reduced cost in query parsing.
    Now, there are a few things/situations that can cause a difference in the execution plan.
    - Jena Adapter by default chooses strict_default=t to align with Jena's behavior.
    - Given a SPARQL 1.1 query (which uses syntax beyond SPARQL 1.0), Jena Adapter (for Oracle Database 11.2.0.3+ and 12c)  
      breaks up the query into smaller pieces.
    We are working on a newer version of Jena Adapter that will translate a complete SPARQL 1.1 query into a single SEM_MATCH for Oracle Database (only for 12c+).
    Hope it helps,
    Zhe Wu

  • Apple Mini-DVI to Video Adapter and Mac mini (2009)

    Can anyone tell me whether the Apple Mini-DVI to Video Adapter listed here:
    http://store.apple.com/ca/product/M9319G/A
    works with the latest Mac mini (early 2009)?
    If it does not what other solutions are there to connect to composite, component or s-video?

    KC from Ann Arbor, MI had this to say as a review on the page to which you have linked;
    10-May-2009
    I bought a Mac Mini (May 2009) and this Mini-DVI to Video adapter with plans to use it to send an S-video signal to an analog TV. Though the sales staff at the Apple store said it should work, it does not. The graphics card apparently should support it, and it may be addressed with a future driver update, but as of now this does not work. I have used a mini-DVI to VGA adapter and monitor to verify that the port is working, and also verified that the S-video cable and TV input work. There are third party VGA to S-video/RCA adapters available so I plan to use one of those for my purposes. This is probably a 5-star product when used with the right Mac; however, Apple should have made it clear that having a mini-DVI port on your Mac is necessary but not sufficient for this to work - hence the 3 stars.

  • I have a targus 4.0 bluetooth usb adapter and so i can pair my iphone 4s and ipad air wirelessly, it seems to pair ok but when i try to connect i get a error message or not compatible. can some one tell me if it i can use this

    i have a targus 4.0 bluetooth usb adapter and so i can pair my iphone 4s and ipad air wirelessly, it seems to pair ok but when i try to connect i get a error message or not compatible. can some one tell me if it i can use this bluetooth with my devices, thanks

    sos1der wrote:
    pairing the apple equipment is not a big deal just wanted to add songs from itunes wirelessly.
    You can only add songs to your iOS device from iTunes via Wi-Fi sync or via your cable, not Bluetooth.
    sos1der wrote:
    but i tried paring my LG bluetooth so i can listen to music on my computer wirelessly buy it gives me the same error message
    That's an entirely different issue, unrelated to your iOS devices.

  • I have a late 2008 white macbook.  I have a mini dvi to hdmi adapter, and a hdmi cord.  My cannot get my MB to detect an external monitor.  Nothing happens when plugged in.  Also, my display settings does not have an option for mirroring or arrangment tab

    I have a late 2008 white macbook.  I have a mini dvi to hdmi adapter, and a hdmi cord.  My cannot get my MB to detect an external monitor.  Nothing happens when plugged in.  Also, my display settings does not have an option for mirroring or arrangment tab

    Yeah, I'm having the same exact problem - It seems that the thunderbolt minidisplay port is only able to output the analog VGA signal, not the digital signal to support DVI and HDMI. This is a bug that came up after installing 10.7.1. I bought my macbook air with 10.7 on it, upgraded it to 10.7.1 as soon as I got it, so I have never been able to use hdmi or dvi with my macbook air. This is an extremely frustrating problem for me, I used HDMI on a daily basis with my PC. I have spent many hours at the genius bar running diagnostic tests so Apple can get as much information as possible to create a fix for this problem. I have been emailing tech support for 3 or so weeks now, they keep saying that they are working on a fix and it should be out soon, but 10.7.2 has come and gone and I still have no HDMI functionality with my MacBook Air!

  • HT4108 I'm trying to connect my iPad to my tv so that I can mirror whatever is on my iPad. I want to stream movies online and watch on the tv. I have the digital av adapter and an hdmi cable but it's not working. Any tips ?

    I'm trying to connect my iPad to my tv so that I can mirror whatever is on my iPad. I want to stream movies online and watch on the tv. I have the digital av adapter and an hdmi cable but it's not working. Any tips ?

    If this is an iPad 1, it won't mirror, but it will still output video from the 30 Pin dock connector.
    If your new TV has a conventional VGA in and stereo inputs you can try this connector.
    http://store.apple.com/us/product/MC748ZM/A/apple-composite-av-cable?fnode=3a
    I used to stream video from both Netflix and YouTube and from my Mac using iTunes sharing through my iPad then with this connector plug into my iPad and TV.
    It won't be high resolution, but it will get you picture from iPad to TV.
    Good Luck.

  • I've just hooked my 20" iMac up to my Toshiba 37" HDTV using a mini dvi-HDMI adapter, and works well, EXCEPT for the green tinge (or hue) that is showing up on my TV. Any suggestions or ideas?

    I've just hooked my 20" iMac display up to my Toshiba 37" HDTV using a mini dvi-HDMI adapter, and everything works well, EXCEPT for the green tinge (or hue) that is showing up. Everything else looks pretty good though..... The color that is on my iMac is still good, Its just green on the TV.
    Anyone have suggestions or ideas?

    Try opening the Display System Preferences, then click on the Color options in the Display preferences window that appeared on the Toshiba display. Click on the Calibrate button and follow the instructions for creating a custom ColorSync profile that will hopefully solve the green tinge issue. The Apple Display Calibrator Assistant software that launches when you click on the calibrate button will walk you through the process.Assuming that the green tinge is minor and that you don't have a more serious cable or hardware issue, I am hopeful the results will be worth it.

  • Can I use a mini display port to VGA adapter and then a VGA to av adapter to connect my MacBook pro to my standard definition tv?

    Can I use a mini display port to VGA adapter and then a VGA to av adapter to connect my MacBook pro to my standard definition tv?

    No. You need a converter box like this to go with your MDP-VGA adapter:
    http://www.amazon.com/PC-To-TV-Video-Converter/dp/B001CJOLBW/ref=pd_cp_e_2

  • How can I split the video port of an older Mac Mini so I can use both the 922-6199 DVI to RCA, S-Video Adapter and a Cinema Display?

    How can I split the video port of an older Mac Mini so I can use both the 922-6199 DVI to RCA, S-Video Adapter and a Cinema Display?

    Which exact Mini?
    At the Apple Icon at top left>About this Mac.
    Then click on More Info>Hardware and report this upto but not including the Serial#...
    Hardware Overview:
    Model Name: iMac
    Model Identifier: iMac7,1
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2.4 GHz
    Number Of Processors: 1
    Total Number Of Cores: 2
    L2 Cache: 4 MB
    Memory: 6 GB
    Bus Speed: 800 MHz
    Boot ROM Version: IM71.007A.B03
    SMC Version (system): 1.21f4

  • Connect two external monitors to mini DP(using a mini DP to VGA adapter) and the VGA out at once

    I am trying to  connect two external monitors to mini DP(using a mini DP to VGA adapter) and the VGA out at once. Windows recognize both monitors as well. But it dowsn't let me use all three monitors at once(see the below image). In the dropdown, it lists all three monitors. Problem is there are two active displays I can select.

    Mavec wrote:
    I would like to add a third monitor.  
    The GPU(s) in your T400 (and most other laptop brands) will support two different displays concurrently.  If you want to support more than two different displays concurrently, you will need another GPU external to the T400.
    Generally, if you want to use two external displays on a T400 you will nee dto use a docking station.
    I have read messages on various fora on this topic and know that there are a number of ways of doing this, but as I have never had a need to do this myself I can't tell you how to go about it.
    Cheers,
    Bill
    I don't work for Lenovo

Maybe you are looking for

  • CPIC CALL service unknown

    Hi, We are trying to send idoc from r3 to Xi but in sm58 (r3 side) the error keeps hanging with following error : CPIC-CALL: 'ThSAPCMINIT' : cmRc=20 thRc=665#Service inconnu 665 -> Gateway service unknown. The FM involved is IDOC_INBOUND_ASYNCHRONOUS

  • Problems with Upper Case Letters on Keyboard

    Suddenly my keyboard will not print a capital i. in fact, if i use the caps key, it won't even put the letter i in either upper or lower case. When i put the caps lock on,  can get a capitol 'I', but once the cap lock is off it is back to the lower c

  • How do I create folders on home screen

    how do I create folders on home screen

  • Windows Event ID 4625 No Username

    I am working on deploying Ossec to monitor my failed login attempts from workstations now that I have deployed a password policy.  Everything for Ossec so far is working for what I need out of the box with no customization's.  What I have noticed now

  • Speed - Possible Hardware Problem?

    Greetings, My laptop is a Satellite L655-S5058 running Windows 7 (64) and is approx. 3.5 years old. I recently noticed severe speed/response issues and none of the usual fixes were working. So I did a complete recovery, basically restoring it to its