WDP calling EJB and passing objects of classes from Java project

Hi.
We have <b>Java</b> project which contains some classes common for all projects (like xxx.Version).
We have <b>EJB</b> project which defines EJB interface using these common classes (like getVersion(String,int): xxx.Version and getCurrency(String,xxx.Version,int):xxx.Currency ).
We have <b>Web Dynpro</b> project which calls EJB:
1. Lookup is successful
2. call to getVersion is successful
3. call to getCurrency fails with <b>NoSuchMethodException</b>:
xxx.XXXObjectImpl0.getCurrency(java.lang.String, xxx.Version, int)
     at java.lang.Class.getMethod(Class.java:986)
     at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.invokeInternal(LocalInvocationHandler.java:51)
     at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:53)
     at $Proxy346.getCurrency(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
     at $Proxy347.getCurrency(Unknown Source)
     at xxx.XXX.getCurrencyWrapper(XXXXX.java:24)
How can I set dependencies to get this running?
Thanks to all
       Volker

Hi,
Is it available in the interface you are using..
If the answer is yes.. you might have probably forgotten to deploy the EJBs ear file after making the changes..
Rebuild it.. and deploy the EJB s ear file again..
It will solve the problem.. If that also does not work,it might be a problem with the cache.. restart the server..
It should work now !
Regards
Bharathwaj

Similar Messages

  • Calling a object of class from other class's function with in a package

    Hello Sir,
    I have a package.package have two classes.I want to use object of one class in function of another class of this same package.
    Like that:
    one.java
    package co;
    public class one
    private String aa="Vijay";  //something like
    }main.java:
    package co;
    import java.util.Stack;
    public class main extends Stack
    public void show(one obj)
    push(obj);
    public static void main(String args[])
    main oo=new main();
    }when I compile main class, Its not compile.
    Its give error.can not resolve symbol:
    symbol: class one
    location: class co.main
    public void show(one obj)
                              ^Please help How that compile "Calling a object of class from other class's function with in a package" beacuse I want to use this funda in an application

    kumar.vijaydahiya wrote:
    .It is set in environment variable.path=C:\bea\jdk141_02\bin;.,C:\oraclexe\app\oracle\product\10.2.0\server\bin;. command is:
    c:\Core\co\javac one.javaIts compiled already.
    c:\Core\co\javac main.javaBut it give error.
    Both java classes in co package.Okay, open a command prompt and execute these two commands:
    // to compile both classes:
    javac -cp c:\Core c:\Core\co\*.java
    // to run your main-class:
    java -cp c:\Core co.main

  • Calling native Objective C code from Java Script

    Hi,
    I want to call native objective C code from Java script.
    I know one way by using : webView:shouldStartLoadWithRequest:navigationType
    Is there another way of doing same?
    Thanks,
    Ganesh Pisal
    Vavni Inc

    Are any of those threads calling java code? If yes then are you calling the Attach method?

  • Using ExecutorService class from java.util.concurrent package

    Dear java programmers,
    I have a question regarding the ExecutorService class from java.util.concurrent package.
    I want to parse hundreds of files and for this purpose I'm implementing a thread pool. The way I use the ExecutorService class is summarized below:
    ExecutorService executor = Executors.newFixedThreadPool(10);
            for (int i = 0; i < 1000; i++){
                System.out.println("Parsing file No "+i);
                executor.submit(new Dock(i));
            executor.shutdown();
            try {
                executor.awaitTermination(30, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();However, the code snippet above creates all the 1000 threads (Dock objects) at once and loads them to the executor, and thus I'm worrying about memory leak. I haven't tested it on 1000 files yet but just on 50 small ones, and even if the program prints out "Parsing file No "+i 50 times at once, it executes normally the threads in the background.
    I guess the write way would be to keep the number of active/idle threads in the executor constant (lets say 20 if the thread pool's size is 10) and submit a new one whenever a thread has been finished or terminated. But for this to happen the program should be notified someway whenever a thread is done. Can anybody help me do that?
    thanks in advance,
    Tom

    Ok I found a feasible solution myself although I'm not sure if this is the optimum.
    Here's what I did:
            ExecutorService executor = Executors.newFixedThreadPool(10);
            Future<String> future0, future1, future2, future3, future4, future5, future6, future7, future8, future9;
            Future[] futureArray = {future0 = null, future1 = null, future2 = null, future3 = null, future4 = null, future5 = null,
            future6 = null, future7 = null, future8 = null, future9 = null};
            for (int i = 0; i < 10; i++){
                futureArray[i] = executor.submit(new Dock(i));
            }I created the ExecutorService object which encapsulates the thread pool and then created 10 Future objects (java.util.concurrent.Future) and added them into an Array.
    For java.util.concurrent.Future and Callable Interface usage refer to:
    [http://www.swingwiki.org/best:use_worker_thread_for_long_operations]
    [http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter10/concurrencyTools.html]
    I used a Future[] Array to make the code neater. So after that I submitted -and in this way filled up- the first 10 threads to the thread pool.
            int i = 9;
            while (i < 1000){
                for (int j = 0; j < 10; j++){
                    if (futureArray[j].isDone() && i < 999){
                        try{
                            i++;
                            futureArray[j] = executor.submit(new Dock(i));
                        } catch (ExecutionException ex) {
                            ex.printStackTrace();
                        } catch (InterruptedException ex) {
                            ex.printStackTrace();
                try {
                    Thread.sleep(100); // wait a while
                } catch(InterruptedException iex) { /* ignore */ }
            executor.shutdown();
            try {
                executor.awaitTermination(60, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();
        }Each of the future[0-9] objects represents a thread in the thread pool. So essentially I'm check which of these 10 threads has been finished (using the java.util.concurrent.Future.isDone() method) and if yes I replenish that empty future[0-9] object with a new one.

  • Calling C Functions in existing DLL's from Java

    Hi Guys ,
    The tutorial in this site talks about creating ur own DLL's and then calling them from Java . I need to call C functions in existing DLL's from Java . How do I go about doing this ? . Any help on this would be much appreciated.
    regards
    murali

    What you are interested in can be done with what's called "shared stubs", from the JNI book (http://java.sun.com/products/jdk/faq/jnifaq.html), although you don't need the book to do it (I didn't).
    The example code will call functions with any number and kind of parameters, but doing that requires some assembly language. They supply working examples for Win32 (Intel architecture) and Solaris (Sparc).
    If you can limit yourself to functions to a single function signature (number and types of parameters), or at least a small set that you know you'll call at compile time, you can modify the example so that the assembly language part isn't needed, just straight C code.
    Then you'll have one C library that you compile and a set of Java classes and you can load arbitrary functions out of arbitrary dynamic libraries. In my case you don't even have to know what the libraries and functions are ahead of time, the user can set that up in a config file.
    You mentioned doing this with Delphi. One thing to watch out for is C versus Pascal (Win32) function calling convention. A good rule of thumb; if it crashes hard, you probably picked the wrong one, try the other. :-)

  • Start and stop the Communication channel from Java Mapping

    How to start and stop the Communication channel from Java Mapping in XI 3.0
    Scenario  PI - > MQ -> Third Party web application 
    Web application is down and then Communication channels are stop manually .  
    We need to automate this process,
    MQ Solution - Trigger will be set in MQ which will be called when web application is stopped
    Trigger will send u201CSTOP u201C message to PI
    How to configure PI scenario to stop different com channels when this message received ?

    check this link: http://help.sap.com/saphelp_nw04/helpdata/EN/45/0c86aab4d14dece10000000a11466f/frameset.htm
    make sure that MQ send http request to PI. i dont think a configuration scenario is required in PI. Only roles should be enabled with proper user provided to MQ team.
    However, for security reasons, you can configure a scenario if you dont want to expose PI infrastructure directly to 3rd parties.

  • Start and Stop a Windows Service From Java

    Is there any way to start and stop a Windows service from Java? The only post I found on it (http://forum.java.sun.com/thread.jspa?threadID=647509) had a link to one of the many aps that allow Java programs to be services, which is not what I am interested in doing.
    I am attempting to get data from performance counters from the Windows Performance Monitor into a Java ap without using JNI. I can get the data from C++ or a .net language pretty easily and was going to create a service that would listen for socket requests and feed back the data. However, I'd like to start and stop that service when my java code starts and stops. Is this possible? Would it make more sense to just use a .exe and Runtime.exec()?

    If it's only to start or stop a service then you could use the net command without any need for JNI.import java.io.*;
    public class MsWinSvc {
        static final String CMD_START = "cmd /c net start \"";
        static final String CMD_STOP = "cmd /c net stop \"";
        public static int startService(String serviceName) throws Exception {
            return execCmd(CMD_START + serviceName + "\"");
        public static int stopService(String serviceName) throws Exception {
            return execCmd(CMD_STOP + serviceName + "\"");
        static int execCmd(String cmdLine) throws Exception {
            Process process = Runtime.getRuntime().exec(cmdLine);
            StreamPumper outPumper = new StreamPumper(process.getInputStream(), System.out);
            StreamPumper errPumper = new StreamPumper(process.getErrorStream(), System.err);
            outPumper.start();
            errPumper.start();
            process.waitFor();
            outPumper.join();
            errPumper.join();
            return process.exitValue();
        static class StreamPumper extends Thread {       
            private InputStream is;
            private PrintStream os;
            public StreamPumper(InputStream is, PrintStream os) {
                this.is = is;
                this.os = os;
            public void run() {
                try {
                    BufferedReader br = new BufferedReader(new InputStreamReader(is));
                    String line;
                    while ((line = br.readLine()) != null)
                        os.println(line);
                catch (Exception e) {
                    e.printStackTrace();
    }Regards

  • What are Crypto Cards, and what are they different from Java Cards?

    Hi,
    I just heard the name 'Crypto Card'. I thought Java Card is the only standard for smart card. Could anyone tell me what are Crypto Cards, and what are they different from Java Cards? Thanks in advance.
    Joey

    Probably any card that offers cryptographic capabilities (crypto coprocessor) could be called "Crypo Card", but likely the term was referred to cards offering a pkcs#11 interface.
    Pkcs#11 is the standard for accessing crypto devices, like tokens, cards, or accelerators. Such a device can be easily accessed for example from your browser to perform cryptographic and digital signature operations.
    A Javacard can operate as a pkcs#11 device in you install on it an applet dealing with the pkcs#11 requests.

  • How to get a method to call the correct passed object in the constructor

    I have 2 constructors for a certain object:
    public class ABC{
    //variables
    private DEF def;
    private GHI ghi;
    public ABC(DEF def){
    this.def = def;
    someMethod();
    public ABC(GHI ghi){
    this.ghi = ghi;
    someMethod();
    }Now, this someMethod() references / calls a method from the 2 classes passed in the constructor say def.getSome() and ghi.getSome().
    Depending on which constructor is used, it should call the respective xxx.getSome(). Do I need to write 2 someMethod()s or is there a way that one method will call the proper xxx.getSome() ?
    Thanks.....

    Hi
    Following the example may be help to you call correct method,
    // Interface QuizMaster
    public interface QuizMaster {
         public String popQuestion();
    // Class StrutsQuizMaster
    public class StrutsQuizMaster implements QuizMaster{
         public String popQuestion() {
              return "Are you new to Struts?";
    // Class SpringQuizMaster
    public class SpringQuizMaster implements QuizMaster{
         public String popQuestion() {
              return "Are you new to Spring?";
    // Class QuizMasterService
    public class QuizMasterService {
         QuizMaster quizMaster;
         public QuizMasterService(SpringQuizMaster quizMaster){
              this.quizMaster = quizMaster;
         public QuizMasterService(StrutsQuizMaster quizMaster){
              this.quizMaster = quizMaster;
         public void askQuestion()
              System.out.println(quizMaster.popQuestion());
    // QuizProgram
    public class QuizProgram {
         public static void main(String[] args) {
              // Option : 1
    // StrutsQuizMaster quizMaster = new StrutsQuizMaster();
    // Option : 2
    SpringQuizMaster quizMaster = new SpringQuizMaster();
              QuizMasterService quizMasterService = new QuizMasterService(quizMaster);                    
              quizMasterService.askQuestion();
    here you can create object of StrutsQuizMaster or SpringQuizMaster and pass into the QuizMasterService object constructor, base on the object correct method will be called.

  • Call the CALL METHOD and CREATE OBJECT

    Hi Friends,
         How to call the CALL METHOD and CALL OBJECT in the se38 edit program.For example for calling the FUNCTION MODULE we can use the pattern in that using the call function we can get the function module in the se38 edit.but in METHOD hoe to call if you explain me in detail it would be very much usefulfor me.
    Thanks,
    Regards,
    Rajendra Kumar

    Hi rajendra,
    its the same way we do. call pattern ..there will be another radiobutton whcich says 'ABAP objects' , give the method name and the class name there.. this will call the method similar to function module..
    we can also write our own classes and methods...
    say..you created your own class c1 and method m1
    then first create the instance of the object..
    data:obj1 type ref to c1.
    create object obj1.
    call method obj1->m1.
    Regards,
    Vidya.

  • How to call routine and pass data to routine in vofm

    Hi Experts,
    I need to update KBETR and KWERT values present in 'Conditions Tab' in Purchase Order (ME21N/ME22N).
    I have created a new customer tab in which we enter amount field and  percentage filed. When user enters some value in this and clicks on 'Conditions Tab', calculation has to be done and the calculated value has to be appeared across a specific condition type.as i am new to abap  i dont know how to create routine and pass data to routine in vofm from customised tab in me21n .
                                                                                                                                                                          Thank's in advance

    Hello Rajendra,
    You can get plenty of forums in SCN related to it. Follow below steps to create VOFM routine.
    Go to VOFM Transaction Code
    1. On the Menu Select required Application i.e Pricing
    2. Enter any Number in between 600 to 999 for Custom Developments.
    3. On entering Pop Screen appears ask for Access Key(We have to remember that Every New Routine needs an Access Key)
    4. Once the Access Key is received we can do modification.
    5. Enter the Routine Number ,description and insert the Access Key
    6. Now the ABAP Editor will open and required code can be copied from Standard SAP Routine and Custom Code Can be developed.
    7. Once the coding is completed we have to Activate the Routine
    8. Select the Routine and Go to Edit – Activate
    9. Ensure that Active check box is ticked upon Activation of the Routine.
    10. Double click on the routine will enter into ABAP Editor, we have to generate the Routine
    11. Go to Program and select Generate
    12.A screen pops up with the related Main Programs  and select all required main programs wherever the Routine is being called.
    13. Once the Routine is Generated and Activated, We need to configure the Routine in the config.
    ** Important SAP note: 156230.
    Check the below document too.
    http://www.scribd.com/doc/35056841/How-to-create-Requirement-Routines
    Regards,
    Thanga

  • Best way to call a function in a generic class from a base class

    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        newTCreated(T t)
    }

    Sorry, I pressed Tab and Enter last time when typing the code so I posted without meaning to
    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        public void newTCreated(T t)
            // add the t to some internal list
        public T getT(int index)
            // get the object from the internal list
    public class BaseClass
        public BaseClass(List<?> list)
            list.newTCreated(this);
    public class SubClass extends BaseClass
        public SubClass(List<SubCass> list)
            super(list);
    }This doesn't compile because of the call to newTCreated in the BaseClass constructor because BaseClass is not necessarily of type T. Is there any way of checking when I call the newTCreated function that the BaseClass is actually of type SubClass? I could either add the call explicitly in each SubClass's constructor or have a function addToList in BaseClass that is called from the BaseClass constructor but overloaded in each subclass but both of those rely on future subclasses doing the same. Or I could change the newTCreated function to take an argument of type BaseClass and then cast it to type T but this doesn't give a compilation error, only a runtime exception.
    It seems like there should be solution but having only recently started writing Generic classes I can't find it. Thanks in advance for any help,
    Tom

  • Expose ADF-BC as ejb and use it in UI from the datacontroller

    Hi Experts.
    Here i am looking forward some experts view and guidelines on this deployment architecture question. Currently i have deploped one ADF Web fusion application which has ADF-BC and web. In that web project datacontroller side i can be able to see the view object instances under each business service. Also the web has some UI bindings too. Now the application is working fine fine on one weblogic instance.
    question1) Can i deploy this above project into two weblogic instances one with ADF-BC model ( if yes how to deploy that alone) and the other web into the another instance. ( If yes can to configure the project)
    question 2) Now can i expose the ADF-BC as ejb and use it in the same way in the web (like drag and drop from the Data controller). ? I tried the option expose the ADF-BC as ejb In this case if the VO instance access methods are not exposed. So how can i access them in the UI? For example, assume if we have 2 view object EmployeeView and DepartmentView in the application module, then after immediately create the AM, the datacontrol shows the view object instances name like EmployeeView1, DepartmentView1 and also in the web we just drag and drop to create appropriate UI. This is fine. Now i create the ejb based on the AM. In the Remote interface i have the
    void removeEntity(Object entityDTO)
    method. If i look at the datacontrol section still the data controls remains same. I think this datacontrol still shows the ADF-BC direct connectivity. If i try to create the new ejb data control which points to the same AM ejb for web, then i couldn't see the above view instance name called EmployeeView1, DepartmentView1, where i can drag and drop in the UI.
    I can only see methods like EJBHome etc.....
    So this means i cannot use the Exposed EJB from the ADF-BC Application Module to drag and drop in UI like the ADF-BC direct unless we explicitly create the view access methods in the interface. Am i correct?
    Or still am i getting the wrong assumption.
    Much appreciated if u point some code to understand this.
    -t

    Thanks for the reply.
    Basically we have found the way to expose the ADFBC as ejb and use it for data binding in the UI. I will update this thread soon about our finding. But now i have an architecture question, can we deploy as 3-tier deployment for ADF-BC using the exposed ejb interface? Because i am worrying we might run into some ADF issue in furture if we move this path. Oracle gurus please share your ideas or thoughts.
    -t

  • USE OF VARRAY and RECORD object vis-a-vis java.sql package

    Hi Geeks,
    I want to pass an array of java objects to a stored procedure and I will use them for table insertion or updation.
    Say I have a table TASK at DataBase end while the same TASK object is there at JAVA end.
    I want to pass an array of Task objects via my stored proc
    Please guide me how shall I use java.sql.Array and java.sql.SQLDataType etc etc. any mechanism in store!..
    Regards,
    Pratap
    London

    Thanks for you help
    I created the package and I get this error this time:
    javax.servlet.ServletException: bean test not found within scope
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:822)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:755)
         org.apache.jsp.login_jsp._jspService(login_jsp.java:68)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:268)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:277)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:223)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • EJBs accessing protected classes from java classloader

    Hello,
    We are facing a problem with classes isolation. I read from this newsgroup that
    to access a package level class from the base classloader from a bean, the supporting
    classes has to be from the same classloader as the bean. Well I think the only
    way we could do that is to have the *Bean.class in the base classloader, which
    is not what's recommended or move the support classes into the bean's classloader,
    which we cannot do.
    The purpose of this mail is to ask: is it a bug from weblogic server? Will it
    be fixed one day? If not, does it mean that it is impossible to isolate classes
    for local access from public classes?
    Thank you, Khiet.

    Thank you for your reply.
    Hope that one day we will not be obliged to have anything in the main classpath.
    :) Khiet.
    Rob Woollen <[email protected]> wrote:
    Tran T. Khiet wrote:
    Hello,
    We are facing a problem with classes isolation. I read from this newsgroupthat
    to access a package level class from the base classloader from a bean,the supporting
    classes has to be from the same classloader as the bean. Well I thinkthe only
    way we could do that is to have the *Bean.class in the base classloader,which
    is not what's recommended or move the support classes into the bean'sclassloader,
    which we cannot do.All correct.
    The purpose of this mail is to ask: is it a bug from weblogic server?No, it's how java classloaders work.
    Will it
    be fixed one day? If not, does it mean that it is impossible to isolateclasses
    for local access from public classes?You can expect that future versions of WLS will allow the user more
    control over classloaders, but for now you'll need public or protected
    access to cross classloaders.
    -- Rob
    Thank you, Khiet.

Maybe you are looking for

  • How do I get wifi to work after updating to ios 8.2?

    I have a iphone 5:  A 1429. wifi was working great with ios 8.1.3. I updated to ios 8.2.... and it says wifi is connected, but internet doesn't work for more than 2 minutes. I can turn it on and off airplane, and I can have up to 2 more minutes of in

  • How can i use embbed version of mysql in java?

    Hi all, How can i create embedded version of mysql in my java application? is it possible to do it in java if yes then how please little hint required thanks in advance

  • Video to ipod question

    i have some south park episodes on my hd and they dont want to transfer on to my ipod does anyone have any suggestions?

  • What's the  differences between dreamweaver 8 & cs3

    What are the major differences between the two versions? I have 8 now and was wondering if I should change or keep this one.. I only use it for my own websites and they are very simple

  • Copy & paste details in bookmarks (into excel)..?

    If you go to bookmarks > show all bookmarks, if you then click on a bookmark & copy it, only the address is copied, none of the other details in any visible columns e.g. 'Added', 'Visit Date' etc How can I copy & paste my bookmarks into a program lik