Exception when creating instance of a class with native method by JNI

I am trying to use JNI - I want to have a Java class Foo have a
method, that is a native C function.
I follow the Sun's tutorial
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jnie...
exactly, and everything compiles fine, and I have compiled my C .dll
as well (on Win XP). So I am ready to run - ...
Now when I finally try to run the Java application, it throws this
exception when it tries to create the Foo instance:
at Foo.<init>(Foo.java:11)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:786)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:715)
at sun.applet.AppletPanel.run(AppletPanel.java:369)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.security.AccessControlException: access denied
(java.lang.Runtim
ePermission loadLibrary.Foo)
Why would this be so??? Thank you for your insights

Mark_Galeck wrote:
I am trying to use JNI - I want to have a Java class Foo have a
method, that is a native C function.
I follow the Sun's tutorial
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jnie...
exactlyNot quite exactly. Yours is an applet, theirs is an application.
Applets are not allowed many things that applications can do.
Among them, loading native libraries.

Similar Messages

  • Testing ActionScript classes with native methods?

    Hi,
    I have an ActionScript class that I'm writing and would like to test using FlexUnit.
    The only issue is that the ActionScript class has a member in it that is a class with native methods.
    So, I get the following error when trying to run a test of that ActionScript class:
    VerifyError: Error #1079: Native methods are not allowed in loaded code.
    Does anyone know of a way to get around this?  FlexUnit seems not to like native methods being present.
    Thanks,
    Matt

    Hi casdvm,
    by definition, you only own objects that you created using one of the alloc* methods, copy: or new:. All other objects (IIRC with a few noted exceptions) are autoreleased.
    If you create convenience methods in your own class, you should follow the same rule. For example, if you have a class Pet and want to implement the method +petWithName, your code might look something like that:
    + petWithName: (NSString *)name
    return [[[Pet alloc] initWithName: name] autorelease];
    Alex

  • Error while compiling javacode with native method using jni

    im trying to call function in dll that is written in vc++ from java application.
    For that i write a native method .the method name is StopDS1.
    my native method is : public native DWORD StopDS1();
    when compiling using javac i'm getting message like this:
    testdss.java:4: cannot found symbol
    symbol:class dword
    location :class testdss
    1error

    DWORD isn't a Java type, therefore you cannot use it as one.

  • Enhanced SAP class with new methods - Not showing these from standard task

    Dear Gurus,
    I have enhanced SAP standard class with new methods. After I have activated my new methods and would like to create a workflow task using these new methods. when I create a task and input object category as "ABAP Class" and object type is SAP enhanced class. When I try to drop down for methods SAP is not showing my new methods. I do not know why. Am I missing any? Any help would be appreciated.
    Note: Remember I am trying to use SAP ABAP class custom methods.
    Thanks,
    GSM

    Hi,
    Your thread has had no response since it's creation over
    2 weeks ago, therefore, I recommend that you either:
    - Rephrase the question.
    - Provide additional Information to prompt a response.
    - Close the thread if the answer is already known.
    Thank you for your compliance in this regard.
    Kind regards,
    Siobhan

  • In which case we need a class with all methods defined as abstract ?

    In which case we need : A class with all methods defined as abstract (or should we go for Interface always in this case)

    The concept of interface and abstract class overlaps sometime, but we can have the following thumb rule to use them for our specific need:
    1) Interface: This should be use for code structuring. They standardize your application by providing a specific contract within and outside. If you think abstract class also provide structure, then reconsider as it limits the structure re-usability when there are many super-classes to inherit from. Java allow multiple inheritance by interface and not by Abstract class.
    2) Abstract Class: This should be use for code-reusability. Interface doesn't have any code so can't be used for code-reusability.
    Actually we can use both to provide the best.Taking a refernce to J2EE framework, the "Servlet" is an interface. It laids down the contract/structure for any code to be a servlet.
    But the "GenericServlet" class is an abstract class which provides implementation of some of the methods defined in the "Servlet" interface and leave some method abstract.
    Thus we see that the "Servlet" interface standardise the structure and the "GenericServlet" abstract class gives code re-usability.
    Original Question:
    In which case we need a class with all methods defined as abstract ?To this question, as all methods are abstarct we don't have option for code-reusability. so why not add standard structure concept to your application. So if there is not any restriction on making the field variable(if any) as final, we should go with the interface concept.

  • Class.forName1(Native Method)

    Hi all,
    We are experiencing an irregular memory issue and the Java stack trace is throwing a line:
    at java.lang.Class.forName1(Native Method)
    What does this line indicate? Is this a call into a Unix native library method...i.e a method that the JITC has compiled into native code?
    The stack trace is huge, but this line appears near the top, surrounded by Oracle JDBC traces:
    <snip>
    3XMTHREADINFO "ApplicationServerThread" (TID:0x7035FA20, sys_thread_t:0x3A2CFAA8, state:R, native ID:0x2499) prio=5
    4XESTACKTRACE at com.evermind.io.IOUtils._eu(.(Compiled Code))
    4XESTACKTRACE at com.evermind._ok._tw(.(Compiled Code))
    4XESTACKTRACE at com.evermind._ig.lookup(.(Compiled Code))
    4XESTACKTRACE at com.evermind._lv._ua(.(Compiled Code))
    4XESTACKTRACE at com.evermind.naming.archive.MemoryArchiveContext._tq(.(Compiled Code))
    4XESTACKTRACE at com.evermind.naming.archive.MemoryArchiveContext._gh(.(Compiled Code))
    4XESTACKTRACE at com.evermind.naming.archive.MemoryArchiveContext._ij(.(Compiled Code))
    4XESTACKTRACE at com.evermind._as.findClass(.(Compiled Code))
    4XESTACKTRACE at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
    4XESTACKTRACE at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
    4XESTACKTRACE at java.lang.Class.forName1(Native Method)
    4XESTACKTRACE at java.lang.Class.forName(Class.java(Compiled Code))
    4XESTACKTRACE at oracle.jdbc.ttc7.TTC7Protocol.safelyGetClassForName(TTC7Protocol.java:3664)
    4XESTACKTRACE at oracle.jdbc.driver.OracleConnection.safelyGetClassForName(OracleConnection.java(Compiled Code))
    4XESTACKTRACE at oracle.jdbc.driver.OracleConnection.addClassMapEntry(OracleConnection.java(Compiled Code))
    </snip>
    Our environment is as follows:
    - Unix 64 bit AIX 5.3
    - IBM 32 bit Java JDK, JITC Enabled
    - Oracle 10g
    - Oracle Type 4 Drivers
    Also, is there a website, book or any documentation that delves into these types of Java exceptions and how to interpret a stack trace?
    Any help would be greatly appreciated?
    tia,
    adym
    Message was edited by:
    adym-lincoln

    "scripts" are entirely different from GUI applications. What do you expect to happen when you run a Swing application through telnet on another machine? Do you expect the Swing UI to be magically transported to the local Windows machine?
    Not gonna happen. Yes, like ejp hinted, you could run an X-environment on your local machine and have the Swing UI tunnel its output there, but are you sure you want GUI apps to run on a remote machine like that? It's not gonna be fun to work with, I'll tell you that.
    Why not create a Java WebStart app (or perhaps even an applet) out of your application, so your users can run the application locally?

  • NullPointerException at java.lang.Class.forNameImpl(Native Method)

    Hi All,
    We installed an enterprise application using Websphere Application Server 6.1 and we use Java 1.5.0_18. We encountered the following error while testing the application:
    [6/07/09 18:32:56:825 EST] 0000002b SystemErr R java.lang.NullPointerException
    [6/07/09 18:32:56:825 EST] 0000002b SystemErr R      at java.lang.Class.forNameImpl(Native Method)
    [6/07/09 18:32:56:825 EST] 0000002b SystemErr R      at java.lang.Class.forName(Class.java:130)
    <the remaining part of the stack trace has been removed as it contains the names of our application specific classes>
    Could you please let me know the root cause of this error?
    Thank you.
    Regards,
    Venkatesh

    I would double- and triple-check that. A null classname string is almost certainly the cause here.

  • Exception - when create a new factory by Persistence class

    Hey,
    I need to create factory in run time because i dont know the shema names.
    A new schema is allocated to the user after he register to the system.
    I am working in Jboss 4.2.
    I have a stateless session bean with the following method:
    public void createEntityManagerFactoryWithPersistenceAPI() {
    try {
    Hotel h = new Hotel("Bla","Bla");
    //****************** Map configuration
    Map configOverrides = new HashMap();
    configOverrides.put("javax.persistence.jtaDataSource", "java:/TestDS");
    configOverrides.put("hibernate.hbm2ddl.auto", "create");
    configOverrides.put("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
    configOverrides.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
    configOverrides.put("hibernate.default_schema", "Test");
    EntityManagerFactory programmaticEmf =
    Persistence.createEntityManagerFactory("Demo",configOverrides);
    new InitialContext().rebind("java:/TestEMF", programmaticEmf);
    }catch(Exception e){
    I get an exception when i try to create the factory:
    19:14:49,492 ERROR [STDERR] javax.persistence.PersistenceException: org.hibernate.HibernateException: The chosen transaction strategy requir
    es access to the JTA TransactionManager
    19:14:49,492 ERROR [STDERR] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
    19:14:49,492 ERROR [STDERR] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
    19:14:49,492 ERROR [STDERR] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
    19:14:49,492 ERROR [STDERR] at service.impl.HotelServiceBean.createEntityManagerFactoryWithPersistenceAPI(HotelServiceBean.java:83)
    if i set to the following to the properties:
    configOverrides.put("javax.persistence.transactionType", "RESOURCE_LOCAL");
    the factory is created, but when i try to use it i get an exception:
    18:36:54,138 ERROR [JDBCTransaction] JDBC commit failed
    java.sql.SQLException: You cannot commit during a managed transaction!
    at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:543)
    My DS:
    <datasources>
    <local-tx-datasource>
    <jndi-name>TestDS</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>1234</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <!-- should only be used on drivers after 3.22.1 with "ping" support
    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
    -->
    <!-- sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
    -->
    <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
    -->
    My persistence.xml file:
    <persistence>
    <persistence-unit name="Demo">
    <jta-data-source>java:/InsiteDS</jta-data-source>
    <properties>
    <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
    <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
    </properties>
    </persistence-unit>
    </persistence>
    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    <metadata>
    <type-mapping>mySQL</type-mapping>
    </metadata>
    </local-tx-datasource>
    </datasources>
    Thank you!!!!!

    Check whether you are providing the correct login credentials while importing the RFC.

  • Creating an instance of a class with no default constructor

    Hello gurus,
    I wrote my own serialization and RMI protocol for both C++ and Java that follows closely what the default Java version does. I'm trying to recreate an object on the Java side that was sent over the wire. The first step is to create an instance of the class. How do I create an instance of a class that has no constructor (i.e. the only instances are static, created by the class itself and returned by static methods) or one that has no default constructor (like Integer)? The Java serialization seems to support it but the reflection API doesn't seem to have any support for this (i.e. Class::newInstance() and Constructor::newInstance()). It seems that through the standard API you can only create an object via one of its constructors. There must be a "hidden" method somewhere that allows the Java serialization to create an object without calling a constructor - where is it?
    Dominique

    There must be a "hidden" method
    somewhere that allows the Java serialization to create
    an object without calling a constructor - where is
    it?You are correct, the way in which the Serialization creates Objects is "hidden" deep within the runtime.
    If it were not hidden, you would be able to find it, and use it to violate the integrity of the VM.

  • Error in Adaptive WebService Model when creating instance of Node

    Hi All,
    I have created an Adaptive WebService Model which calls a WebService. This WebService has been generated in the CAF and represents an Application Service. One of the Methods of this Application Service returns a Complex Type which contains a list of BOs.
    However, when creating an instance of the Request Node, I receive an exception. The coding is:
           JobAppModel model = new JobAppModel();
           Request_GetAllJobApplications requestMO = new Request_GetAllJobApplications(model); <==
    The exception is
    com.sun.jdi.InvocationException occurred invoking
    The exception is not shown on the screen, only in the debugger in the field where you can see the variables.
    Does anybody know where thgis exception ma ycome from or where my mistake is?
    Thanks, Johannes

    Hi
    Have u define the system property path and return type ?
    Have a look on this threads
    [Test|Problem with XI web service,;
    Best Regards
    Satish Kumar

  • Error no. SPRX084 when create a ABAP proxy class

    Hy Guys,
    I create a Web Services on Axis and Tomcat machine, it's in document/literal Style format.
    When I try to import WSDL to create an ABAP proxy class, Proxy class generator, returm me an error number SPRX084 having said me that the message, in part TAG on element Attribute, uses a wrong or inexistent element.
    I've the same case from "http://www.thomas-bayer.com/axis2/services/BLZService?wsdl".
    There's a solution?
    Best Regards,
    Antonello

    i tried with this wsdl (http://www.thomas-bayer.com/axis2/services/BLZService?wsdl) and dont get the error you are mentioning.

  • Null pointer exception when creating new model-

    Hi Experts,
    When I create a new model in NWDS i get the following error.
    java.lang.NullPointerException
         at com.sap.ide.jcb.core.service.SAPLogonHelper.<init>(SAPLogonHelper.java:48)
         at com.sap.ide.jcb.core.wizardpages.SAPLogonPage$MessageServerPane.fillUpLoadBalancingPaneSystems(SAPLogonPage.java:1003)
         at com.sap.ide.jcb.core.wizardpages.SAPLogonPage$MessageServerPane.show(SAPLogonPage.java:303)
         at com.sap.ide.jcb.core.wizardpages.SAPLogonPage.createControl(SAPLogonPage.java:91)
         at com.sap.ide.webdynpro.modeleditor.wizards.model.creation.ModelWizard.createPageControls(ModelWizard.java:408)
         at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:524)
         at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:473)
         at org.eclipse.jface.window.Window.create(Window.java:302)
         at org.eclipse.jface.window.Window.open(Window.java:552)
         at com.sap.ide.webdynpro.modeleditor.ModelEditorCallback.createModel(ModelEditorCallback.java:52)
         at com.sap.ide.webdynpro.service.modeleditor.ModelService.createModelWithUI(ModelService.java:70)
         at com.sap.ide.webdynpro.service.modeleditor.ServiceWithUI.createModel(ServiceWithUI.java:49)
         at com.sap.ide.webdynpro.tsmodel.application.provider.ModelNodeProvider.createUniqueName(ModelNodeProvider.java:55)
         at com.tssap.selena.impl.model.elements.EntityImpl.createChildEntityUin(EntityImpl.java:936)
         at com.tssap.selena.impl.model.elements.EntityImpl.createChildEntity(EntityImpl.java:502)
         at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction.runInternal(CreationAction.java:76)
         at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction.access$000(CreationAction.java:24)
         at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction$1.run(CreationAction.java:51)
         at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1595)
         at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction.run(CreationAction.java:57)
         at com.sap.ide.webdynpro.projectbrowser.actions.PBCreateModelAction.run(PBCreateModelAction.java:95)
         at com.tssap.selena.model.extension.action.SelenaActionCollector$GenericElementActionWrapper.run(SelenaActionCollector.java:224)
         at com.tssap.util.ui.menu.MenuFactory$MuSiAction.saveRunAction(MenuFactory.java:1425)
         at com.tssap.util.ui.menu.MenuFactory$MuSiAction.run(MenuFactory.java:1407)
         at com.tssap.util.ui.menu.MenuFactory$DelegateAction.processInternal(MenuFactory.java:616)
         at com.tssap.util.ui.menu.MenuFactory$DelegateAction.access$100(MenuFactory.java:586)
         at com.tssap.util.ui.menu.MenuFactory$DelegateAction$BusyProcessWorker.run(MenuFactory.java:716)
         at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
         at com.tssap.util.ui.menu.MenuFactory$DelegateAction.process(MenuFactory.java:610)
         at com.tssap.util.ui.menu.internal.MenuListenerFactory$ProcessAdapter.widgetSelected(MenuListenerFactory.java:172)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
         at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
         at com.tssap.util.startup.WBLauncher.run(WBLauncher.java:79)
         at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
         at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:291)
         at com.sap.ide.eclipse.startup.Main.run(Main.java:789)
         at com.sap.ide.eclipse.startup.Main.main(Main.java:607)
    !ENTRY com.tssap.util 4 0 Mar 18, 2008 15:02:50.286
    !MESSAGE Mar 18, 2008 3:02:50 PM          com.sap.ide.webdynpro.ui.service.ServicesUI          [Thread[main,5,main]] Error: Internal error
       Plugin name: Web Dynpro Model Editor
       Plugin ID  : com.sap.ide.webdynpro.modeleditor
       Class      : com.sap.ide.webdynpro.modeleditor.ModelEditorCallback
       Method     : createModel
       Message    : An error ocurred. See error log for more details.
       Exception  : java.lang.NullPointerException: null
    Seems to be a plugin problem.What can I do to correct this..?
    Also where can i see the error log(The above error message is from .log file in sap workspace.)

    If you have Windows Seven (and probably Windows Vista) ...
    Close NWDS.
    Make backup \IDE70\eclipse\plugins\com.sap.ide.jcb.core_2.0.0\SapJavaConnectivityBuilderCore.jar.
    Get file-archive \IDE70\eclipse\plugins\com.sap.ide.jcb.core_2.0.0\SapJavaConnectivityBuilderCore.jar,
    in it get file \com\sap\ide\jcb\core\service\com\sap\ide\jcb\core\service\SAPLogonHelper.class,
    Change this .class file in any HexEditor,
    text "windows 2003" to text "indows vista" (not "windows vista"),
    save,
    replace original in
    \IDE70\eclipse\plugins\com.sap.ide.jcb.core_2.0.0\SapJavaConnectivityBuilderCore.jar
    inner path = \com\sap\ide\jcb\core\service\com\sap\ide\jcb\core\service\
    done!!!

  • Ora-20001 when creating a form on table with report (bug?)

    Having some trouble creating a "Form on table with report".
    1) I pick my table
    2) take most of the defaults on the page where you pick the report type (interactive) and the page number (I changed it to 950). next->
    3) Do not use tabs. Next->
    4) Select all columns for the report. THEN (here's the problem) set an optional where clause of system_role_name like 'ODPSPOPUP%'. Next->
    5) choose standard edit link. next->
    6) Specify a page of 951 for the form (leave others defaults). next->
    7) Set the form primary key (defined in table). next->
    8) use existing trigger. next->
    9) choose all columns for the form. next->
    10) Leave actions to insert, update, delete. next->
    11) Get to the summary page and click Finish
    Then I get an error page saying:
    ORA-20001: Unable to create query and update page. ORA-20001: Unable to create query and update page. ORA-00933: SQL command not properly ended
    If I go back to step 4 and erase my where clause the wizard completes successfully.
    Also if I change the report type in step 2 from the default of "Interactive" to "Classic" the wizard completes successfully. However upon running the report I get a query parse error. Looks like the where clause in the report sql is: system_role_name like ''ODPSPOPUP%'' (two single quotes on each side).
    It looks as if you cannot specify a where clause with a quoted string. The wizard is expecting a bind variable.
    Workaround(s):
    1) Don't specify a where clause when report type = Interactive in "create form on table with report" wizard.
    or
    2) Specify a bogus where clause using bind variable syntax such as "system_role_name like :BOGUSVARIABLE". Then edit the report query once the wizard finishes and change the where clause to the constant string you wanted to use in the wizard (e.g. "system_role_name like 'MYSYSTEM%'")
    Apex: 3.2.0.00.27
    Database: Oracle Database 11g Enterprise Edition 11.1.0.7.0 64bit Production (Oracle EL5)

    Andy,
    It's a bug, all right. Thanks for the detailed problem description. We'll fix it when we can.
    Scott

  • JCO$Exception when creating RFC model

    Hi all,
    I'm getting this fatal error when creating an RFC model in Web Dynpro for Java (connecting to a BW system):
    com.sap.mw.JCO$Exception: Missing R3NAME=... or ASHOST=... in connect_param in RfcOpenEx
    I have absolutely no clue what's going wrong...
    The RFC model gets created, but when running the application it doesn't work...
    Any help appreciated!
    Jeroen

    Raj,
    Thanks for your reply.
    I had already solved the problem... After a long time I found out it was due to the language: when creating an RFC model one should use the language of SLD.
    kind regards,
    Jeroen

  • Namespace not found error when creating data server for xml with namespace

    Hi
    I tried creating XML data server in ODI with namespace in xml file. I followed the below steps but could not success in creating the dataserver. however when I remove the namespace in xml file I am able to reverse engineer the xml file.
    1) Create xml data server
    2) select xml driver - com.sunopsis.jdbc.driver.xml.SnpsXmlDriver
    3) Provide the jdbc url - jdbc:snps:xml?f=D:/xmlnew/sample_namespace.xml&s=xmlns&d=D:/xmlnew/sample_namespace.dtd
    xml content
    <f:root xmlns:f="http://www.w3.org/TR/html4/">
    <table>
    <name>African Coffee Table</name>
    <width>80</width>
    <length>120</length>
    </table>
    </f:root>
    DTD content
    <!ELEMENT f:root ( table ) >
    <!ELEMENT length ( #PCDATA ) >
    <!ELEMENT name ( #PCDATA ) >
    <!ELEMENT table ( name, width, length ) >
    <!ELEMENT width ( #PCDATA ) >
    when I test connection it shows the following error.
    java.sql.SQLException: The model generated by the model mapper was not accepted by a validator: Model not accepted: Namespace not found:
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:133)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
         at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java:1100)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.getLocalConnect(SnpsDialogTestConnet.java:371)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.localConnect(SnpsDialogTestConnet.java:794)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.jButtonTest_ActionPerformed(SnpsDialogTestConnet.java:754)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.connEtoC1(SnpsDialogTestConnet.java:137)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.access$1(SnpsDialogTestConnet.java:133)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet$IvjEventHandler.actionPerformed(SnpsDialogTestConnet.java:87)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.sql.SQLException: The model generated by the model mapper was not accepted by a validator: Model not accepted: Namespace not found:
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDTD.initialize(SnpsXmlDTD.java:389)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDTD.initialize(SnpsXmlDTD.java:421)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDTD.<init>(SnpsXmlDTD.java:150)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchema.<init>(SnpsXmlSchema.java:478)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchemaManager.createNewSchema(SnpsXmlSchemaManager.java:292)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlSchemaManager.getSchemaFromProperties(SnpsXmlSchemaManager.java:270)
         at com.sunopsis.jdbc.driver.xml.SnpsXmlDriver.connect(SnpsXmlDriver.java:114)
         at oracle.odi.jdbc.datasource.DriverManagerUtils$DriverProxy.connect(DriverManagerUtils.java:23)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:368)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:352)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:316)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:275)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:99)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter$ConnectionProcessor.run(LoginTimeoutDatasourceAdapter.java:217)
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)

    Hi,
    Thans for your reply.
    This is the DTD for my xmldoc.
    <!ELEMENT Data (Department+)>
    <!ELEMENT EmployeeID (#PCDATA)>
    <!ATTLIST EmployeeID col (EMPID) #IMPLIED>
    <!ELEMENT Education (EmployeeID, Sequence, Dgree)>
    <!ATTLIST Education table NMTOKEN #IMPLIED>
    <!ELEMENT Employee (EmployeeName, EmployeeID, DepartmentID, Education*)>
    <!ATTLIST Employee table NMTOKEN #IMPLIED>
    <!ELEMENT EmployeeName (#PCDATA)>
    <!ATTLIST EmployeeName col NMTOKEN #IMPLIED>
    <!ELEMENT DepartName (#PCDATA)>
    <!ATTLIST DepartName col NMTOKEN #IMPLIED>
    <!ELEMENT Table (Column+)>
    <!ATTLIST Table importType NMTOKEN #IMPLIED>
    <!ATTLIST Table parentTable NMTOKEN #IMPLIED>
    <!ATTLIST Table tag NMTOKEN #IMPLIED>
    <!ATTLIST Table columns NMTOKEN #IMPLIED>
    <!ATTLIST Table name NMTOKEN #IMPLIED>
    <!ELEMENT DepartID (#PCDATA)>
    <!ATTLIST DepartID col NMTOKEN #IMPLIED>
    <!ELEMENT MetaData (Table+)>
    <!ELEMENT Sequence (#PCDATA)>
    <!ATTLIST Sequence col NMTOKEN #IMPLIED>
    <!ELEMENT Dgree (#PCDATA)>
    <!ATTLIST Dgree col NMTOKEN #IMPLIED>
    <!ELEMENT Export (MetaData, Data)>
    <!ELEMENT DepartmentID (#PCDATA)>
    <!ATTLIST DepartmentID col NMTOKEN #IMPLIED>
    <!ELEMENT Column (#PCDATA)>
    <!ATTLIST Column deleteKey NMTOKEN #IMPLIED>
    <!ATTLIST Column isKey NMTOKEN #IMPLIED>
    <!ELEMENT Department (DepartName, DepartID, Employee+)>
    <!ATTLIST Department table NMTOKEN #IMPLIED>
    Thanks again!
    Yan

Maybe you are looking for

  • Installing snow leopard by target disk firewire

    i am re installing snow leopard by target disk fire wire. the installer hangs after the first reboot. it leaves a folder called install data with loads of.pkg files. trying an external dvd drive but that's even slower. any ideas? thanks Dave

  • How do I download an app from the Mac App Store but not install it and save to do later?

    I'm getting the free Lion download for new Macs from the Mac App Store, but am not ready to install it yet. It appears that apps (including Lion?) from the App Store automatically install themselves. Is there any way to save an App Store download (.d

  • Unicode in Photoshop CS3 - is it possible ?

    Hi. How can i use unicode characters within a Photoshop CS3 text layer? An example: In Word, i can type 261A followed by [Alt-key] C then i see an unicode character in Word (the left-pointing hand). This does not work in Photoshop. I also cannot copy

  • Loadjava & dropjava problems

    hi, loadjava -user [email protected]:1527:EVTXQ1 -oci8 -resolve -v source.jar While loading java source there are compilation errors & status of source files is invalid. dropjava -user [connect_string] -oci8 source.jar exiting : parsing to determine

  • Help with installing GP in NWDS 2004s

    Hi all: (I feel sorry for the English, I will not write well) I install the NWDS 2004s on my computer, now I need to develop GP. Use a manual I found on this site, but I left the following error: [Image|http://img402.imageshack.us/my.php?image=errorg