DatabaseMetaData meta = conn.getMetaData(); code throwing an exception

I have a JSP/servlet website that is finished that I'm trying to deploy and everything works fine on my local machine. It uses a postgresql database. When I stick it on the server of the webhosting company, it breaks on the following code: DatabaseMetaData meta = conn.getMetaData(); Have any troubleshooting tips or ideas?

When I stick
it on the server of the webhosting company, it breaks
on the following code: DatabaseMetaData meta =
conn.getMetaData();What do you mean by breaks? What is the error you are getting? In the hosted environment, are you sure that the Connection is established correctly? (If you are getting a null pointer exception, check your Connection URL) By definition, all JDBC driver's Connection interface's implementation should support the getMetaData() method. However, what kind of meta data you get may depend on the JDBC driver.

Similar Messages

  • Very strange...server based swf tries to access local working copy code, throws null exception...

    Here's one for the strange folder...
    I have my Flex app.  I build the project and copy the resulting swf to my development (192.168.100.110:511/devportal/) server for testing....this works perfectly fine.
    However, some of my testers see an error (including myself) that is odd.  When I run the swf on the server, for one specific function, I get a null exception error.  What's interesting about it is that the stack trace indicates that the error occurred in my local working copy of code:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at apps::AsrUtilization/togglePanel()[C:\Users\eloy91100636\Desktop\Portal\UserInterface\htd ocs\LABPortal\src\apps\AsrUtilization.mxml:722]
        at apps::AsrUtilization/__callPanel_click()[C:\Users\eloy91100636\Desktop\Portal\UserInterfa ce\htdocs\LABPortal\src\apps\AsrUtilization.mxml:933]
    How is it that a swf running on a separate machine blows up trying to reference a function in the working code on my pc?
    And, what's more, is that some people run the swf just fine with no error and it works clean while others encounter this error.  I've cleaned and recompiled the project and it doesn't fix the problem.
    HELP!!!
    Adrian

         Good call on the player types...yes, the one's who don't see the error are running release version, the rest are running debug version.
    Thanks!!!!!
    Adrian

  • What HTTP status code will client receive if dopost throws an exception?

    If my servlet code is written this way:
         public void doPost(HttpServletRequest req, HttpServletResponse res)
                                throws ServletException {
               throw new Exception("Test dopost exception");
            }What HTTP status code will client receive?
    Then what about this code?
         public void doPost(HttpServletRequest req, HttpServletResponse res)
                                throws ServletException {
               throw new ServletException("Test dopost exception");
            }Thanks!

    KKnight wrote:
    I wrote code to make a test.I would have answered exactly that. You're the developer here, are you? :)

  • How to throw bundled exceptions thrown by checkErrors()

    Hi,
    I call pl/sql to do update, and call checkErrors() , the code looks like following, but it doesn't display read friendly message on the screen. What is the right way to throw bundled exception from checkErrors() method?
    try{
    xxg2cGoalPk.startWf (conn,
    new BigDecimal(srpGoalHeaderId),
    new BigDecimal(userId),
    returnStatus,
    msgCount,
    msgData);
    int msgCount1 = 0;
    if(msgCount[0] != null){
    msgCount1 = Integer.parseInt(msgCount[0].toString());
    String returnStatus1 = returnStatus[0];
    String msgData1 = msgData[0];
    OAExceptionUtils.checkErrors(tx,msgCount1, returnStatus1, msgData1);
    catch(OAException e) {
    e.printStackTrace();
    throw new OAException(e.getDetailMessage(),OAException.ERROR);
    thanks
    Lei

    What Shiv said is only an alternative, but what you are using is correct.I haven't tested but as per javadoc of
    OAExceptionUtils.checkErrors(tx,msgCount1, returnStatus1, msgData1);
    will itself raise bundled exceptions. You need to write this line outside try/catch block.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • NCo throws an Exception calling BAPI_MATERIAL_SAVEDATA?

    I've been successful in calling BAPIs from NCo (BAPI_CHARACT_CREATE, BAPI_CLASS_CREATE, BAPI_VENDOR_FIND, BAPI_VENDOR_GETDETAIL)....
    However when calling BAPI_MATERIAL_SAVEDATA, I always get the following Exception being thrown:
    Index was outside the bounds of the array.
       at SAP.Connector.Rfc.RfcStructureUtil.ToRfcStructure(Object obj, Byte[] dest, Type t, Encoding encoding, Boolean isUnicode, PropertyInfo[] propinfos, RfcStructInfo structInfo)
       at SAP.Connector.Rfc.RfcStructureUtil.GetITabFromList(SAPConnection conn, Object list, Type t, RfcStructInfo structInfo, Int32 itab)
       at SAP.Connector.Rfc.RfcClient.PrepareClientParameters(Type classType, MethodInfo m, Boolean isTQRfc, Object[] MethodParamsIn, RFC_PARAMETER[]& paramsIn, RFC_PARAMETER[]& paramsOut, RFC_TABLE[]& tables, ParameterMap[]& paramMaps)
       at SAP.Connector.Rfc.RfcClient.RfcInvoke(SAPClient proxy, String method, Object[] methodParamsIn)
       at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn)
       at SAP_MM_Test.SAPProxy1.Bapi_Material_Savedata(BAPI_MARA Clientdata, BAPI_MARAX Clientdatax, String Flag_Cad_Call, String Flag_Online, BAPI_MPOP Forecastparameters, BAPI_MPOPX Forecastparametersx, BAPIMATHEAD Headdata, String No_Dequeue, String No_Rollback_Work, BAPI_MPGD Planningdata, BAPI_MPGDX Planningdatax, BAPI_MARC Plantdata, BAPI_MARCX Plantdatax, BAPI_MVKE Salesdata, BAPI_MVKEX Salesdatax, BAPI_MARD Storagelocationdata, BAPI_MARDX Storagelocationdatax, BAPI_MLGT Storagetypedata, BAPI_MLGTX Storagetypedatax, BAPI_MBEW Valuationdata, BAPI_MBEWX Valuationdatax, BAPI_MLGN Warehousenumberdata, BAPI_MLGNX Warehousenumberdatax, BAPIRET2& Return0, BAPIPAREXTable& Extensionin, BAPIPAREXXTable& Extensioninx, BAPI_MEANTable& Internationalartnos, BAPI_MAKTTable& Materialdescription, BAPI_MLTXTable& Materiallongtext, BAPI_MFHMTable& Prtdata, BAPI_MFHMXTable& Prtdatax, BAPI_MATRETURN2Table& Returnmessages, BAPI_MLANTable& Taxclassifications, BAPI_MARMTable& Unitsofmeasure, BAPI_MARMXTable& Unitsofmeasurex) in C:\Dev\SAP_MM_Test\SAPProxy1.vb:line 220
       at SAP_MM_Test.Form1.Button1_Click(Object sender, EventArgs e) in C:\Dev\SAP_MM_Test\Form1.vb:line 114"     String
    I even tried calling the Method with all parameters set to Nothing and also get the same error.  I tested some of the other BAPI I listed will all Nothing parameters and it does not throw any exceptions.  Almost seems as if the Proxy generated classes did not get created properly or something?
    Has anyone else successfully called BAPI_MATERIAL_SAVEDATA from NCo 2.0?
    PS...I was successful in calling the BAPI from SE37 with the exact same data, therefore I know I have all the mandatory parameters specified (HeadData, ClientData, ClientDatax...etc)
    Anything obvious in the following code?:
    =======================================
         ' Connection String
         Dim cs As String = "ASHOST=10.83.180.239 SYSNR=10 CLIENT=110 USER=CMCHUG2 PASSWD=********"
         ' construct the proxy with connection string
         Dim proxy As New SAPProxy1(cs)
         ' Header Data
         Dim HeadData As New BAPIMATHEAD
         HeadData.Material = "000000000000000754"            ' Material NUmber (PAD to 18)
         HeadData.Ind_Sector = "U"                           ' Industry Sector
         HeadData.Matl_Type = "ERSA"                         ' Material Type (ERSA=Space Parts / HERS=Manufacturer Part)
         HeadData.Basic_View = "X"                           ' Need at least 1 view
         ' Client Data
         Dim ClientData As New BAPI_MARA
         ClientData.Matl_Group = "01"                        ' Material Group
         ClientData.Base_Uom = "EA"                          ' Base Unit of Measure
         ' Set the ClientData Indicator Table
         Dim ClientDataX As New BAPI_MARAX
         ClientDataX.Matl_Group = "X"
         ClientDataX.Base_Uom = "X"
         ' Short Description (TABLE)
         Dim ShortDesc As New BAPI_MAKTTable
         Dim sDescr As New BAPI_MAKT
         sDescr.Langu = "E"                                  ' Language
         sDescr.Matl_Desc = "Short Desc Test"               ' Short Description (Max 40)
         ShortDesc.Add(sDescr)
         Dim tblRet As New BAPIRET2
         Dim tblRetMsg As New BAPI_MATRETURN2Table
         proxy.Bapi_Material_Savedata(ClientData, ClientDataX, Nothing, Nothing, Nothing, Nothing, HeadData, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, tblRet, Nothing, Nothing, Nothing, ShortDesc, Nothing, Nothing, Nothing, tblRetMsg, Nothing, Nothing, Nothing)
    Exception Thrown Here!!!

    Reiner,
    Tried what you suggested, still get the same results.  This the 3rd development system I try this from. In all cases I generated proxies via drop and drop of the SaveData Method under StandardMaterial (BOR).  Since it was just generated the MetaData should be up to date?, good suggestion thought, I could see where that might be a problem going against different backends.
    My lastest attempt (I am quickly running out of ideas), was to generate a Standalone Proxy containing the SaveData method.  Same Results :{ 
    I was able to create Standalone Proxies for the other Business Objects I'm using (Characteristics, Class..etc) without a hitch. (Except for "Class", complaining about the Class name generated (Public Class Class...so I renamed to sapClass).  Using the Standalone Proxy Class I might try from Visual Studio 2005 to see if I get the same results.
    Also encountered another problem when trying to Add the whole BOR object StandardMaterial to the Proxy (so I would have access to a few of the Methods....this failed with some Java out of memory error....I would have to attempt this again to capture the exact error....when I get time I'll put that in another post).

  • Office 365 Sandbox Solution EventReceiver throwing Remote Exception in ItemAdding

    Hi,
    I created a sandbox webpart for O365 with EventReceivers with ItemAdding for Document Library and while i upload a document to library in O365  sharepoint site application throws below exception:-
    System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
    Server stack trace: 
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type us
    Same code works perfectly on my Development machine, Please help. Below is the Code
    base.EventFiringEnabled = false;
    bool isFile = (properties.AfterProperties["vti_filesize"] != null);
    if (isFile == true)                   
    SPWeb currentWeb = properties.OpenWeb();
    // Get foldername from url like Document/EC10001/filename.txt                       
    string folderName = properties.AfterUrl.Split(new char[] { '/' })[1];
    SPList spList = currentWeb.Lists[properties.List.ID];                       
    SPQuery spQuery = new SPQuery();                       
    spQuery.Query = "<OrderBy><FieldRef Name='Modified' Ascending='FALSE'/></OrderBy>";
    //Getting the folder object from the list                       
    SPFolder folder = spList.RootFolder.SubFolders[folderName];
    //Set the Folder property                       
    spQuery.Folder = folder;
    int fileSequenceId = 0;                      
    SPListItemCollection items = spList.GetItems(spQuery);
    if (items.Count > 0)                       
    string documentID = items[0]["DocumentID"] != null ? items[0]["DocumentID"].ToString() : string.Empty;
    if (!string.IsNullOrEmpty(documentID))                           
    string splitNumber = documentID.Split(new char[] { '-' })[1];                               
    fileSequenceId = Convert.ToInt32(splitNumber) + 1;                           
    else                           
    properties.ErrorMessage = "Unable to generate Document Id";                               
    properties.Cancel = true;                           
    else                       
    fileSequenceId = 1;                       
    // Set DocumentID like EC10001-001                       
    properties.AfterProperties["DocumentID"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));      
    // Retrive "EEC000" string from Constant List               
    properties.AfterProperties["vti_title"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));   
    // Retrive "EEC000" string from Constant List                
    base.EventFiringEnabled = true;
    Thanks,
    Pranay Chandra Sapa

    Hi,
    According to your description, my understanding is that when you upload document in Office 365 site, the event receiver in sandbox solution throws error.
    Per my knowledge, if you want to use event receiver in Office 365 environment, you need to use remote event receiver instead the normal event receiver in an app.
    Here are some detailed articles for your reference:
    Create a remote event receiver in apps for SharePoint
    Handle events in apps for SharePoint
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Class.forName() throws null exception in servlet

    Hi, just wondering if anyone having this similar problem:
    when i try to load a class using Class.forName() method inside a servlet, it throws null exception.
    1) The exception thrown is neither ClassNotFoundException nor any other Error, it's "null" exception.
    2) There's nothing wrong with the code, in fact, the same code has been testing in swing before, works perfectly.
    3) I have include all necessary jars/classes into the path, even if i haven't, it should throw ClassNotFoundException instead, not "null" exception.

    I have tried to detect any possible nullable variable, and it is able to run until line 15. The exception thrown is actually null only... not NullPointerException... which is why i have confused...
    the message i received is "PlugInException: null".
    The code is at follow:
    * Load plugin
    * @return ArrayList of plugins
    * @exception PlugInException PlugInException
    01 public ArrayList loadPlugin()
    02 throws PlugInException
    03 {
    04 PlugIn plugin;
    05 ArrayList plugins = new ArrayList();
    06
    07 for (int i = 0; i < configLoader.getPluginTotal(); i++)
    08 {
    09 try
    10 {
    11 if (debugger > 0)
    12 {
    13 System.out.print("Loading " configLoader.getPluginClass(i) "...");
    14 }
    15 if (Class.forName(configLoader.getPluginClass(i)) == null)
    16 {
    17 if (debugger > 0)
    18 {
    19 System.out.print(" not found");
    20 }
    21 }
    22 else
    23 {
    24 if (debugger > 0)
    25 {
    26 System.out.println(" done");
    27 }
    28 plugin = (PlugIn)(Class.forName(configLoader.getPluginClass(i)).newInstance());
    29 plugin.setContainer(container);
    30 plugins.add(plugin);
    31 }
    32 }
    33 catch (Exception e)
    34 {
    35 throw new PlugInException("PlugIn Exception: " + e.toString());
    36 }
    37 }
    38
    39 return plugins;
    40 }

  • Custom code as an exception handler not working.

    Hi,
    I worked on Custom Handler for unauthorized access to a taskflow following the link below and it worked. But a special case in this doesn't work.
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/taskflows_complex.htm#ADFFD22602
    Scenario-1: I have a link that opens an unauthorized taskflow as blank page. I tried the solution of custom handler and am able to display message or display error page --- WORKS FINE
    Scenario-2: I have a link that opens an unauthorized taskflow in a pop-up as blank page. The above solution doesn't work. I tried displaying SOPs but nothing gets print --- DOESN'T WORK.
    Details:
    The custom handler doesn't work with Pop-ups. I have an unauthorized taskflow that gets called inside a pop-up using a link. Being an unauthorized user, I click on the link and it pops-up with a blank page. As per the custom handler it is supposed to display error-page. But it doesn't.
    I tried displaying SOPs inside the handleException method and nothing prints. The exception handler is unable to catch the exception. If this use-case throws some exception, my exception handler would have handle it but it doesn't raise any exception.
    Is this something issue that I need to discuss with FMW team?
    Any workaround for this would be of great help.
    Code Sample:
    public void handleException(FacesContext facesContext, Throwable throwable,
    PhaseId phaseId) throws Throwable {
    String errorMessage = throwable.getMessage();
    if (errorMessage != null && errorMessage.indexOf("ADFC-0619") > -1) {
    setEL("#{sessionScope.errorMessage}",
    "You are not authorized to view this page.");
    ExternalContext externalContext =
    facesContext.getExternalContext();
    externalContext.redirect("ErrorPage");
    } else {
    super.handleException(facesContext, throwable, phaseId);
    Thanks
    Raza

    Hi Frank,
    This scenario is not specific to a particular TaskFlow. In General, there are links in some views, that invokes taskflows and a particular user may not have permission to that TaskFlow. In this scenario, I am not sure where I need to define the method or router. And Hence I registered the Custom Exception Handler as a service as per the documentation.
    But the logic in documentation doesn't work with Pop-ups.
    Thanks
    Raza

  • Export with BiarEngine.jar works, using the API it throws an exception

    Hello,
    I'm using BiarEngine.jar to export from my CMS. it works fine.
    Now I want to use the API to get someting more handy, but I receive an exception (NoSuchFieldError) as if I had a mismatch between versions.
    I'm stuck with it, if somebody has an idea...
    Thanks a lot.
    Alain
    Here is the java code:
    IExportOptions oExportOptions = BIARFactory.getFactory().createExportOptions();
    oExportOptions.setIncludeSecurity(false);
    oExportOptions.setIncludeDependencies(true);
    oExportOptions.setCallback(
         new IExportCallback()
              public void onSuccess(int id)      {...}
              public void onFailure(int id, BIARException biarException) {...};
    BIAROutput oBIAROutput = new BIAROutput( oEntrepriseSession, "c:\myFile.biar", exportOptions );
    At this point it throws the exception:
    Exception in thread "main" java.lang.NoSuchFieldError: SI_MODELCUID_SET
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.setupProperties(DeltaStore.java:188)
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.unpack(DeltaStore.java:37)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.continueUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.startUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.queryHelper(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.query(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.at.query(Unknown Source)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.retrieveXSDVersions(XSDManager.java:204)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.<init>(XSDManager.java:194)
         at com.businessobjects.sdk.biar.internal.XSDManager$XSDCache.getXSD(XSDManager.java:365)
         at com.businessobjects.sdk.biar.internal.XSDManager.<init>(XSDManager.java:55)
         at com.businessobjects.sdk.biar.BIAROutput.<init>(BIAROutput.java:73)

    >
    Just need to confirm if the ANT script can be run against individual OSB project than OSB configuration project?
    >
    It is possible. I'm going the same way here. However, I remember I needed to contact support because it was not a standard feature of the Ant task. They provided me with the patch that allowed me to use -configSubProjects parameter in export.
    >
    Can we have multiple OSB configuration projects on the OSB server ?
    >
    I don't think so.

  • Performance costs of throwing an Exception

    Hi people. I was just reading another post around here, and I became curious about how much the Exception mechanism could become an overhead... I made a simple (REALLY simple) little test class, and I was shocked to perceive that actually throwing an Exception is cheap (I always thought that it would be just the opposite...). Try running this later:
    public class Test {
         public boolean something() {
              return true;
         public void nothing() throws Exception {
              throw new Exception("Voila");
         static public void main(String[] algo) {
              Test test = new Test();
              long now = System.currentTimeMillis();
              test.something();
              System.out.println("boolean method took " +
    (System.currentTimeMillis() - now) + " milliseconds.");
              now = System.currentTimeMillis();
              try {
                   test.nothing();
              } catch (Exception e) {
                   System.out.println("exception method took " +
    (System.currentTimeMillis() - now) + " milliseconds.");
    }and here are some results I got:
    1)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    2)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    3)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    Of course, I assume that when the stack grows a bit, the result could be quite different. I ran this on a AMD 900 MHz, 512Mb RAM, JDK 1.4.1_01 under Eclipse.
    PS: Excuse me for my bad English :)
    falowwwwww

    Yeah, I guess I was always right...
    Here's the (fixed) code:
    public class Test {
         public boolean something() {
              return true;
         public void nothing() throws Exception {
              throw new Exception("Voila");
         static public void main(String[] algo) {
              Test test = new Test();
              long now = System.currentTimeMillis();
              for (int i=0; i<Integer.MAX_VALUE; i++) {
                   test.something();
              System.out.println("boolean method took " + (System.currentTimeMillis() - now)
                   + " milliseconds.");
              now = System.currentTimeMillis();
              for (int i=0; i<Integer.MAX_VALUE; i++) {     
                   try {
                        test.nothing();
                   } catch (Exception e) {
              System.out.println("exception method took " + (System.currentTimeMillis() - now)
                   + " milliseconds.");
         }The boolean loop took twelve seconds to finish... The exception loop ran for almost 18 minutes (when I stopped it! it didn't even complete!)
    If anyone want to, run the code and post here the real results. Thanks!!
    I guess that "our great designers" here at my company will lose their jobs... Well I think they deserve it. If only they payed attention to me at the beggining when I complained about throwing lots of unnecessary exceptions... eheheheh
    PS: Excuse me for the bad English again!!
    falow!!!!!!!

  • Throwing generic exception in XI

    Hi friends
    I was trying to incorporate one of the blog by champion blogger Michal, which deals with Throwing Generic Exception.
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6398. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Is there any way around for avoiding ABAP mapping (hard part) and implementing some java code in place of that?
    In second step instead of going for ABAP mapping I tried to raise an exception by using  exception classes as explained in   https://www.sdn.sap.com/pub/wlg/3069. [original link is broken] [original link is broken] [original link is broken] [original link is broken] but by that way Error in SOAP header (in SXMB_MONI) displayed Runtime Exception rather than showing user defined/desired message

    hi,
    just like explained in my blog - you can only do it in ABAP
    to have it in error header segment of XI message
    >>>>but by that way Error in SOAP header (in SXMB_MONI) displayed Runtime Exception rather than showing user defined/desired message
    just like Alex mentioned in his blog - that's why I wrote mine
    Regards,
    michal

  • Application call to ODBC SQLSetEnvAttr function throw HY011 exception

    Hi All,
          I try to use odbc driver manager in my .Net Application.first My .Net runtime is 3.5, odbc function calls(unmanaged functions are  imported to .Net application by dllimport attribute)can work well.but when .Net runtime is upgraded
    to 4.0,SetEnvAttr function calls
    return SQL-ERROR and I call SQLGetDiagRec function  get this error information:Operation invalid at this time.sqlstate value is HY011.
    below is my code fragment:
    [DllImport("odbc32.dll")]
    extern static short SQLSetEnvAttr(
    IntPtr envHandle,
    ushort attribute,
    IntPtr attrValue,
    int stringLength);
    [DllImport("odbc32.dll")]
    extern static short SQLAllocHandle(
    ushort HandleType,
    int InputHandle,
    out IntPtr OutputHandle);
    try
    rc = SQLAllocHandle(SQL_HANDLE_ENV, 0, out sql_env_handle);
    if ((rc != SQL_SUCCESS) && (rc != SQL_SUCCESS_WITH_INFO))
    throw new Exception("SQLAllocHandle: failed to allocate SQL_HANDLE_ENV");
    rc = SQLSetEnvAttr(sql_env_handle, SQL_ATTR_ODBC_VERSION, (IntPtr)SQL_OV_ODBC3, 0);
    //if ((rc != SQL_SUCCESS) && (rc != SQL_SUCCESS_WITH_INFO))
    // throw new Exception("SQLSetEnvAttr: failed to set SQL_ATTR_ODBC_VERSION");
    if((rc == SQL_SUCCESS_WITH_INFO)||(rc == SQL_ERROR))
    short i=1;
    short rc2;
    StringBuilder sqlstate=new StringBuilder();
    int NativeErrorPtr=0;
    StringBuilder MessageText=new StringBuilder();
    short BufferLength=256;
    short TextLengthPtr=0;
    while ((rc2 = SQLGetDiagRec((short)SQL_HANDLE_ENV,sql_env_handle,i,sqlstate,
    ref NativeErrorPtr,MessageText,BufferLength,ref TextLengthPtr))!= SQL_NO_DATA)
    i++;
    my operation system is win7 64bit. Could someone help me? thanks

    I already fixed this problem.
    [DllImport("odbc32.dll")]
    extern static short SQLAllocHandle(
    long HandleType,
    int InputHandle,
    out IntPtr OutputHandle);
    I replace ushort datatype with long datatype.So it works well

  • JNDI: DirContext::list throws on exception when existing context is in LDAP

    I was able to import tutorial.ldif using LDAP Browser/Editor without incident:
    http://www-unix.mcs.anl.gov/~gawor/ldap/
    My LDAP now has the following tree:
    o=JNDITutorial
    ou=Groups
    5 cn entries
    ou=People
    10+ cn entries
    However, when calling DirContext::list("ou=People"), it throws the following exception message:
    javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'ou=People'
    Here is the code:
         final static String ldapServerName = "backbone.seamonkey";
        public static void main(String[] args) {
         // Set up the environment for creating the initial context
         Hashtable env = new Hashtable(11);
         env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, "ldap://" + ldapServerName +"/o=JNDITutorial");
         try {
             // Create initial context
             DirContext ctx = new InitialDirContext(env);
             // Return enum of people, but throws an exception...
             NamingEnumeration people = ctx.list("ou=People");

    I tried the same with a known LDAP service: OpenLDAP.org, and I get the same exception NameNotFoundException thrown with the following code:
         final static String m_ldapServerName = "OpenLDAP.org";
        public static void main(String[] args) {
         // Set up the environment for creating the initial context
         Hashtable<Object, Object> env = new Hashtable<Object, Object>();
         env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, "ldap://" + m_ldapServerName + ":389/");
         try {
             // Create initial context
             DirContext ctx = new InitialDirContext(env);
             // Return enum of people, but throws an exception...
             NamingEnumeration people = ctx.list("ou=People");

  • How to throw 2 Exceptions,

    Hello,
    I have a problem with a method. I would like to do something like:
    boolean thisIsATest ( ) throws PepeException,PacoException {
    Is it possible ? I already hava thought in wrapping then into a general exception, but I would like to find out if this is possible.
    Thanks in advace for your help,
    Sitomania

    boolean thisIsATest ( ) throws
    PepeException,PacoException {The "throws" clause simply states what exceptions the method can throw. You can list as many as you want, separated by commas.
    However, you can't actually throw multiple exceptions at once. This is reasonable: there should be a single definable condition that prevents your code from continuing.

  • JAXB2 marshaller throws Validation Exception

    Hello All.. I am trying to marshall a JAXB Object using JAXB2 marshaller and validate it against an xsd.
    During this process of validation, the parser when reads the xsd fails with the parse error. The schema xsd is a working xsd from a webservice provider. The validation is fine when it is done on XML Spy and SOAP UI. But when this xerces xmlschema validator comes to picture its even not able to parse the XSD for validating against it.
    Here is the head of the xsd..
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
         xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
         xmlns:tns="http://com.cyber.space./services"          
         targetNamespace="http://com.cyber.space./services"
         elementFormDefault="qualified"
    and a huge schema followed.
    Step.1: I used this xsd to generate JAXB classes.
    Step2. Used jaxb2marshaller from spring.oxm,
    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
              <property name="contextPath" value="com.cyberspace.service"/>
              <b><property name="schema" value="classpath:pathtoXsd"/></b>
         </bean>
    so in my application , i have reference to marshaller object.so can use like this.
    request ( the jaxb request object populated with valid values as per the schema)
    result - output -- outgoing xml.
    marshaller.marshall(requsest, result);
    Here comes the problem..The out going xml is like this..
    <?xml version="1.0" encoding="UTF-8" ?>
    <Request xmlns="http://com.cyber.space./services">
    <RequestService>123</RequestService>
    etec etc etc.. son on..
    This xml when converted to soap message and sent over to webservice its accepted as valid request and response is back. But all it happens when i dont validate it against the schema that i have.
    Look at the :
    <b><property name="schema" value="classpath:pathtoXsd"/></b> set as a property to jaxb2 marshaller.
    This makes sure that the xml generated out the jaxb object after marshall process is valid against the XSD schema. Here it fails for some reason.
    If the dont ask the marshaller to validate( removing the schema property ), then the xml is fine able to proceed with next steps of sending the successfull VALID SOAP REQUEST and response is back. But if do a validation by setting the schema property with value as path to xsd.
    The error is :
    Caused by:<b> org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.2: ' ' is not a valid value of list type 'null'.</b>
         at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Util.java:109)
         at com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(ErrorHandlerAdaptor.java:104)
         at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
         at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
         at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:429)
    ...,more
    Is it a problem with namespace.? If i assume that the resulting xml out of the marshall process when validated against the XSD is failing for some missing data( business data), then the request itself would not be sent as soap requst.
    But the problem is not that with data in the xml. its some thing going on with the strict validation the validator is doing.
    Edited by: cnu_coder on May 22, 2008 7:41 AM
    Edited by: cnu_coder on May 23, 2008 8:14 AM

    Hello,
    The ABAP code looks ok except the missing if error != null statement.
    Please check the similar code for raising exception provided in the below blog:
    /people/ravi.gupta4/blog/2010/02/04/automating-cancellation-of-a-failed-message-in-xi
    Also, Can you check whether exception is raised using Dynamic config UDF and a call to abap mapping is made.
    Check the other approach of raising an exception:
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    -Rahul

Maybe you are looking for

  • Error processing XML request, java.lang.IllegalArgumentException

    Hi all, In my code I can successfully connect to server and send the content which is an XML content: param = java.net.URLEncoder.encode(s, "UTF-8"); java.io.PrintWriter out = new java.io.PrintWriter(connection.getOutputStream()); out.print(param); R

  • Help! Where is the file?

    Hi all, I need to customize the Oracle application 11i's forms in my company. However, I can't find the source (fmb file) in Solaris. Please tell me where is the path of the forms source and the library. Thanks a lot!!!

  • How to psss a table from sapscript to routine program

    HI, i want to pass a table from sapscript to routine program. the requirment is to sor the table by material number wise. how do we pass throug itcsy structure. Regards, Balachandran

  • Code Errors Not showing in 4.7 FlashPro Projects

    Just installed 4.7 and my existing and newly created FlashPro projects don't show code errors. Here's the same test class in 4.7 and 4.6. Anyone else seeing this or is there a pref I'm missing: Doesn't seem to be a problem with a newly created Action

  • Copy a folder and all contents to another Mac

    I have a folder of other folders and albums. I would like to copy that folder and all of its contents to another Mac. So the other Mac will see it just like I do after the copy. Same folders and albums. I do not want to just move the library as that