Accessing custom dll from Servlet

Hello,
I am trying to load a custom dll in iWS4.1SP9 but I seem no able to find the dll.
Where do I have to place it on the system? I have placed it in WinNt/system32 dir but still could not find it.
I was sucessful in loading the dll when running as a stand-alone app. What is the difference?
Thanks,
Nuri

Hi !
In your code i think there is a simple mistake in creating the IntialContext
for example:
public Context getInitialContext() throws NamingException
          try{
               System.out.println("url received here is "+url);
               Hashtable ht= new Hashtable();
               ht.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
               ht.put("java.naming.provider.url", url);
               //return new InitialContext(hashtable);
               return new InitialContext(ht);
          catch(NamingException namingexception)
               Debug.log("We were unable to get a connection to the WebLogic server at " + url);
Debug.log("Please make sure that the server is running.");
return null;
This intial context is dependent on Application Servers,where exactly placing your EJB's.
In general....
Properties prop=System.getProperties();
prop.put....
IntialContext context=new IntialContext(prop);
Like this it should be....
I hope this will solve your problem,

Similar Messages

  • Accessing custom classes from JSP

    Hi Guys,
    I am having some problems accessing my custom classes from my JSP.
    1) I've created a very simple class, SimpleCountingBean that just has accessors for an int. The class is in the package "SimpleCountingBean". I compiled this class locally on my laptop and uploaded the *.class file to my ISP.
    2) I've checked my classpath and yes, the file "SimpleCountingBean/SimpleCountingBean.class" is located off of one of the directories listed in the classpath.
    3) When I attempt to use this class in my JSP, via the following import statement:
    import "SimpleCountingBean.*"
    I get the following compile error
    java.lang.NoClassDefFoundError: SimpleCountingBean/SimpleCountingBean
    I'm pretty sure that my classpath is properly setup because when I purposely garble the import statement, I get the "package not found" compile error.
    Do I need to upload some other files in addition to the class file? Any suggestions would of course be appreciated.
    Sonny.

    Trying to get some clearer view.. so don't mind..
    So you uploaded all your .jsp files into your account which is:
    home/sonny
    and it compiles and work. But custom classes doesn't seems to be working, where did you place your classes?
    From my knowledge of tomcat, classes are normally placed in, in this case:
    home/sonny/web-inf/classes
    Maybe it differs from windows enviroment to *nix enviroment.. well, I'm just saying out so if its not the case.. don't mind me.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Urgent-how to access custom tag from jsp tag

    I have a problem accessing a custom tag from a jsp expression.
    Details: I have a custom tag that returns a string variable. I need to access that variable from jsp expression <%%>.
    Can any body help me?

    Tags don't "return" values as in the normal sense.
    They can only support TEI (Tag Extra Information) that just stuffs a declared variable into the page's state.
    For example, if the tag class had a public method called getValue(), you could do the following:
    <xmp:mytag id="foo"/>
    <%
    out.println("value is " + foo.getValue());
    %>

  • Exception while accessing com port from servlet

    I am trying to access communication port from a Servlet using java communications api's.
    But Following exception was thrown
    Caught java.lang.NullPointerException:name can't be null while loading driver com.sun.comm.Win32Driver
    The SecurityManager do not allow that opeartion.
    java.security AccessControlException:access denied (java.io.FilePermission c:\j2sdk1.4.1\jre\lib\javax.comm.properties delete)
    at java.security.AccessControlContext.java:270) at java.security.AccessController.checkPermission(SecurityManager.java)
    at java.lang.SecurityManager.checkDelete()
    at java.comm.CommPortIdentifier.getPortIdentifiers(CommportIdentifier.java)
    Please help me.Tell me what to do.how to successfully access a communication port from a Servlet.

    Hi there. I am also facing the problem accessing com port via servlet. if u have the solution, kindly forward to me at [email protected]
    many thanks

  • Security Exception while accessing com port from servlet

    I am trying to access communication port from a Servlet using java communications api's.
    But Following exception was thrown
    Caught java.lang.NullPointerException:name can't be null while loading driver com.sun.comm.Win32Driver
    The SecurityManager do not allow that opeartion.
    java.security AccessControlException:access denied (java.io.FilePermission c:\j2sdk1.4.1\jre\lib\javax.comm.properties delete)
    at java.security.AccessControlContext.java:270) at java.security.AccessController.checkPermission(SecurityManager.java)
    at java.lang.SecurityManager.checkDelete()
    at java.comm.CommPortIdentifier.getPortIdentifiers(CommportIdentifier.java)
    Please help me.Tell me what to do.how to successfully access a communication port from a Servlet.

    Well, have you tried the obvious to add the following permission to your web server's policy file?
    grant "file:<wherever my servlet resides>\myservlet.jar" {
    permission java.io.FilePermission "c:\j2sdk1.4.1\jre\lib\javax.comm.properties", "write,delete";
    }

  • Accessing Custom Controller from setter and Getter methods

    Hi Gurus
    How can we access the custom controller from setter and getter methods,is there any way to do that.
    Thanks & Regards
    Rajasekhar

    Hi Steve.
    Thanks very much for valuable information,  the main controller class is getting tracked in mo_owner which is declared as  CL_BSP_WD_VIEW_CONTROLLER, and I'm getting the reference through
    mo_owner ?= owner. (since mo_owner = owner is not getting converted of type mo_owner ). After doing this on whatever the contexnode class (say zl_xxxx_xxx_cnxx) the corressponding context node values are getting turned as  <#ERROR IN METADATA.
    I mean when I'm checking the configuration in bsp_wd_cmpwb configuration tab -> Available Fields->Enlarge the contex node->BTSTATUS (say for Example) there the values are showing as <#ERROR IN METADATA , After executing the above procedure
    I cross checked several times before and after redefining the context node method IF_BSP_MODEL~INIT, before redefining this method UI is working fine, after redefintion UI is throwing below error .
    Exception Details
    CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference
    Method: CL_BSP_MODEL=>IF_BSP_MODEL_BINDING~IS_ATTRIBUTE_VALID
    Source Text Row: 13
    Thanks & Regards
    Rajasekhar

  • Access custom metadata from another plugin

    I was wondering if it would be possible to access the custom metadata from one plugin from another plugin.
    I know you use the _PLUGIN object when you read or write the metadata with a plugin.Is there any way to pass the varible to another plugin, maybe stored in a xml or text file in the modules folder? I also see where you can use the "unique identifying string" or plugin.id. Is this id differant for every installation of Lightroom?

    Allen, I'm pretty sure the answer is no - you can't access another plug-in's custom fields.
    I'm sure I have read this limitation somewhere - even if I can't now see it stated explicitly in the documentation. If anything, the docs imply getPropertyForPlugin can do so by specifying the LrToolkitIdentifier value (which you may be able to pass as a preference). So this doesn't work:
         getData = photo:getPropertyForPlugin("uk.co.beardsworth.missing", jbMissing )
    It is an important point though that one plug-in should be able to access another's custom fields. Obviously one can think of many ordinary circumstances where it would be handy, but I'm more worried about the longer term DAM viability of custom metadata. Let's say I decided to release a plug-in based around custom fields and users entered metadata which had some value to them - whether that's just input time or business data (eg client or agency account number). Now move on to LR3 and the plug-in no longer works - I've disappeared, driven mad by SDK changes, or you're unwilling to pay my extortionate plug-in upgrade fee.
    Now what happens to that valuable metadata? The data is still in the database but you can't read it because the original plug-in's unavailable, and Adobe's built-in "All" Plugin Metadata panel only shows data from enabled plug-ins. It's not in the XMP either. You're stuffed - unless you're resourceful enough to reverse engineer chunks of the plug-in. Assuming that I encrypted my plug-in's code, that means you're going to have to dig around the SQL to figure out my plug-in's ID and its field names. Only then can you create a plug-in to rescue your custom data. And you've got to hope to hell that my plug-in didn't encrypt or obscure the values you entered.
    For me what this shows is
    1) You're taking a big risk if you store valuable custom metadata - if you can't sort it out yourself, should you do it?
    2) You should ensure any plug-in with custom metadata stores its field definitions in unencrypted files
    3) The All Plug-in Metadata panel needs to show all plug-in metadata
    4) The SDK should allow you to get custom metadata from other plug-ins
    4) Custom fields should be mapped to XMP
    Short answer - No.
    John

  • Accessing a dll from classes in different packages

    Hello java community,
    I am new to Java and especially the jni so your help is greatly appreciated.
    I am having trouble accessing a Windows native dll from classes in different packages. I placed the .dll in my ClassPath. I am able to loadLibrary successfully from class X in my 'common' package. However, when I try to access the same .dll from another class Y in package 'notsocommon'. I get an unsatisfied link error. I changed the X.h file to include common in the function definition (eg. Java_common_X_functionName) and I did the same to the Y.h file (Java_notsocommon_Y_functionName). I am able to work with the dll from the X class but not the Y class. I don't know what I am doing wrong. I am very new to Java, so any help is appreciated.
    Thank you.

    I apologize to everyone for posting this. I figured out my mistake, it was in the dll and not in the java. Also using
    javah -jni notsocommon.Y
    creates the correct header file.

  • Error while accessing bean created from servlet

    Hi there
    I have a jsp page form home.jsp where i am collecting user name and password and then directing to a LoginServlet.Here if the user is validated then i create a accMasterBean and store it in Session object which i create here and then redirect to profile.jsp
    In the profile.jsp page i am using bean as follows:--
    <jsp:useBean id="accMasterBean" scope="session" class="AccountMaster">
    <jsp:setProperty name="accMasterBean" property="*"/>
    </jsp:useBean>
    i am fetching the properties of this bean in profile.jsp itself and try to display as shown below:---
    <%=accMasterBean.getAccountNumber() %>
    where accountNumber is a property defined inside AccountMaster class
    but it gives an error as follows :---
    <input type="text" name="emailAddress" value="Exception generated ---javax.servlet.ServletException: Exception thrown on line '205' from page 'D:\\Program Files\\Allaire\\JRun\\servers\\default\\emtech2\\jsp\\members\\profile.jsp'.
    Plz note if remove the above line of fetching the property of bean in profile.jsp page then there is no error
    Hoping to get a reply soon
    Thanking u
    Mumtaz
    The code for LoginServelt is given below
    ====================================
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class LoginServlet extends HttpServlet{
         private Connection conn=null;
         public void init(ServletConfig config)throws ServletException{
              super.init(config);
         public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
         try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              conn=DriverManager.getConnection("jdbc:odbc:emt");
         }catch(ClassNotFoundException e){System.out.println("Error loading database driver");}
         catch(SQLException e){     System.out.println("SQL Exception in Databse driver");     }
         PrintWriter out = null;
         out=response.getWriter();
         response.setContentType("text/html");
         Statement st=null;
         ResultSet rs=null;
         String aN=null;
         String pN=null;
         String accountNumber1=null;
         String pinNumber1=null;
         String alternatePassword1=null;
         String emailAddress1=null;
         String firstName1=null;
         String lastName1=null;
         String address1=null;
         String zipPostalCode1=null;
         String city1=null;
         String state1=null;
         String country1=null;
         String companyName1=null;
         String title1=null;
         String homePhone1=null;
         String workPhone1=null;
         String mobilePhone1=null;
         String pager1=null;
         String faxNo1=null;
         String website1=null;
                        //Date dob;
         String dateOfBirth1=null;
         String gender1=null;
         String securityStatus1=null;
                        //Date doreg;
         String dateOfRegistration1=null;
         int noOfAccounts1=0;
         int noOfAttempts1=0;
         String remarks1=null;
         try{
              aN=request.getParameter("accountNumber");
              pN=request.getParameter("pinNumber");
              st=conn.createStatement(); // creating a statement to execute
              rs=st.executeQuery("SELECT * FROM ACCOUNT_MASTER where AccountNumber=\'" + aN + "\' and PinNumber= \'"+pN +"\' ;");
              while (rs.next())
                        accountNumber1=rs.getString("AccountNumber");
                        pinNumber1=rs.getString("PinNumber");
                                                           //alternatePassword1=rs.getString("alternatePassword");
                        emailAddress1=rs.getString("EmailAddress");
                        firstName1=rs.getString("FirstName");
                        lastName1=rs.getString("LastName");
                        address1=rs.getString("Address");
                        zipPostalCode1=rs.getString("ZipPostalCode");
                        city1=rs.getString("City");
                        state1=rs.getString("State");
                        country1=rs.getString("Country");
                        companyName1=rs.getString("CompanyName");
                        title1=rs.getString("Title");
                        homePhone1=rs.getString("HomePhone");
                        workPhone1=rs.getString("WorkPhone");
                        mobilePhone1=rs.getString("MobilePhone");
                        pager1=rs.getString("Pager");
                        faxNo1=rs.getString("FaxNo");
                        website1=rs.getString("WebSite");
                        gender1=rs.getString("Gender");
                        break ;
         // closing the connection
         rs=null;
         st=null;
         conn.close();
    if((accountNumber1.equals(aN))&&(pinNumber1.equals(pN))){
         // create all beans address and userprofile
         HttpSession session=request.getSession();// creating the session
         AccountMaster accMasterBean=new AccountMaster();
         accMasterBean.setAccountNumber(accountNumber1);
         accMasterBean.setPinNumber(pinNumber1);
         accMasterBean.setEmailAddress(emailAddress1);
         accMasterBean.setFirstName(firstName1);
         accMasterBean.setLastName(lastName1);
         accMasterBean.setAddress(address1);
         accMasterBean.setZipPostalCode(zipPostalCode1);
         accMasterBean.setCity(city1);
         accMasterBean.setState(state1);
         accMasterBean.setCountry(country1);
         accMasterBean.setCompanyName(companyName1);
         accMasterBean.setTitle(title1);
         accMasterBean.setHomePhone(homePhone1);
         accMasterBean.setMobilePhone(mobilePhone1);
         accMasterBean.setWorkPhone(workPhone1);
         accMasterBean.setPager(pager1);
         accMasterBean.setFaxNo(faxNo1);
         accMasterBean.setWebsite(website1);
         accMasterBean.setGender(gender1);
    session.setAttribute("accMasterBean",accMasterBean);// setting the account bean in the session attribute
         getServletConfig().getServletContext().getRequestDispatcher("/jsp/members/profile.jsp").forward(request,response);
    }else{
         // do some processing for account field and pasword field not set and return back to main page
         getServletConfig().getServletContext().getRequestDispatcher("/jsp/signup.jsp").forward(request,response);
    }// end of try
    catch(SQLException e){out.println("SQL Exception generated in LoginServlet---"+e);}
    catch(Exception e1){ out.println("Exception generated in LoginServlet---" + e1);}
    finally{
    try{
         if(conn!=null) conn=null;
         if (rs!=null) rs=null;
         if(st!=null) st=null;
    }catch(Exception e){out.println("Exception closing database connections "+e);}
    } // end of doPost
         public void destroy(){
              try {
                   if(conn!=null) conn=null;
         catch (Exception e) { System.out.println("Error closing database connection"); }
         public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{ doPost( request, response);}
    }//end of loginservlet
    =======================================

    Hi everyone
    I have got the solution
    Thanks
    Mumtaz

  • Access SSL pages from servlet

    Hi,
    I request your assistance with the following please:
    I have a web application running on tomcat4.1 with mySql, for enrolment.
    It consists of pages :
    1- Welcome page
    2- Personal details part 1
    3 - Personal details part 2
    4 - Authorize to save to database
    Page 1 goes to a servlet that sets beans etc..
    I need to then proceed to page 2->3->4 with an SSL protocol. I have purchased a certificate and the hosting company has confirmed that it is installed.
    I would welcome some direction on how to modify the code from the following :
    theURL="page2.jsp";
    RequestDispatcher dispatcher=request.getRequestDispatcher(theURL);
    dispatcher.forward(request, response);
    to get to page 2 within an SSL layer.
    Your advice will be greatly appreciated.
    Thank you.

    Found the solution.
    In the doGet method add:
    SessionBean1 sessionBean1 = (SessionBean1) req.getSession().getAttribute("SessionBean1");       

  • UnsatisfiedLinkError - Trying to access a DLL from Java

    I am trying to use the Java Native Interface (JNI) to run some C++ code from Java. I tried a simple test program to teach myself that, and it worked perfectly. However, now that I'm tackling a bigger project (A data acquisition program), I get an UnsatisfiedLinkError in the line that calls the function from the DLL.
    Here is the stacktrace: Exception in thread "AWT-EventQueue-0" java.lang.Error: java.lang.reflect.Invoca
    tionTargetException
            at org.jdesktop.application.ApplicationAction.actionFailed(ApplicationAc
    tion.java:859)
            at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(App
    licationAction.java:665)
            at org.jdesktop.application.ApplicationAction.actionPerformed(Applicatio
    nAction.java:698)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:19
    95)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6263)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6028)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574
            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:2475)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.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.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(App
    licationAction.java:662)
            ... 26 more
    Caused by: java.lang.UnsatisfiedLinkError: fileiotest.dllinterface.startget()V
            at fileiotest.dllinterface.startget(Native Method)
            at fileiotest.dllinterface.start_daq(dllinterface.java:26)
            at fileiotest.FileIOTestView.startrun(FileIOTestView.java:680)
            ... 31 moreI have made sure that the DLL is in the classpath, using both the -classpath tag and by setting the PATH variable. Is something wrong with my DLL itself, perhaps?

    Yes, I have.
    I didn't include the code yet because I thought if someone had similar trouble, there might be something obvious I am overlooking and they wouldn't even need to see the code. I can provide it, however.
    This is the C++ DLL
    // consoledaq.cpp : Defines the entry point for the console application.
    #include <windows.h>                    /* Compiler's include files's */
    #include <string.h>                  
    #include <stdio.h>
    #include "cbw.h"
    #include "stdafx.h"
    #include "dllinterface.h"
    #include "jni.h" //can copy or give full path
    #include <math.h>
    BOOL APIENTRY DllMain( HANDLE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
        return TRUE;
    #define BOARD_NUM      0                /* Number of A/D board as defined with InstaCal */
    #define BUF_SIZE       10048            /* Size of buffer */
    #define NUM_SECS       10                /* Number of secs to collect data */
    #define ADRANGE        BIP5VOLTS        /* A/D voltage range */
    #define TIMER_NUM      1                /* Windows timer used by this program */
    static HGLOBAL  MemHandle32;       
    /* Variables for AinScan */
    static unsigned short *ADValues;    /* Win32 pointer to A/D buffer */
    static HGLOBAL   ADMemHandle;
    static short     ADCurStatus;       /* Current status for D/A scan */
    static long      ADCurCount;        /* Current count for A/D scan  */
    static long      ADCurIndex;        /* Current index for A/D scan  */
    int              ADOptions;
    long       Count, Rate;
    float      Voltage, Voltage2;
    unsigned short CurValue, CurValue2;
    JNIEXPORT void JNICALL
    Java_daq_startget(JNIEnv *env, jobject obj)
         cbErrHandling (PRINTALL, STOPALL);  /* Set library's error handling */
         ADCurStatus = RUNNING;
         ADCurIndex = 0l;
         ADCurCount = 0l;
         /* Allocate A/D Windows buffer */
         ADMemHandle = cbWinBufAlloc ((long)BUF_SIZE);
         /* Allocate a local WIN32 buffer to hold A/D Data */
         MemHandle32 = GlobalAlloc(GMEM_FIXED | GMEM_DDESHARE, BUF_SIZE *sizeof(short));
         /* Get a 32-bit pointer to the A/D WIN32 buffer */
         ADValues = (unsigned short *)GlobalLock(MemHandle32);
         /* Start up background A/D scan */
         Count = BUF_SIZE;
         Rate = BUF_SIZE / (NUM_SECS * 2);
         ADOptions = BACKGROUND | CONTINUOUS;
         cbAInScan (BOARD_NUM, 0, 1, Count, &Rate, ADRANGE, ADMemHandle, ADOptions);
    JNIEXPORT void JNICALL
    Java_daq_stopget(JNIEnv *env, jobject obj)
         cbStopBackground(BOARD_NUM, AIFUNCTION);  /* Stop A/D subsystem background scan */
         if (ADMemHandle)                 
              cbWinBufFree (ADMemHandle);   /* Free allocated memory */
         if (MemHandle32)
              GlobalFree (MemHandle32);
    JNIEXPORT jfloatArray JNICALL
    Java_daq_getpoint(JNIEnv *env, jobject obj)
         jfloatArray theArray;
         if (ADCurIndex >= 0)
              /* Copy Data from memory to 32 bit memory buffer */
              cbWinBufToArray(ADMemHandle, &ADValues[ADCurIndex], ADCurIndex ,2);
              CurValue = ADValues[ADCurIndex];
              CurValue2 = ADValues[(ADCurIndex + 1)];
         else
              CurValue = 0;
              CurValue2 = 0;
         jfloat tmp[2];
         theArray =  env->NewFloatArray(2);
         cbToEngUnits(BOARD_NUM,ADRANGE,CurValue,&Voltage);                      
         cbToEngUnits(BOARD_NUM,ADRANGE,CurValue2,&Voltage2);
         tmp[0] = Voltage;
         tmp[1] = Voltage2;
         env->SetFloatArrayRegion(theArray, 0, 2, tmp);
         return theArray;
    }And this is the Java class:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package fileiotest;
    * @author Owner
    public class dllinterface {
        public native void startget();
        public native float[] getpoint();
        public native void stopget();
        static {
         System.loadLibrary("daqdll");//This is firstJNI.DLL
         /*if generated by borland
         System.loadLibrary("firstjni");//This is firstjni.dll
        public static void start_daq()
            dllinterface DI=new dllinterface();
            DI.startget();
        public static void stop_daq()
            dllinterface DI=new dllinterface();
            DI.stopget();
        public static float[] get_data_point()
          dllinterface DI=new dllinterface();
          float newtempfloat[];
          newtempfloat = DI.getpoint();
          return newtempfloat;
    }

  • Help please! Problem accessing db connections from servlets

    Hi all,
    I am creating a web application using MVC architecture using jsp,servlets and beans.
    I have created a login.jsp which accesses the LoginHandlerServlet.class.
    in login.jsp there are two fields. One is username and one is password. When fields are filled and submitted it redirects it to LoginHandlerServlet. Now in the servlet it calls a passwordBean which in turn calls a connectionBean which gives the connection to passwordBean and passwordBean checks the username and password and returns the result to servlet.
    Now when I run this application through tomcat. I am getting a error
    Error : oracle:jdbc:Driver:OracleDriver
    But when I append a main method in passwordBean which calls the corresponding method my driver gets initialised and I get the perfect output.
    Please let me know what is wrong with this. Thanking you all in advance.
    Regards,

    Hi All,
    This is the error I am getting :
    SQLError :oracle.jdbc.driver.OracleDriver
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1428)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at com.ge.med.digit.egsnos.model.JDCConnectionDriver.<init>(JDCConnectionDriver.java:27)
    at com.ge.med.digit.egsnos.model.connectionBean.<init>(connectionBean.java:48)
    at com.ge.med.digit.egsnos.model.passwordBean.defineUser(passwordBean.java:61)
    at com.ge.med.digit.egsnos.servlets.loginHandlerServlet.doPost(loginHandlerServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:
    643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:
    643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:
    643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:
    641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:
    641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:
    643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:38
    0)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
    Thanks

  • Accessing 2 DDLs from an App

    Hi,
    I am accessing 2 DLLs from my app.
    In one DLL i am defining an interface to make a DBConnection using
    getConnection method and the other DLL has the interface
    UpdateDB() which updates the database.
    My app uses these two dlls to perform DBConnection first followed
    by UpdateDB.
    I like to know if this works, if so can some one point me to a location
    where i can find something like this.
    Please help.
    Regards
    Venkat

    You wont get any api for directly accessing Servlet application objects from any ejb. I dont think MDB either solves your problem directly. Indirectly you can place a request to some servlet (should be there for each JVM and web application ) and update your application scope variable. I would suggest you to cache the data in database if the size of cache is large. otherwise any open caching tools may help you.

  • How to access Custom controller

    Hi all,
    How can i access custom controller objects in my other controllers.Can i call custom controller objects from component controller .

    Hi,
    I hope you mean the Custom Controller the same way we understand as defined here
    [http://wiki.sdn.sap.com/wiki/display/WDABAP/Introductiontocontrollers|http://wiki.sdn.sap.com/wiki/display/WDABAP/Introductiontocontrollers]
    To access custom controller from the component controller you have to do the following.
    1. Component controller->properties->use insert button to select the custom controller.
    2. Use the code generator (CTRL+F7) -second tab(general)->method call in used controller->select your custom controller->method.
    This will generate code like this
    DATA lo_zzsbn_cust_cc1 TYPE REF TO ig_zzsbn_cust_cc1 .
    lo_zzsbn_cust_cc1 =   wd_this->get_zzsbn_cust_cc1_ctr( ).
      lo_zzsbn_cust_cc1->test(

  • How to access "Alternative Realm" or "Custom Realm" from components like Servlet ?

    Hello,
    Says if I have alternative realm or my custom realm which implement
    "ManageableRealm" interface. How can I access the realm from other
    component, like Servlet or EJB in same WLS ? I tried using code like this
    BasicRealm realm =
    Realm.getRealm("XmlRealm","weblogic","myclass.DebugRealm");
    if (realm != null) {
    Class realmClass = realm.getClass();
    out.println("Realm is " + realmClass.getName());
    Which "myclass.DebugRealm" is classname of my own realm. This realm works
    fine when using for authentication and authorization. But when I run this
    code on servlet, it seems that it doesn't return the realm it created when
    starting WLS, I mean the one that served authentication and authorization.
    But it create a new instance of this class (I knew it 'cos I put debug
    message in its constructor). So how can I get reference to the realm
    instance which is created when starting WLS ?
    Thank you in an advance,
    Siros

    Hello again,
    Sorry to say that now I've got the way. I post here again for someone who
    may face that same problem.
    So strange that, I just changed the realm name in below code to "custom" and
    then it works !! My realm is extended from "AbstractListableRealm" class and
    I think I named my realm as "XmlRealm" in it constructor by call
    super("XmlRealm");
    But seems like its "getName()" method always return "custom", so in servlet
    code, it' rather be.
    BasicRealm realm = Realm.getRealm("custom");
    if (realm != null) {
    Class realmClass = realm.getClass();
    out.println("Realm is " + realmClass.getName());
    This works fine and no instance of realm is created. Anyway I saw that
    constructor of "AbstractListableRealm" take String argument for "name" of
    the realm. So why it's always "custom" ???
    Comments are welcome,
    Siros
    "Siros Supavita" <[email protected]> wrote in message
    news:[email protected]..
    Hello,
    Says if I have alternative realm or my custom realm which implement
    "ManageableRealm" interface. How can I access the realm from other
    component, like Servlet or EJB in same WLS ? I tried using code like this
    BasicRealm realm =
    Realm.getRealm("XmlRealm","weblogic","myclass.DebugRealm");
    if (realm != null) {
    Class realmClass = realm.getClass();
    out.println("Realm is " + realmClass.getName());
    Which "myclass.DebugRealm" is classname of my own realm. This realm works
    fine when using for authentication and authorization. But when I run this
    code on servlet, it seems that it doesn't return the realm it created when
    starting WLS, I mean the one that served authentication and authorization.
    But it create a new instance of this class (I knew it 'cos I put debug
    message in its constructor). So how can I get reference to the realm
    instance which is created when starting WLS ?
    Thank you in an advance,
    Siros

Maybe you are looking for