Java and COM Object out parameters

I have a COM object written in C++ that can't be modified. It has several methods with output parameters.
Can java create an instance of the COM object and pass a reference to a Variant in this case or any objects to be filled by the COM object? My output parameter keeps coming back null, but I know that the COM object is working.
Bill

You didn't say anything about how you are bridging java <-> COM.
If it's via JNI, one way you could deal with this is to write a "wrapper" dll that can speak COM, but which can turn the output data into something more palatable to java - say an object that the wrapper can return.

Similar Messages

  • Java and COM objects

    hi all,
    i am not sure if this question belongs to this forum, but i was not able to find a proper forum for it
    I am trying to generate java classes out of a COM dll. I am using JIntegra-2.0
    java classes are generated successfully, however when i try to compile them one of them fails because it cannot find
    the class IEnumVARIANT.
    That is not part of JIntegra jar file, and i am unable to find a proper Jar for it... could anyone help?
    thanks and regards
    marco

    you don't need any "code" from Microsoft VM SDK if you use JACOB (http://danadler.com/jacob/).
    you only need the jacob.jar (Java side) in your CLASSPATH and the jacob.dll (COM side) file in your working directory (don't even need to register it!) and off you go.

  • ERROR: Inconsistent java and sql object types

    I am getting a nested object table in the form of an oracle.sql.ARRAY. I then call getResultSet() on this array and try to cast each object into a Java implementation of the SQLData interface (also defined in the connections type map).
    This approach works for one nested object table but not for another. I get the error message:
    "Inconsistent java and sql object types"
    Does this mean that my Java to Oracle type mappings are wrong? Any help would be appreciated.
    Regards
    Steve

    i had a similar situation. found out it was occuring because the oracle type had not been granted to the appropriate user.
    todd kegley

  • Inconsistent java and sql object types

    Hi,
    I have run into error "Inconsistent java and sql object types"
    while mapping a java class to a sql object type. The java class
    is just a duplicate of sql data structure and I pretty much
    follow the JDBC Developer's GUide's examples (20-43 to 20-45)
    to create the mapping java class.
    Any one runs into simliar problem or any clues?
    Thanks,
    Ed
    Exception in thread "main" java.sql.SQLException: Inconsistent java and sql object types: InstantiationException:
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.sql.STRUCT.toClass(STRUCT.java:433)
    at oracle.sql.STRUCT.toJdbc(STRUCT.java:366)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle80rec
    (OracleTypeUPT.java:236)
    at
    oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec_elems
    (OracleTypeCOLLECTION.java:553)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec
    (OracleTypeCOLLECTION.java:383)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80
    (OracleTypeCOLLECTION.java:329)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize
    (OracleTypeCOLLECTION.java:218)
    at oracle.sql.ArrayDescriptor.toJavaArray
    (ArrayDescriptor.java:501)
    at oracle.sql.ARRAY.getArray(ARRAY.java:197)

    The safest way would be to use JPublisher to generate the type classes. In your application, you can just use the generated code to manipulate the object.

  • The java and sql object type  was not matched

    My table(Oracle10.2) has a varying arrays column. For mapping to java classes, I use JDeveloper(10.1.3.1.0) to generate java classes. Then I try to insert a record into this varrying arrays column with java. While it always complaints java.sql.SQLException.the java and sql object type was not matched. I can not find the reason.
    My java code:
                   StructDescriptor structdesc = StructDescriptor.createDescriptor(
                             "VARRAY_SEQ", con);
                   int nid=20;
                   int pid=546;
                   BigDecimal mynid=new BigDecimal(nid);
                   mynid=mynid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   BigDecimal mypid=new BigDecimal(pid);
                   mypid=mypid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   Object[] attributes = { "ASDF", mynid, "Developer", mypid,
                             "rwretw" };
                   STRUCT Rel = new STRUCT(structdesc, con, attributes);
                   stmt.setObject(8, Rel);
                   stmt.execute();
                   stmt.close();
    And the STRUCT is
    public RelSeq(String nucl, java.math.BigDecimal neId, String nuor, java.math.BigDecimal pId, String phor) throws SQLException
    { _init_struct(true);
    setNucl(nucl);
    setNeId(neId);
    setNuor(nuor);
    setPId(pId);
    setPhor(phor);
    }

    My table(Oracle10.2) has a varying arrays column. For mapping to java classes, I use JDeveloper(10.1.3.1.0) to generate java classes. Then I try to insert a record into this varrying arrays column with java. While it always complaints java.sql.SQLException.the java and sql object type was not matched. I can not find the reason.
    My java code:
                   StructDescriptor structdesc = StructDescriptor.createDescriptor(
                             "VARRAY_SEQ", con);
                   int nid=20;
                   int pid=546;
                   BigDecimal mynid=new BigDecimal(nid);
                   mynid=mynid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   BigDecimal mypid=new BigDecimal(pid);
                   mypid=mypid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   Object[] attributes = { "ASDF", mynid, "Developer", mypid,
                             "rwretw" };
                   STRUCT Rel = new STRUCT(structdesc, con, attributes);
                   stmt.setObject(8, Rel);
                   stmt.execute();
                   stmt.close();
    And the STRUCT is
    public RelSeq(String nucl, java.math.BigDecimal neId, String nuor, java.math.BigDecimal pId, String phor) throws SQLException
    { _init_struct(true);
    setNucl(nucl);
    setNeId(neId);
    setNuor(nuor);
    setPId(pId);
    setPhor(phor);
    }

  • Audio drops and comes back out of sync but dvd preview ok

    hi All,
    i put some photos and videos together in idvd project. The used one of their standard sound tracks to give the background music. The preview looked great so i burned the dvd but to my surprise when a particular video played around 8 min into the dvd the audio dropped and came about a min later with other photos getting it totally out of sync. I have tried removing few photos before that video comes to shift the video's location, there is a minor effect, it playes the clips audio in sync for slightly a sec or two longer but then drops and come back out of sync when it is showing still photos.
    thanks in advance.

    We have heard nothing about any changes in Encore for CC. I would be very surprised if anything fundamental, like the preview engine, has changed. We really don't know what is still the old sonic authorcore, what may have changed but is still sonic, and what is Adobe created. I have always assumed the preview is sonic.
    Is the audio sync issue Bluray only, H.264 bluray only, or any particular audio formats? I don't recall getting the issue in Encore DVD playback.

  • Run Clear Case command from java and save the out put in to a file.

    Can any one help me out ...
    I want to execute Clear case command from a java and want to save the out put of this command to a file.
    I am naot able to find out how to start..
    Message was edited by:
    chandra_verma

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Memory leaks with Njawin and COm Object

    I'm using njawin 1.1 to use a DRM Microsoft object form java and all works
    very well .... very good bridge !!
    But I found a problem that seems like a "memory leak" in calling a method,
    in this lines code :
    myLicense = myLicenseObj.GetLicenseToDeliver();
    System.out.println(myLicense);
    myResponseObj.AddLicense("2.0.0.0", myLicense);
    myResponseObj.setReplaceQuotesWith("\\\"");
    myLicResponse = myResponseObj.GetLicenseResponse();
    The only particularity in this code the length of myLicense string : 7 KB
    If I run the program 1000 times the server use 100 Mb of ram and not release
    them.
    I try to use ASP to replicate the problem but nothing happens ... the
    program works and not memory leak appears and than I think taht the probelm
    may be in marshalling / unmarshalling string routine from/to the DRM object
    Thanks a lot for all help

    Me funciono colocando el progID de la interfaz que genero jawin en el constructor de la clase que se genero, despues utilice los metodos y fue transparente:
    Interfaz que genero jawin:::
    public interface CodeIMG {
    public static final GUID clsID = new GUID("{23435XCVDF2-6D62-6749- 8E00-00AS45GH87JU}");
    public static final String progID = new String("ActivexPDF.CodeIMG");
    la clase que genero jawin:::::::
    public class _CodeWER extends DispatchPtr {
    public int getTypeInfoToken() {
    return 0;
    static public final GUID proxyIID = new GUID("{632PHK77-6F0B-11D4-8PLD-00A024A31CC6}");
    static public final int iidToken;
    static {
    iidToken = IdentityManager.registerProxy(proxyIID, _CodeWER.class);
    public int getGuidToken() {
    return iidToken;
    * Creates empty _CodeWER Object
    public _CodeWER() throws COMException {
    super();
    * Creates _CodeWER() Object with progID
    public _CodeWER()(String progid) throws COMException {
    super(progid);
    * Queries interface of _CodeWER  Object
    public _CodeWER()(IUnknown other) throws COMException {
    super(other);
    * Creates _CodeWER() Object with CLSID
    public _CodeWER(GUID ClsID) throws COMException {
    super(ClsID);
    public boolean createImg(ObjectRef strChain, ObjectRef strFile) throws COMException {
    return ((java.lang.Boolean) invokeN("createImg", new Object[]{strChain, strFile}, 2)).booleanValue();
    Test de Prueba:::::::
    public class TestDLL implements CodeIMG {
         public static void main(String[] args) {
              try {
                   CodeWER pdf = new CodeWER ( clsID );               
                   boolean ok = pdf.createImg(new ObjectRef("9999999"), new ObjectRef("C:\\image.bmp") );
                   System.out.println("Lo generoi bien:: " + ok );
              } catch (COMException e) {
                   e.printStackTrace();
    Espero te sirva este ejemplito sencillo de jawin
    Saludos!!!!!!!!!!!!
    att juo

  • Java and COM

    Is it possible for a program written in Java to be used as a client for a COM object? If so, how do you access the COM interface from the Java class?

    if u want to convert java class to COM component .
    there is a tool from microsoft called "javareg".(comes with Microsoft SDK for java)
    u'll just have to write a very simple COM wrapper for it.
    I'm giving a very simple implementataion example for this .
    hope this helps
    1) - Write a .java file
    Here is an example of a simple java file
    public class MyJavaClass1
    public String myFun1() {
    return "from....java class hello! ";
    2)
    - Compile it in toMyJavaClass1.class
    3)
    - Use javareg utility (comes with Microsoft sdk for java)
    javareg /register /class:MyClass1 /progID:MyJavaToCOM1.java.1 /codebase:E:\MyCOM /typelib:e:\MyCOM\MyTLib.tlb
    Do specify codebase and complete path of .tlb file
    It will prompt a message �Registered successfully�
    4) Write activeX Dll corresponding to this class file in VB using the above �tlb� file
    Example of the COM wrapper is:
    Option Explicit
    Dim obTestCOM As MyJavaClass1.MyJavaClass1
    Public Sub Class_Initialize()
    Set obTestCOM = New MyJavaClass1.MyJavaClass1
    End Sub
    Public Sub Class_Terminate()
    Set obTestCOM = Nothing
    End Sub
    Public Function myFun1() As String
    myFun1 = obTestCOM.myFun1()
    End Function
    5)
    - Now, it can be called from ASP
    Example:
    dim ob1
    set ob1=server.CreateObject("MyProject1.MyClass1")
    Response.Write(ob1.myFun1())
    ----------------------------------

  • Problems with Java and Business Objects

    <p>Hello everybody,<br /><br />I&#39;m new in BusinessObjects/Crystal Report. Now, I have some problems with Business Objects for Java (Business Objects XI Release 2 Developer).</p><p> </p><p>1)  I create a report in the report designer. This report has a parameterfield. Before I run this report within a jsp web application I want fill the parameterfield with some values from the database. I found the following code snippet for this problem in your forum. But it don&#39;t works right, because it occurs a simple input field instead of a combo box with my database values. Where is my mistake? I need the combo box! (In debug mode I saw that the parameterfield was filled with my data!)</p><p><%@page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer,com.crystaldecisions.sdk.occa.report.application.ReportClientDocument,<br />com.crystaldecisions.sdk.occa.report.application.OpenReportOptions,<br />com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase,<br />java.io.IOException,<br />java.sql.Connection,<br />java.sql.DriverManager,<br />java.sql.ResultSet,<br />java.sql.SQLException,<br />java.sql.Statement,<br />java.util.Locale,<br />com.crystaldecisions.sdk.occa.report.application.DataDefController,<br />com.crystaldecisions.sdk.occa.report.data.FieldDisplayNameType,<br />com.crystaldecisions.sdk.occa.report.data.ParameterField,<br />com.crystaldecisions.sdk.occa.report.data.ParameterFieldDiscreteValue,<br />com.crystaldecisions.sdk.occa.report.data.Values,<br />com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"%><%<br /><br />    try {<br /><br />        String reportName = "avoParameterfeld.rpt";<br />        ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);<br /><br />        if (clientDoc == null) {<br />            // Report can be opened from the relative location specified in the CRConfig.xml, or the report location<br />            // tag can be removed to open the reports as Java resources or using an absolute path<br />            // (absolute path not recommended for Web applications).<br /><br />            clientDoc = new ReportClientDocument();<br />            clientDoc.setReportAppServer("inproc:jrc");<br />            // Open report<br />            clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);<br /><br />             // Connection Info for fetching the resultSet<br />            String connectStr = "jdbc:oracle:thin:@it1srv19:1521:itoracle";<br />            String driverName = "oracle.jdbc.driver.OracleDriver";<br />            String userName = "user";        <br />            String password = "password";    <br /><br />            // TODO: Ensure this query is valid in your database. An exception will be thrown otherwise.<br />            String query = "SELECT DISTINCT AVONR FROM MBDEADM.AVO ORDER BY AVONR";<br />            ResultSet paramData = null;<br />           <br />            //we will now pass the resultset to the parameter to use as Default Values<br />            String parameterName = "AVONR2";<br />            int colIndex = 1; //this is the column in the ResultSet to use as the values<br />           <br />//            Load JDBC driver for the database that will be queried   <br />            Class.forName(driverName);<br /><br />            Connection connection = DriverManager.getConnection(connectStr, userName, password);<br />            Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE , ResultSet.CONCUR_READ_ONLY);<br />           <br />            paramData = statement.executeQuery(query);<br />           <br />            DataDefController dataDefController = clientDoc.getDataDefController();<br />           <br />            ParameterField origParamField = (ParameterField)dataDefController.getDataDefinition().getParameterFields().findField(parameterName, FieldDisplayNameType.fieldName, Locale.getDefault());<br />            ParameterField newParamField = (ParameterField)origParamField.clone(true);<br />           <br />            Values newVals = (Values)newParamField.getDefaultValues().clone(true);<br />            newVals.clear(); <br />            paramData.first();<br />            while(!paramData.isLast()){<br />                ParameterFieldDiscreteValue value = new ParameterFieldDiscreteValue();<br />                value.setValue(paramData.getObject(colIndex));<br />                newVals.add(value);<br />                paramData.next();<br />            }<br />            <br />            dataDefController.getParameterFieldController().modify(origParamField, newParamField);<br />            // Store the report document in session<br />            session.setAttribute(reportName, clientDoc);<br /><br />        }<br /><br />            // ****** BEGIN CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET **************** <br />            {<br />                // Create the CrystalReportViewer object<br />                CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();<br /><br />                //    set the reportsource property of the viewer<br />                IReportSource reportSource = clientDoc.getReportSource();               <br />                crystalReportPageViewer.setReportSource(reportSource);<br /><br />                // set viewer attributes<br />                crystalReportPageViewer.setOwnPage(true);<br />                crystalReportPageViewer.setOwnForm(true);<br /><br />                // Apply the viewer preference attributes<br /><br />                // Process the report<br />                crystalReportPageViewer.processHttpRequest(request, response, application, null);<br /><br />            }<br />            // ****** END CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET ****************       <br /><br />    } catch (ReportSDKExceptionBase e) {<br />        out.println(e);<br />    }<br />   <br />%><br /><br /><br /><br />2) In a other report I tried to update the data source used by the report at runtime. I used the method &#39;setDataSource(ResultSet rs, String oldTableAlias, String newTableAlias)&#39; of the &#39;DatabaseController&#39;. I got a message like this: &#39;At present in Java reporting Component does not implement&#39;. I use JRC and the docs (http://support.businessobjects.com/global/interactive/xi/om/JRC/default.html) show me this method. Is it not possible to change the data at runtime in JRC? (I tried it with the methods &#39;setDataSource(IXMLDataSet rs, String oldTableAlias, String newTableAlias)&#39;, &#39;setDataSource(Object newds)&#39;, &#39;setDataSource(IDataSet ds, String oldTableAlias, String newTableAlias)&#39;, too. But the result was the same!)<br /><br /><br /><br />3) I tried to use Business Objects in JSF framework (Ver MyFaces 1.1.3) with the same samples above. But in JSF nothing work! I got the following exception. What is my problem? Can you get me a tutorial for jsf/BusinessObjects?<br /><br />08:21:43,165 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception<br />javax.faces.FacesException: com.businessobjects.reports.sdk.JRCCommunicationAdapter<br />    at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:435)<br />    at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:233)<br />    at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:219)<br />    at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)<br />    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at de.itinformatik.mes.web.filter.SynchronizingFilter.doFilter(SynchronizingFilter.java:42)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at de.itinformatik.mes.web.ajax.aa.AAFilter.doFilter(AAFilter.java:54)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br />    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)<br />    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)<br />    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)<br />    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)<br />    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)<br />    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)<br />    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)<br />    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)<br />    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)<br />    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)<br />    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)<br />    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)<br />    at java.lang.Thread.run(Thread.java:595)<br />Caused by: java.lang.ClassCastException: com.businessobjects.reports.sdk.JRCCommunicationAdapter<br />    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocumentState.saveContents(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocumentState.save(Unknown Source)<br />    at com.crystaldecisions.xml.serialization.XMLObjectSerializer.save(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.writeExternal(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.writeExternal(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.writeExternal(Unknown Source)<br />    at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1304)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1282)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at java.util.Hashtable.writeObject(Hashtable.java:813)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />    at java.lang.reflect.Method.invoke(Method.java:585)<br />    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)<br />    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at java.util.ArrayList.writeObject(ArrayList.java:569)<br />    at sun.reflect.GeneratedMethodAccessor669.invoke(Unknown Source)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />    at java.lang.reflect.Method.invoke(Method.java:585)<br />    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)<br />    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at java.util.ArrayList.writeObject(ArrayList.java:569)<br />    at sun.reflect.GeneratedMethodAccessor669.invoke(Unknown Source)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />    at java.lang.reflect.Method.invoke(Method.java:585)<br />    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)<br />    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at org.apache.myfaces.application.jsp.JspStateManagerImpl.serializeView(JspStateManagerImpl.java:590)<br />    at org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedViewInServletSession(JspStateManagerImpl.java:493)<br />    at org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedView(JspStateManagerImpl.java:332)<br />    at org.apache.myfaces.taglib.core.ViewTag.doAfterBody(ViewTag.java:122)<br />    at org.apache.jsp.testCR_jsp._jspx_meth_f_view_0(org.apache.jsp.testCR_jsp:149)<br />    at org.apache.jsp.testCR_jsp._jspService(org.apache.jsp.testCR_jsp:83)<br />    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)<br />    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br />    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)<br />    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)<br />    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)<br />    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)<br />    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)<br />    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)<br />    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)<br />    at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)<br />    ... 32 more<br /><br /><br />Thanks for your assistance <br /><br />Tosch</p>

    Which Business Objects are you referring to.
    MS .NET has a thing called Business Objects but they only work in .NET.

  • Schema Validation with Java and Document object

    Hi, I am working on a project that will validate an xml Document object from a child class. I seem to have completed XSD validation with new DOMSource(doc) and using schema factory, which doesn't support DTD validation. And now I am attempting to validate the DTD. It seems like all the examples I've seen are trying to parse files, and I am struggling with finding a way to validate it directly against the document object.
    The child class creates the xml document which is passed back to the parent class, and I need to do the validation in the parent class, so I need away to validate against the document object. This will be an assertion in Fitnesse if anyone is familar with it.
    private void doSchemaValidationCommand(int rowCount, Document doc, String xpathExpression)
             String validationPath = getText(rowCount,1);
             String extensionSeparator = ".";
             Boolean error = false;
             String ext = null;
             try
             int dot = validationPath.lastIndexOf(extensionSeparator);
            ext = validationPath.substring(dot + 1);
             catch(Exception e)
                  this.wrong(rowCount, 1, e.getMessage());
             if (ext.equalsIgnoreCase("xsd"))
             try {
             SchemaFactory factory =
                SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            File schemaLocation = new File(validationPath);
            Schema schema = factory.newSchema(schemaLocation);
            Validator validator = schema.newValidator();
            try {
                validator.validate(new DOMSource(doc));
            catch (SAXException ex) {
                this.wrong(rowCount, 1, ex.getMessage());
                error = true;
            catch (IOException ex)  {
                 this.wrong(rowCount, 1, ex.getMessage());
                 error = true;
           catch (SAXException ex) {
               this.wrong(rowCount, 1, ex.getMessage());
               error = true;
           catch (Exception ex){
                this.wrong(rowCount, 1, ex.getMessage());
                error = true;
             else if (ext.equalsIgnoreCase("dtd"))
                  try {
             }

    I tried this but it doesn't give me any validation of whether or not it was completed successfully, it just adds a tag for the dtd to the xml and doesn't seem to do anything further with it, am I missing any steps?
    else if (ext.equalsIgnoreCase("dtd"))
                  try {
                       DOMSource source = new DOMSource(doc);
                       StreamResult result = new StreamResult(System.out);
                       TransformerFactory tf = TransformerFactory.newInstance();
                       Transformer transformer = tf.newTransformer();
                       transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, validationPath);
                       transformer.transform(source, result);
                  catch(Exception e)
                       this.wrong(rowCount, 1, e.getMessage());
                       error = true;
             }Edited by: sarcasteak on Apr 13, 2009 1:33 PM

  • How to get multiple out parameters from a pl/sql stored procedure in ADF Jdeveloper 11g release2

    I´m trying to call from AppModuleImpl a stored procedure from my oracle DB which receives one input parameter and returns 5 out parameters. 
    I´m using jdeveloper 11g release2  ADF and I have created a java bean "ProRecallPlatesBean " with the atributes and accesors and I serialize it. just like in this article http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvgen.htm#sm0297
    This is my code so far:
    public ProRecallPlatesBean getCallProRecallPlates(String numPlates) {
    CallableStatement st = null;
    try {
              // 1. Define the PL/SQL block for the statement to invoke
              String stmt = "begin CTS.Pk_PreIn.proRecallPlates(?,?,?,?,?,?); end;";
              // 2. Create the CallableStatement for the PL/SQL block
              st = getDBTransaction().createCallableStatement(stmt,0);
              // 3. Register the positions and types of the OUT parameters
              st.registerOutParameter(2,Types.VARCHAR);
    st.registerOutParameter(3,Types.VARCHAR);
    st.registerOutParameter(4,Types.VARCHAR);
    st.registerOutParameter(5,Types.VARCHAR);
    st.registerOutParameter(6,Types.VARCHAR);
    // 4. Set the bind values of the IN parameters
    st.setString(1,numPlates);
    // 5. Execute the statement
    st.executeUpdate();
    // 6. Create a bean to hold the multiple return values
    ProRecallPlatesBean result = new ProRecallPlatesBean();
    // 7. Set values of properties using OUT params
    result.setSpfVal(st.getString(2));
    result.setTransportTypeVal(st.getString(3));
    result.setTransportCompanyVal(st.getString(4));
    result.setCompanyDescrVal(st.getString(5));
    result.setDGAPrint(st.getString(6));
    // 8. Return the result
    return result;
    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {
    // 9. Close the JDBC CallableStatement
    st.close();
    catch (SQLException e) {}
    In Jdeveloper I went into AppModule.xml JAVA>Client Interface section and expose "getCallProRecallPlates" Then I can see "getCallProRecallPlates" in Data Controls, I drag and drop it to a JSF page, an input text component and a button are generated in order to put in there the procedure input parameter (numPlates).
    I don't know if I'm on the right track.
    When I click the button, the "result" variable is supposed to be filled with data from the stored procedure. I want each of those values to be displayed in Output text or input text adf components but I dont know how. Thank you very much in advance I´m a newbie and i'll appreciate your help!

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • Java to COM

    Are there any good tools/resources out there to communicate between Java and COM? I've looked at http://www.linar.com/ however there tools are priced too high for me.
    Thanks,
    Nick

    Try this:
    http://www-106.ibm.com/developerworks/library/j-bridge/index.html

  • Stored Procedure VARCHAR2 Out Parameters NULL.

    Hi,
    I'm having a problem. I'm calling a stored procedure with 2 number out parametes and 2 varchar2 out parameters. The number out parameters have values, but the varchar2 out parameters seem to be null after a call to the procedure. I'm using VC++ 6.0 and Provider 9.2.0.2
    Naveen

    Did you specify the size for OUT Varchar2 parameters? Note that you need to specify the size for variable sized data types but not for fixed sized data types.

  • Executing plug-in through COM object

    Hello,
    I have tried  to create plugin with ATL COM object for  possibility execute the function into plug-in from my  application. And have got Runtime Exception which  refer to red line in code below ("Expression: gCoreVersion>=CoreHFT_VERSION_2")
    The next list is my C# code for invoke function RunReplacen for COM coclass ConnectorToAcrobat
         Type type = Type.GetTypeFromCLSID(guid);
         ConnectorToAcrobat connector = (ConnectorToAcrobat) Activator.CreateInstance(type);
         connector.RunReplace(@"Part1.u3d");
    The next C++ code  is part of COM object
    #ifndef MAC_PLATFORM
    #include "PIHeaders.h"
    #endif
    STDMETHODIMP CConnectorToAcrobat::RunReplace(BSTR filePathToU3D)
          char myPath[MAX_PATH];
          wcstombs(myPath, filePathToU3D, MAX_PATH);
          ASAtom pathType = ASAtomFromString("Cstring");
         // Function of plug-in
          CreatePDFWith3DAnnotation(&name);
          return S_OK;
    What is wrong? How can I workarround this problem?

    No, plugin and COM object it is a one  solid file.
    Anyway, I've faced with new problems.  The  AVDocOpenFromFile(ASPathName , ASFileSys , ASText )  function  works perfectly,  but if file doesn't containe forms. And when I want to open file with forms I getting crash.
    Next, works with multithreading.
    ACCB1 ASBool ACCB2 PluginInit(void)
    DWORD ThreadID;
    HANDLE hThread = CreateThread(0,0, ThreadProc, NULL, 0, &ThreadID);
    return MyPluginSetMenu();
    DWORD WINAPI ThreadProc(LPVOID lpParam )
    BSTR filePathToU3D = SysAllocString(L"Part1.u3d");
    char myPath[MAX_PATH];
    wcstombs(myPath, filePathToU3D, MAX_PATH);
    ASAtom pathType = ASAtomFromString("Cstring");
    //Unhandled exception at 0x56230fa0 in Acrobat.exe: 0xC0000005: Access violation reading location 0x00000044.
    ASFileSys fileSys = ASGetDefaultFileSysForPath(pathType, myPath);
    ASPathName name = ASFileSysCreatePathName(fileSys, pathType, myPath, NULL);
      CreatePDFWith3DAnnotation(&name);
        return 0;
    (this code works fine in one thread)

Maybe you are looking for

  • How to setup Macbook Pro 13" to get 2560 x 1440 resolution on a Dell U2711?

    Any help greatly appreciated. I am trying with mini-display port to DVI cable now, and can't quite get to 2560x1440... Either on native MAC OS environment or on the Bootcamp Win-7 professional (64bit) environment. Do I need to buy another cable? Or i

  • Disc drive will not eject in Windows 7

    I just upgraded from XP pro to Windows 7 home premium yesterday and it's all been working great save one little detail: my disc drive will not eject discs. I've tried the eject button (I'm on an aluminum macbook late 2008) as well as manually ejectin

  • How can I burn a DVD from iMovie '11?

    I just discovered that iDVD does not come with iLife '11 as part of the 10.7 OS. The option to "share" as a DVD is still part of iMovie 9.0.4, but the process never completes because iDVD is not there. Is there a work around? Apple suggested using th

  • Making something happen on mouse click in separate class

    Hi, I have two classes, Pixel, and Calc. Calc extends applet and pixel extends canvas. Calc creates instances of pixel in the applet, and what i want to happen is that when the user clicks on a pixel, it changes color. however, no color changing was

  • HP1536dnf Scan problem with Mac OSX 10.7.5

    I have just installed the HP online download driver for my Mac computer (running Mac OSX 10.7) and the subject HP 1536dnf MFP; when attempting to operate the HP1536dnf Scan function from my MacBookPro; I get the following message: 192.168.0.6 is curr