Calling JNI from within a ejb

Hi,
I'm trying to call a native method from a EJBean class,using iPlanet App Server, after deployment, when i run, I'm getting the following error,
"com.netscape.server.eb.UncheckedException: java.lang.Error thrown by impl nextgensecurity.NgtnSecurityBean@1ade762, err = java.lang.UnsatisfiedLinkError: validateinHSM "
But the same thing is working when tried with a simple java class,
can any one help regarding this ASAP,
Thanx in advance
Kiran

Hi Joe,
Thanks a lot for ur reply,
But the LD_LIBRARY PATH is set to the user that runs the App Server, Since it is throwing a UnsatisfiedLinkError, there must be a problem with the link only(i.e calling native method).
The flow of data is as follows
1 A method from ejb calls another java method in an other java class which is in the same jar file,passing the actual arguments.
2 That java method calls the Native methos residing in the same class file
3 The Native mentod calls a c function as usual
My ejb is working fine up to the Native Method call, at this point it is throwing an error
All my java files are in a package, and my .h file contains package name in the prototype of c function
If you get any ideas please mail me ASAP
ThanQ
Kiran

Similar Messages

  • Is it allowed to make a rmi call from within an ejb??

    Hello,
    Am I allowed to make a rmi call from within an ejb such as:
    String host = "localhost";
    RemoteObject ro = (RemoteObject) Naming.lookup("rmi://"+host+"/MonServeur");
    ro.myMethod();
    package pack;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    public class MyRemoteObject extends UnicastRemoteObject implements RemoteObject {
        public MyRemoteObject() throws RemoteException {
        public void myMethod() throws RemoteException {
            System.out.println("toto");
        public static void main(String[] args) {
            try {
                RemoteObject ro = new MyRemoteObject();
                Naming.rebind("MonServeur", ro);
            } catch (Exception ex) {
                ex.printStackTrace();
    }Is it allowed by the spec?
    Is it good design?
    Thanks in advance,
    Julien Martin.

    Allowed - yes
    Good design - no, in my opinion.

  • Get URL from within a Ejb-Container

    Hi all,
    I try to realize a WD-Application with Hibernate ORM. Now it seems , that from within the Ejb the hibnerate.cfg.xml couldn't be found.
    No I try to read the URL from hibernate.cfg.xml. There I did some test with the getResource()-Function. At least I managed to get a URL from a zip-archive, but I'm not able to found the URL from something inside the archive, <b>and my configuration is in an archive!!!</b>
    See the following tests:
      URL myurl11 = cl.getClass().getResource("/"); //works
      URL myurl12 = cl.getResource("/"); //works not! (without getClass())
      URL myurl2 = cl.getClass().getResource("/version.txt"); //works
      URL myurl3 = cl.getClass().getResource("version.txt");//works not (relativ)
      URL myurl4 = cl.getClass().getResource("/apps/sap.com/dc~oracle~ear/src/java/src.zip");//works
      URL myurl5 = cl.getClass().getResource("/apps/sap.com/dc/oracle/ear/src/java/src.zip");//works not
      URL myurl6 = cl.getClass().getResource("/apps/sap.com/dc~oracle~ear/src/java/src.zip/de/pa/ejb/systeme/SystemeDao.java");//works not
      URL myurl7 = cl.getClass().getResource("/apps/sap.com/dc~oracle~ear/src/java/src.zip/de.pa.ejb.systeme/SystemeDao.java");//works not
      URL myurl8 = cl.getClass().getResource("/apps/sap.com/dc~oracle~ear/src/java/src.zip/de.pa.ejb.systeme.SystemeDao.java");//works not 
    As you can see with "myurl14" it works for a zip-file but not futher. How can I get Into an archive? Or even adress things relative?
    Can anybody help me?
    Thanks
    Richard

    Hi Joe,
    Thanks a lot for ur reply,
    But the LD_LIBRARY PATH is set to the user that runs the App Server, Since it is throwing a UnsatisfiedLinkError, there must be a problem with the link only(i.e calling native method).
    The flow of data is as follows
    1 A method from ejb calls another java method in an other java class which is in the same jar file,passing the actual arguments.
    2 That java method calls the Native methos residing in the same class file
    3 The Native mentod calls a c function as usual
    My ejb is working fine up to the Native Method call, at this point it is throwing an error
    All my java files are in a package, and my .h file contains package name in the prototype of c function
    If you get any ideas please mail me ASAP
    ThanQ
    Kiran

  • How to call methods from within run()

    Seems like this must be a common question, but I cannot for the life of me, find the appropriate topic. So apologies ahead of time if this is a repeat.
    I have code like the following:
    public class MainClass implements Runnable {
    public static void main(String args[]) {
    Thread t = new Thread(new MainClass());
    t.start();
    public void run() {
    if (condition)
    doSomethingIntensive();
    else
    doSomethingElseIntensive();
    System.out.println("I want this to print ONLY AFTER the method call finishes, but I'm printed before either 'Intensive' method call completes.");
    private void doSomethingIntensive() {
    System.out.println("I'm never printed because run() ends before execution gets here.");
    return;
    private void doSomethingElseIntensive() {
    System.out.println("I'm never printed because run() ends before execution gets here.");
    return;
    }Question: how do you call methods from within run() and still have it be sequential execution? It seems that a method call within run() creates a new thread just for the method. BUT, this isn't true, because the Thread.currentThread().getName() names are the same instead run() and the "intensive" methods. So, it's not like I can pause one until the method completes because they're the same thread! (I've tried this.)
    So, moral of the story, is there no breaking down a thread's execution into methods? Does all your thread code have to be within the run() method, even if it's 1000 lines? Seems like this wouldn't be the case, but can't get it to work otherwise.
    Thanks all!!!

    I (think I) understand the basics.. what I'm confused
    about is whether the methods are synced on the class
    type or a class instance?The short answer is; the instance for non-static methods, and the class for static methods, although it would be more accurate to say against the instance of the Class for static methods.
    The locking associated with the "sychronized" keyword is all based around an entity called a "monitor". Whenever a thread wants to enter a synchronized method or block, if it doesn't already "own" the monitor, it will try to take it. If the monitor is owned by another thread, then the current thread will block until the other thread releases the monitor. Once the synchronized block is complete, the monitor is released by the thread that owns it.
    So your question boils down to; where does this monitor come from? Every instance of every Object has a monitor associated with it, and any synchronized method or synchonized block is going to take the monitor associated with the instance. The following:
      synchronized void myMethod() {...is equivalent to:
      void myMethod() {
        synchronized(this) {
      ...Keep in mind, though, that every Class has an instance too. You can call "this.getClass()" to get that instance, or you can get the instance for a specific class, say String, with "String.class". Whenever you declare a static method as synchronized, or put a synchronized block inside a static method, the monitor taken will be the one associated with the instance of the class in which the method was declared. In other words this:
      public class Foo {
        synchronized static void myMethod() {...is equivalent to:
      public class Foo{
        static void myMethod() {
          synchronized(Foo.class) {...The problem here is that the instance of the Foo class is being locked. If we declare a subclass of Foo, and then declare a synchronized static method in the subclass, it will lock on the subclass and not on Foo. This is OK, but you have to be aware of it. If you try to declare a static resource of some sort inside Foo, it's best to make it private instead of protected, because subclasses can't really lock on the parent class (well, at least, not without doing something ugly like "synchronized(Foo.class)", which isn't terribly maintainable).
    Doing something like "synchronized(this.getClass())" is a really bad idea. Each subclass is going to take a different monitor, so you can have as many threads in your synchronized block as you have subclasses, and I can't think of a time I'd want that.
    There's also another, equivalent aproach you can take, if this makes more sense to you:
      static final Object lock = new Object();
      void myMethod() {
        synchronized(lock) {
          // Stuff in here is synchronized against the lock's monitor
      }This will take the monitor of the instance referenced by "lock". Since lock is a static variable, only one thread at a time will be able to get into myMethod(), even if the threads are calling into different instances.

  • How to configure Outlook 2013 to call direct from within the application without using Lync 2013?

    I have Outlook 2013 running on Windows 7 Pro 64-Bit with Lync 2013 (Office 365 Pro). We are using a 3rd party TAPI app from FortiVoice. WE would like to be able to place calls directly from
    within Outlook either by selecting a telephone number within an email and/or via the PEOPLE (Contacts) area.
    What guidelines should we use to enable this feature and not have Lync 2013 intercepting the process i.e. let OUTLOOK handle placing calls?
    Thanks in advance for any feedback provided.

    Hi,
    There seems no solution for this issue so far.
    Here is a fix for older versions of Outlook, maybe worth a try.
    http://support.microsoft.com/kb/959625/en-us
    However, if it doesn’t work, please try Malte’s reply as the workaround in the following thread. See:
    http://social.technet.microsoft.com/Forums/office/en-US/3946f1bb-cc3d-41b6-ab9c-092d62d024d1/outlook-2013-tapi-calling-with-lync-installed?forum=officesetupdeploy
    Thanks.
    Steve Fan
    TechNet Community Support
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Finding the client ip adress from within and EJB method

    Does anyone know of a way to find out the address (or any significant information) about the caller of a remote method on an EJB from within the method without sending the information as a parameter?
    This info has to be available at some level for security to work properly, doesn't it?

    Hey did you find answer for this problem. i am also looking for same info

  • Problem calling servlet from within a jsp

    I have a servlet which obtains images for a page
    http://bychance.ca/servlet/ImageServlet?PhotoId=AJ-LA-4008
    I use the servlet from within a jsp
    <img src="servlet/ImageServlet?PhotoId=<%=rs.getObject("ID")%>" border="0">
    for some reason it does not work, the images are never called. I have another servlet which is called the same way and it works fine
    <img src="servlet/ImageServletLarge?PhotoId=<%=strPhotoId%>" border="0">
    Thank you all for your time

    this is my servlet code. Like I said it works fine in another servlet
    rs.next();
    byte[] bytearray = new byte[rs.getInt(1)];
    int size=0;
    InputStream sImage;
    sImage = rs.getBinaryStream(2);
    response.reset();
    response.setContentType("image/jpeg");
    while((size=sImage.read(bytearray))!= -1 )
    response.getOutputStream().write(bytearray,0,size);
    response.flushBuffer();
    sImage.close();

  • Problem Calling JNI from a servlet

    Hi guys,
    How can I trace a C program called from a servlet using JNI ? The problem is a cant see the standard output of the C program because I call it from an applet, not from the console. I would preffer not to generate an error output from the C program, only see the text output this program outputs to the console.
    Thanks.

    Have you tried adding a pipe to the calling command?
    For example:
    Process p = Runtime.getRuntime().exec("myutil.exe > output.txt");
    p.waitFor();
    Once the program has finished, the output from the myutil.exe can be found in the file output.txt.
    HTH

  • Where to log after calling BSSV from within C BSFN?

    I called a BSSV object from within a C BSFN. This BSSV object will return E1MessageList. I want to know where can I log these E1 Messages from within the C BSFN? Any documentation about this is greatly appreciated.
    I'm using E900 and JDeveloper 11g.
    Thanks

    Hello,
    Saw your query and don't know if this is still an issue for you ?
    You are calling a BSSV from within a C BSFN meaning you are consuming from that BSSV an external web service.
    The E1MessageList generated in the BSSV you can not return as such to the calling BSFN.
    I would suggest you simply create a new logging BSFN suitable for your specific purposes with a DSTR reflecting the parameters of the E1MessageList object such as ErrorAlphaDescription, ErrorDataDictionaryItem, ErrorFileName, ErrorGlossaryText, ErrorLevel, ErrorSourceLineNumber, etc...
    Just before the finishInternalMethod you can read through the E1MessageList array and parse out the data. For every element found you call your custom logging BSFN which in turn can then write this data to a file or whatever.
    Hope this helps!
    Brgds,
    Jan Hox

  • Help!How can I find the name of a calling procedure from within a procedure/function?

    Is there anyway to find out the name of calling procedure(database) from within a database stored procedure/function? This is required for creating an auditing module.
    Thanks,
    Abraham
    ===========
    email:[email protected]

    You can use this query to get the procedure names that are calling your procedure.
    SELECT name FROM all_Dependencies
    WHERE upper(referenced_name) = 'YOUR_PROC_NAME'
    In your procedure, you can get these values into a cursor and then use them one by one.
    Hope this would help.
    Faheem

  • Is it possible to call msync from within an EVB Application?

    Does anyone know how to run mSync from within an embedded visual basic application?
    Some sample code or documentation would be particularly welcome.

    The following is taken from the Windows CE documentation that ships with 9i Lite:
    Table 3-16 ISyncOption Public Properties
    username -> Name of the user.
    password -> User password.
    syncParam -> Synchronization preferences. See Section 3.7.2.4, "COM Interface SyncParam Settings" for more information.
    transportType -> Type of transport to use. Only "HTTP" type is supported currently. The default value is HTTP.
    transportParam Parameters of the transport. See Section 3.7.1.5, "Java Interface TransportParam Parameters" for more information.
    syncParam documentation is (also taken from the same document):
    The syncParam is a string that allows support parameters to be specified to the synchronization session. The string is constructed of name-and-value pairs, for example:
    "name=value;name2=value2;name3=value3, ...;"
    The names are not case sensitive, but the values are. The field names which can be used are listed in Table 3-17.
    Table 3-17 COM Interface SyncParam Settings
    "reset" -> N/A Clear all entries in the environment before applying any remaining settings.
    "security" -> "SSL" "CAST5" Use the appropriate selection to choose either SSL or CAST5 stream encryption.
    "pushonly" -> N/A Use this setting to upload changes from the client to the server only, download is not allowed.This is useful when data transfer is one way, client to server.
    "noapps" -> N/A Do not download any new or updated applications. This is useful when synchronizing over a slow connection or on a slow network.
    "syncDirection" -> "SendOnly" "ReceiveOnly" "SendOnly" is the same as "pushonly". "RecieveOnly" allows no changes to be posted to the server.
    "noNewPubs" -> N/A This setting prevents any new publications created since the last synchronization from being sent, and only synchronizes data from the current publications.
    "tableFlag [Publication.Item]" "enable" "disable" The "enable" setting allows [Publication.Item] to be synchronized, disable prevents synchronization.
    "fullrefresh" -> N/A Forces a complete refresh.
    "clientDBMode" -> "EMBEDDED" "CLIENT" If set to "EMBEDDED", access to the database is by conventional ODBC, if set to "CLIENT" access is by multi-client ODBC.
    Example 1
    The first example enables SSL security and disables application deployment for the current synchronization session:
    "security=SSL;noapps;"

  • Calling JNI from my servlet

    Hai,
    I am using a servlet and I am calling the JNI method, but it is throwing an error like
    "java.lang.UnsatisfiedLinkError: check_file". (check_file is my JNI method.)
    I have checked the included header file name and function name, they are proper and correct. Can any one tell me some solution forthis problem. Thanks in advance.
    Bala

    Hai ,
    I found the solution for this query from jguru forum. I thought it will be helpful for persons like me, so i am posting it here. Consider the flg. example.
    All programs are under package "com.myprogram"
    MyServlet.java (My servlet program)
    GetInfo.java (My Java link program)
    GetInfofromCLib.c(My JNI interface program)
    MyServlet.java ---> Servlet that calls the get_info() native method of GetInfo.java
    ******GetInfo.java*****
    public class GetInfo
    public native void get_info();
    static{
    System.load("/usr/home/com/myprogram/mylib.so");
    so now if u create "javah -jni GetInfo"
    it will create the function name like
    Java_get_1info(JNIEnv*, jobject);
    but we need to rewrite this function name, so that it is representing the total path as
    Java_com_myprogram_get_1nfo(....);
    And also in the GetInfofromCLib.c we need to refer this way. Hope this will help others......
    Thanks,
    Bala....

  • Calling JNI from a java sp.

    I read in 8.1.5 docs that JNI is not enabled in the Oracle JVM (for customers)
    Still the case in in 8.1.7?
    Has anyone (Brian?) had success when making RMI calls from the Oracle JVM?
    Thanks,
    Matt
    [email protected]

    Well, the problem with JNI, is a difficult issue. See, the C code would have to be linked with the Oracle executable itself and if not functionning properly (er, say core-dumping, or referencing random places in memory) could corrupt the quality of your precious data in the database. (For example, bogus code could overwrite data in the buffer caches). So JNI is indeed here and used in-house for most natives but is not available for customers. Sigh.
    Now, doing an RMI callout to a standalone RMI server that uses JNI is a GOOD IDEA. It's functional and recommended.
    The issues about RMI and scalability is when you want to use oracle itself as an RMI server. Not when you want to do RMI callouts.
    Hope this helps,
    matthieu

  • Call Oracle from within MS Word

    Using VBA macro within MS Word to extract data from Oracle DB 8.1.5. I get "Unable to open data source". What values for datasource name?

    You can leave DSN Name blank. thanks.
    null

  • Calling a java application from within another class

    I have written a working java application that accepts command line parameters through public static void main(String[] args) {} method.
    I'm using webMethods and I need to call myapplication from within a java class created in webMethods.
    I know I have to extend my application class within the webMethods class but I do not understand how to pass the parameters.
    What would the syntax look like?
    Thanks in advance!

    why do you want to call the second class by its main method ??
    Why not have another static method with a meaningfull name and well defined parameters ?
    main is used by the jvm as an entry point in your app. it is not really meant for two java applications to communicate with each other but main and the code is not really readable.
    Have a look at his sample
    double myBalance = Account.getBalance(myAccountId);
    here Account is a class with a static method getBalance which return the balance of the account id you passed.
    and now see this one, here Account has a main method which is implemented to call getBalance.
    String[] args = new String[1];
    args[0] = myAccountId;
    Account.main(args);
    the problem with the code above is
    main doesn't return anything so calling it does do much good. two the code is highly unreadable because no one know what does the main do... unlike the sample before this one where the function name getBalance clearly told what is the function doing without any additional comments.
    hope this helps.... let me know if you need any additional help.
    regards,
    Abhishek.

Maybe you are looking for

  • How do you troubleshoot launch agents?

    I work for an educational instution and have been tasked with writing a process that will map all of a users networkshares/homeshares when they login to their Mac's. One big sticking point we've had in the past is that all our shares are DFS based. W

  • MY BURNED CD'S SONGS DIFFERENT VOLUMES/BASS

    I looked around and could not find an answer to this. Why, when I burn a CD with various artists and genera is one song quiet and the next song loud with a bass so bad I have to turn it OFF in my car? This is really annoying. I tried different things

  • XI content certification - ABAP proxies

    Hi, can we use <b>ABAP proxies</b> in XI content certification ? I mean develop an ABAP proxy in IR that will be generated in ERP and just supply the code for it ? thank you, Regards, michal

  • "could not open socket" error

    Hello: I am following the book "Adobe Dreamweaver CS5 with PHP" by David Powers (an excellent book I might add) and am currently going over chapter 8. (Zending email). I have completed the section concerning processing of a simple user feedback scrip

  • Shutter issues with EOS Rebel T3 -doesn't stick-just does not take the picture!!

    Help!  I've watched videos on taking camera apart/dumping alcohol into battery compartment, etc...the clarity is not there if I switch from view finder to screen. WHY?!  The shutter button WILL NOT take a picture no matter what setting, etc...it focu