NoSuchObjectLocalException - call entitybean finder method from sessionbean

I got javax.ejb.NoSuchObjectLocalException when I tried to call a BMP EntityBean finder method (return a List) from a session facade bean. The session bean uses the entityBean's local interface. Can anyone help? I am using JBOSS 4.
From SessionBean:     AdvertiserMgrEJB.java
public List searchByName(String name) {
try {
  this.findAdvertiserEntityHome(); //return ejblocalhome..
  Collection advertisers = this.advertiserEntityHome.findByName(name);
  List list = new ArrayList();
  if (advertisers != null) {
     Iterator iterator = advertisers.iterator();
     while (iterator.hasNext()) {
       AdvertiserEntity advertiserEntity = (AdvertiserEntity) iterator.next();
       AdvertiserData data = new AdvertiserData(); //This is the DTO
       if (advertiserEntity != null) {
          logger.info("assemble.");               
                          data.setFax(advertiserEntity.getFax());
                                          data.setId(advertiserEntity.getId());
          data.setName(advertiserEntity.getName());
          //setters...
          logger.info("assembled");
       list.add(data);
  return list;
} catch (Exception e) {
  throw new EJBException(e);
}From EntityBean:     AdvertiserEntityEJB.java
public Collection ejbFindByName(String name) throws FinderException {
    DAOFactory mysqlFactory = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
    AdvertiserDAO advertiserDAO = mysqlFactory.getAdvertiserDAO();
    Collection c = null;
    try {
      c = advertiserDAO.selectByName(name); //DAO return a Collection of Vector.
    } catch (Exception ex) {
      ex.printStackTrace();
    return c;
  public void ejbActivate() throws EJBException {
    logger.info("ejbActivate() called.");
    this.id = (String) this.context.getPrimaryKey();
    logger.info("ejbActivate() id = " + this.id);
  }Error Trace, seems it's calling EntityBean ejbActivate() when the line "data.setFax(advertiserEntity.getFax());" is called....
also seems there are error in the bold words below...
00:18:39,149 INFO [AdvertiserMgrEJB] 001 2
00:18:39,159 INFO [AdvertiserMgrEJB] 004
00:18:39,159 INFO [AdvertiserMgrEJB] 005 false
00:18:39,159 INFO [AdvertiserMgrEJB] assemble.
00:18:39,159 INFO [AdvertiserEntityEJB] ejbActivate() called.
00:18:39,189 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract java.lang.String sg.edu.nus.iss.jass.business.advertiser.AdvertiserEntity.getFax(), causedBy:
javax.ejb.NoSuchObjectLocalException: null; CausedByException is:
null
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:171)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
at org.jboss.ejb.Container.invoke(Container.java:854)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:413)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
at $Proxy77.getFax(Unknown Source) at sg.edu.nus.iss.jass.business.advertiser.AdvertiserMgrEJB.searchByName(AdvertiserMgrEJB.java:102)
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 org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:854)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:55)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy85.searchByName(Unknown Source) at sg.edu.nus.iss.jass.business.advertiser.AdvertiserMgrDel.searchByName(AdvertiserMgrDel.java:49)
at sg.edu.nus.iss.jass.presentation.AdvertiserSearchAction.execute(AdvertiserSearchAction.java:78)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
00:18:39,219 INFO [AdvertiserMgrEJB] ejbRemove()
00:18:39,219 ERROR [LogInterceptor] EJBException in method: public abstract java.util.List sg.e
du.nus.iss.jass.business.advertiser.AdvertiserMgr.searchByName(java.lang.String) throws java.rm
i.RemoteException, causedBy:
javax.ejb.TransactionRolledbackLocalException: null; CausedByException is:
null; CausedByException is:
null; CausedByException is:
null
..........................

this.findAdvertiserEntityHome(); //return ejblocalhome..
Collection advertisers = this.advertiserEntityHome.findByName(name);In this part of your code, you are getting the EJB Home but where is it?
Regards,
$ Carol.

Similar Messages

  • How to call a bean method from javascript event

    Hi,
    I could not find material on how to call a bean method from javascript, any help would be appreciated.
    Ralph

    Hi,
    Basically, I would like to call a method that I have written in the page java bean, or in the session bean, or application bean, or an external bean, from the javascript events (mouseover, on click, etc...) of a ui jsf component. I.e., I would like to take an action when a user clicks in a column in a datatable.
    Cheers,
    Ralph

  • Calling a service method from a DataAction

    Hello!
    I'm trying to call a service method from a DataAction, cobbling ideas from the Oracle JDeveloper 10g Handbook and the Oracle ADF Data Binding Primer.
    I have created a service method and exposed it using the client interface node of the application module editor. It is called "process()" and it now appears in the data control palette under MyAppDataControl->Operations (just above the built-in action bindings Commit and Rollback). As part of this procedure, I modified MyAppImpl.java and put the process() method there.
    I don't want to call process() by dragging and dropping it onto a Data Action because depending on the outcome, I want to branch to different pages. process() returns an int that will tell me where to branch. Thus, I am trying to call it from an overridden invokeCustomMethod() method of the lifecycle of a DataAction, where I can get the int, create a new ActionForward, and set it in the DataActionContext. (If I'm barking up the wrong tree, let me know!)
    So, I need to call MyAppImpl.process() from within the invokeCustomMethod() method of my DataAction. Looking at the class declaration, I noticed that it extends ApplicationModuleImpl. I figure that, if I can get the ApplicationModule, I can cast it to MyAppImpl and call the process() method. Unfortunately, that doesn't work. When I got the application module, I checked the class and it's oracle.jbo.common.ws.WSApplicationModuleImpl. I tried casting it and got a class cast exception.
    Here's the code I'm using:
    protected void invokeCustomMethod(DataActionContext actionContext) {
    BindingContext ctx = actionContext.getBindingContext();
    DCDataControl dc = ctx.findDataControl("MyAppDataControl");
    log.debug("invokeCustomMethod(): dc.getClass().getName()=" + dc.getClass().getName()); // result is: oracle.jbo.uicli.binding.JUApplication
    ApplicationModule am = null;
    MyAppImpl myAppImpl = null;
    int processResult = 0;
    if (dc instanceof DCJboDataControl) { // this is true
    am = dc.getApplicationModule();
    log.debug("invokeCustomMethod(): am.getClass().getName()=" + am.getClass().getName()); // result is: oracle.jbo.common.ws.WSApplicaitonModuleImpl
    if (am instanceof ApplicationModuleImpl) { // this is false
    log.debug("invokeCustomMethod(): am is an instanceof ApplicationModuleImpl.");
    if (am instanceof MyAppImpl) { // this is false
    log.debug("invokeCustomMethod(): am is an instanceof MyAppImpl.");
    processResult = ((MyAppImpl)am).process();
    log.debug("invokeCustomMethod(): processResult=" + processResult);
    super.invokeCustomMethod(actionContext);
    What am I doing wrong? Can anyone explain the different class hierarchies and why my application module isn't the class I'm expecting?
    Thanks,
    -Anthony Carlos

    Georg,
    it was in the javadoc of oracle.adf.model.binding.DCBindingContainer
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/vtTopicFile.bc4jjavadoc36%7Crt%7Coracle%7Cadf%7Cmodel%7Cbinding%7CDCBindingContainer%7Ehtml/navId.4/navSetId._/
    However, I see it's not the case in other sub-classes of JboAbstractMap like DCControlBinding and DCDataControl.
    Weird... I'm keeping you informed if I find more information.
    Regards,
    Didier.

  • How to call a set method from within a constructor

    Hello,
    I want to be able to call a set method from within a Scanner, to be used as the argument to pass to the Scanner (from a source file). Here's what i tried:
    private void openFiles()
            input = new Scanner( setSource );              
        and here is the set method:
    public String setSource( String in )
            source = in;
            return source;
        }obviously there will be more code in this method but i'm trying to tackle one problem at a time. Thanks in advance..

    The "String in" declaration says: "Nobody may ever invoke setSource() without specifying a certain String. The content of the String is known at run-time only."
    In no place in your code you say the compiler: "I want the 'in' variable (actually, parameter) of method setSource() to contain the first arg which is passed to the application".
    This is exactly the same mechanism allowing you to write "new Scanner" with something inside the two parentheses.

  • Getting error while calling ejb business methods from servlet

    Hi
    Iam getting error when i try to call a ejb method from servlet.Error is
    "com.netscape.server.eb.UncheckedException: unchecked exception nested exception is:java.lang.NullPointerException".
    I build the application and deployed it successfully.Iam using IAS 6.O with windows NT 4.0.
    This is just a method which takes values from database and return as an array of bean to servlet.
    Any help on this.Thanks Shank

    Hi
    I was using the session bean.Your suggestion helped me a lot.Perfect.
    I debug my program and found that from ejbCreate()exception is getting.
    I was getting the datasource object thro ejb create() initialisation.
    Somehow the look up jndi which i mentioned was not interpretting from ejb-jar.xml ias-ejb-jar.xml and datasource ref .Due to this iam getting jndi Namenotfound exception which in turns to null pointer as datasource is getting null.
    when i hardcoded in the ejb the the jndi name for datasource it is working fine.Bit worried all the existing ejbs working with the xml referenced datasource and jndi,but when i added a new ejb with same properties it is failing to get the jndi name.
    Piece of code from ias-ejb-jar.xml
    <resource-ref>
              <res-ref-name>myDataSource</res-ref-name>
              <jndi-name>jdbc/nb/myData</jndi-name>
    </resource-ref>
    Piece of code from ejb-jar.xml
    <resource-ref>
              <res-ref-name>myDataSource</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
    </resource-ref>
    Thanks a lot meka

  • Call a  Webservice method from DotNetApplication

    Hi all,
    I have created One web service using Axis. My WebServices are below:
    import java.util.*;
    public class NHLService {
      HashMap standings = new HashMap();
      public NHLService() {
        // NHL - part of the standings as per 04/07/2002
        standings.put("atlantic/philadelphia", "1");
        standings.put("atlantic/ny islanders", "2");
        standings.put("atlantic/new jersey", "3");
        standings.put("central/detroit", "1");
        standings.put("central/chicago", "2");
        standings.put("central/st.louis", "3");
      public String getCurrentPosition(String division, String team) {
        String p = (String)standings.get(division + '/' + team);
        return (p == null) ? "Team not found" : p;
    }Its name is NHLService.jws. Then I run this service in my localhost like this "http://localhost:8080/axis/NHLService.jws" It is running and show that
    There is a Web Service here
    Click to see the WSDL Now I can view the wsdl. Now I want to call this webservice method from DotNet Application.Please any one knows that can you guide me the steps.
    Thanks in Advance,
    Raj

    but i don't understand a thing...
    when i create a static stub client i link with the config-wsdl file the path of my webservices wdsl and the client compile and run well...
    why with the servlet i had to link .class file or jar file??
    thanks a loto

  • How to call an ejb method from jsp?

    Hi, everyone!
    Inside my JSP, I4m using scripts in order to show and receive information, that is, a form.But I don4t Know if I can use the same variables from the script in order to call the 'set' methods from my EJB.
    Could anyone show me an example?
    Thanks in advance,
    Silvia

    InitialContext ctx = new InitialContext();
         GeneralEditor editor = (GeneralEditor) ctx
                        .lookup("GeneralEditorBean/remote");
              GeneralService service = (GeneralService) ctx
                        .lookup("GeneralServiceBean/remote");
              LanMu lm = new LanMu();
              lm.setName("shdfkhsad");
              editor.add(lm);

  • Call enhancement class method from Bus. workflow task

    Hi all,
    I recently enhanced a global class from SAP (add a new method). Now I would like to call it from a workflow task (ABAP Class object used in the task). So it seems that only "native" methods from the class itself can be selected for the object method of the task.
    Same issue if I try to call it via secondary methods options...
    Last idea I have before the repair is: retrieve the instance saved into the WF container via a custom class interfacing IF_IFS_SWF_CONTAINER_EXIT (program exit) and call the enhanced method from the method proposed in this interface.
    Maybe someone had the same issue? Anyone could help or propose solution?
    Many thanks in advance for your help,
    KR,
    Olivier

    I think it might qualify for an OSS message.
    There was simmilar note for BADIs which was corrected: https://service.sap.com/sap/support/notes/1156392
    CL_SWF_UTL_DEF_SERVICES which is used in PFTC to determine callable methods doesn't include enhancements when calling  function SEO_CLASS_TYPEINFO_GET (parameter WITH_ENHANCEMENTS is default FALSE)

  • How to call jpf controller method from javascript

    Can any one help me how to call pageflow controller method from JavaScript.\
    Thanks.

    Accessing a particular pageflow method from Javascript is directly not possible unless we do some real funky coding in specifying document.myForm.action = xyz...Heres what I tried and it did not work as expected: I found another workaround that I will share with you.
    1. In my jsp file when I click a button a call a JavaScript that calls the method that I want in pageflow like this: My method got invoked BUT when that method forwards the jsp, it lost the portal context. I saw my returned jsp only on the browser instead of seeing it inside the portlet on the page of a portal. I just see contents of jsp on full browser screen. I checked the url. This does make the sense. I do not see the url where I will have like test1.portal?_pageLabe=xxx&portlet details etc etc. So this bottom approach will notwork.
    document.getElementById("batchForm").action = "/portlets/com/hid/iod/Batches/holdBatch"; // here if you give like test1.portal/pagelable value like complete url...it may work...but not suggested/recommended....
    document.getElementById("batchForm").submit;
    2. I achieved my requirement using a hidden variable inside my netui:form tag in the jsp. Say for example, I have 3 buttons and all of them should call their own action methods like create, update, delete on pageflow side. But I want these to be called through javascript say for example to do some validation. (I have diff usecase though). So I created a hidden field like ACTION_NAME. I have 3 javascript functions create(), update() etc. These javascripts are called onclick() for these buttons. In thse functions first I set unique value to this hiddent field appropriately. Then submit the form. Note that all 3 buttons now go to same common action in the JPF. The code is like this.
    document.getElementById("ACTION_NAME").value = "UPDATE";
    document.getElementById("batchForm").submit.
    Inside the pageflow common method, I retriev this hidden field value and based on its value, I call one of the above 3 methods in pageflow. This works for me. There may be better solution.
    3. Another usecase that I want to share and may be help others also. Most of the time very common usecase is, when we select a item in a drop bos or netui:select, we want to invoke the pageflow action. Say we have 2 dropdown boxes with States and Cities. Anytime States select box is changed, it should go back to server and get new list of Cities for that state. (We can get both states and cities and do all string tokenizer on jsp itself. But inreality as per business needs, we do have to go to server to get dynamic values. Here is the code snippet that I use and it works for all my select boxes onChange event.
    This entire lines of code should do what we want.
    <netui:anchor action="selectArticleChanged" formSubmit="true" tagId="selectPropertyAction"/>                    
    <netui:select onChange="document.getElementById(lookupIdByTagId('selectPropertyAction',this )).onclick();" dataSource="pageFlow.selectedArticleId" >
    <c:forEach items="${requestScope.ALL_ARTICLE}" var="eachArticle">
    <%-- workshop:varType="com.hid.iod.forms.IoDProfileArticleRelForm" --%>
    <netui:selectOption value="${eachArticle.articleIdAsString}">${eachArticle.articleItemName}</netui:selectOption>
    </c:forEach>               
    </netui:select>
    See if you can build along those above lines of code. Any other simpler approches are highly welcome.
    Thanks
    Ravi Jegga

  • How to call backing bean method from java script

    Hi,
    I would like to know how to call backing bean method from java script.
    I am aware of serverListener and [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    but i am running in to some issues with [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    regarding which i asked for help in other thread with subject ....Question on AjaxAutoSuggest article (Ajax Transactions Using ADF and J...)
    The reason why i posted is ( though i realise both are duplicates) .. that threads looks as a specific question to that article hence i would like to ask the quantified problem is asked in this thread.
    So could any please letme know how to call backing bean method from java script
    Thanks
    Murali
    Edited by: mchepuri on Oct 24, 2009 6:17 PM
    Edited by: mchepuri on Oct 24, 2009 6:20 PM

    Hello,
    May know how to submit a button autoamtically on onload of page with clicking a welcome alert box. the submit button has managed button too to show a message on console using SOP.
    the problem is.
    1. before loading the page a javascript comes on which i clicked ok
    2. the page gets loaded and the button is there which gets automatically clicked and the managed bean associated with prints a message on console using SOP.
    I m trying to do this through server listener and click listener. the code is(adf jspx page)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_check4.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_check4.f1}">
    <af:commandButton text="commandButton 1"
    binding="#{backingBeanScope.backing_check4.cb1}"
    id="cb1" action="#{beanCheck4.submit1}"/>
    <af:clientListener type="click" method="delRow"/>
    <af:serverListener type= "jsServerListener"
    method="#{backingBeanScope.backing_check4.submit1}"/>
    <f:facet name="metaContainer">
    <af:resource type ="javascript">
    x=confirm("hi");
    // if(x){
    delRow = function(event){
    AdfCustomEvent.queue(event.getSource(), "jsServerListener", {}, false);
    return true;
    </af:resource>
    </f:facet>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_check4-->
    </jsp:root>
    the backing bean code is -----
    public class classCheck4 {
    public classCheck4() {
    public String submit1() {
    System.out.println("hello");
    return null;
    }

  • Problem calling a Java Method from C++

    hi everyone,
    i'm using JNI and i'm trying to call a Java method from C++, this is the code:
    SocketC.java
    public class SocketC
    private native void conectaServidor();
    private void recibeBuffer()
    System.out.println("HELLO!!!");
    public static void main(String args[])
    SocketC SC = new SocketC();
    SC.conectaServidor();
    static {
    System.loadLibrary("Server_TCP");
    Server_TCP.cpp
    char* recibirSock()
         int _flag = 1;
         while(_flag != 0)
              memset(buffer,0,sizeof(buffer));//Et la, celle pour recevoir
              recv(sock,buffer,sizeof(buffer),0);
              printf(" Mensaje del cliente: %s\n",buffer);
              _flag = strcmp(buffer,"salir");
         }//fin while
         return buffer;
    void enviarSock()
         int _flag = 1;
         getchar();
         while(_flag != 0)
              memset(buffer,0,sizeof(buffer));//procedimiento para enviar
              printf("\n Escriba: ");
              gets(buffer);
         //     err=scanf("%s",buffer);
              send(sock,buffer,sizeof(buffer),0);
              _flag = strcmp(buffer,"salir");
         }//fin while
    }//fin enviarSock
    DWORD servicio(LPVOID lpvoid)//
         char *buf;
         printf("\n Cliente aceptado!!!!!\n");
         buf=recibirSock();
         return 0;
    JNIEXPORT void JNICALL Java_SocketC_conectaServidor(JNIEnv *env, jobject obj)
    //void main()
    /*this is the problem i'm calling the method recibeBuffer*/
         jclass cls = env->GetObjectClass(obj);
         jmethodID mmid = env->GetMethodID(cls, "recibeBuffer", "(V)V");
         if (mmid == 0)
              return;
         env->CallVoidMethod(obj, mmid); //llama a Java
         WSAStartup(MAKEWORD(2,0),&wsa);//MAKEWORD dit qu'on utilise la version 2 de winsock
         printf("TCP conexion Sockets\n\n");
         //estimez vous heureux que je foute pas de copyright ;)
         system("TITLE TCP Conexion Sockets (Version server)");
         //fo avouer que c'est plus joli
         int port;
         printf("Port : ");//On demande juste le port, pas besoin d'ip on est sur un server
         scanf("%i",&port);
         sinserv.sin_family=AF_INET;     //Je ne connais pas d'autres familles
         sinserv.sin_addr.s_addr=INADDR_ANY;//Pas besoin d'ip pour le server
         sinserv.sin_port=htons(port);
         server=socket(AF_INET,SOCK_STREAM,0);//On construit le server
         //SOCK_STREAM pour le TCP
         bind(server,(SOCKADDR*)&sinserv,sizeof(sinserv));
         //On lie les parametres du socket avec le socket lui meme
         listen(server,SOMAXCONN);//On se met � �couter avec server, 0 pour n'accepter qu'une seule connection
         printf(" Servidor conectado.");
         while(1)
              sinsize=sizeof(sin);
              if((sock=accept(server,(SOCKADDR*)&sin,&sinsize))!=INVALID_SOCKET)
              {//accept : acepta cualquier conexion
                   if (hReadThread = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE)
                   servicio, 0, 0, &dwThreadID))
                        printf("\nHOLA!");
                        GetExitCodeThread(hReadThread,&dwExitCode);
                        CloseHandle (hReadThread);
                   else
                        // Could not create the read thread.
                        printf("No se pudo crear");
                        exit(0);
    when i'm running the proyect i get this error:
    C:\POT Files\UCAB\tesis\esmart\french>java SocketC
    Exception in thread "main" java.lang.NoSuchMethodError: recibeBuffer
    at SocketC.conectaServidor(Native Method)
    at SocketC.main(SocketC.java:16)
    i don't know why this is happening i got declare the method recibeBuffer in my SocketC.java class, but doesn;t work can anyone help me?
    PD: sorry for my bad english i'm from Venezuela

    Next time please paste your code between &#91;code&#93; tags with the code button just above the edit message area.
    To answer your question, you wrote the wrong method signature. It should be:jmethodID mmid = env->GetMethodID(cls, "recibeBuffer", "()V");Regards

  • Calling view controller method from component controller method

    Hi,
    Is there any way to call view controller method from component controller method?
    Thanks,

    Hi Khandal.
    You should not make you component controller dependent from a view controller.
    But what you can do is to define an event in the component controller. The view
    controller can register for this event.
    In the stage where you currently want to call the view controller method just fire
    the event. In the event handler method in the view controller you can call the
    method then.
    Why do you need to call a view controller method? Can you give more details
    about the scenario?
    Cheers,
    Sascha

  • Calling a static method from another class

    public class Command
        public static void sortCommands(String command, String order, List object)
             if(command.equalsIgnoreCase("merge") && order == "a")
                  object.setAscending(true);
                  Mergesort.mergesort(object.list);                  // line 85
    }and
    public class Mergesort
         public static void mergesort (int[] a)
              mergesort(a, 0, a.length-1);
         private static void mergesort (int[] a, int l, int r)
         private static void merge (int[] a, int l, int m, int r)
    }Error:
    Command.java:85: cannot find symbol
    symbol : variable Mergesort
    location: class Command
    Mergesort.mergesort(object.list)
    What am I doing wrong here? Within the Command class I am calling mergesort(), a static method, from a static method. I use the dot operator + object so that the compiler would recognize the 'list' array. I tried using the
    Mergesort.mergesort(object.list);notation in hopes that it would work like this:
    Class.staticMethod(parameters);but either I am mistaken, misunderstood the documentation or both. Mergesort is not a variable. Any help would be appreciated, I have been hitting a brick wall for hours with Java documentation. Thanks all.

    [Javapedia: Classpath|http://wiki.java.net/bin/view/Javapedia/ClassPath]
    [How Classes are Found|http://java.sun.com/j2se/1.5.0/docs/tooldocs/findingclasses.html]
    [Setting the class path (Windows)|http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html]
    [Setting the class path (Solaris/Linux)|http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html]
    [Understanding the Java ClassLoader|http://www-106.ibm.com/developerworks/edu/j-dw-javaclass-i.html]
    java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.
    javac -classpath .;<any additional jar files or directories> YourClassName.javaYou get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

  • Calling Stateful & Statless Methods from the same Entity Bean[EJB2.0]?

    Dear All,
    We using EJB2.0........
    Regarding segregation of stateless and stateful methods..These methods are defined in Session bean.Now my question is
    Is it a good practice to call Stateful and Stateless business methods from same single entity bean("EntityBean") defined at program level by extending MainBean..
    The architecture is like
    public class EntityBean extends MainBean
    Public Methodxyz
    stfobj.MakeConn();
    stlobj.getXyz();
    stfobj.CloseConn();
    Public Class MainBean{lookup("stl");lookup(stf) ;stl_obj=home.create;stf_obj=home.create()............}
    ejb-jar.xml
    { <session>
              <description>Entity Bean Employee Example</description>
              <ejb-name>stl</ejb-name>
              <local-home>com.packg.stlHome</local-home>
              <local>com.packg.stl</local>
              <ejb-class>com.packg.stlBean</ejb-class>
              <session-type>Stateless</session-type>
              <transaction-type>Container</transaction-type>
         </session>
         <session>
              <description>Entity Bean Employee Example for stateful</description>
              <ejb-name>stf</ejb-name>
              <local-home>com.packg.stfHome</local-home>
              <local>com.packg.ejbeans.stf</local>
              <ejb-class>com.packg.stfBean</ejb-class>
              <session-type>Stateful</session-type>
              <transaction-type>Container</transaction-type>
         </session>
         <session>
              <description>Session bean for System Parameters</description>
              <ejb-name>SysParam</ejb-name>
              <local-home>com.packg.Home</local-home>
              <local>com.packg.Param</local>
              <ejb-class>com.packg.Bean</ejb-class>
              <session-type>Stateless</session-type>
              <transaction-type>Bean</transaction-type>
              <ejb-local-ref>
              <ejb-ref-name>stl</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>com.packg.stlHome</local-home>
              <local>com.packg.ejbeans.stl</local>
              <ejb-link>stl</ejb-link>
         </ejb-local-ref>
              <ejb-local-ref>
              <ejb-ref-name>stf</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>com.packg.stfHome</local-home>
              <local>com.packg.stf</local>
              <ejb-link>stf</ejb-link>
         </ejb-local-ref>
         </session>
    Thanks !!
    Edited by: user9052593 on Jun 18, 2012 2:20 AM
    Edited by: user9052593 on Jun 18, 2012 2:25 AM

    All Business logic resides in session beans[Stateful or Stateless]..For stateful beans we are opening connections in entity bean ,calling business methods and closing connection in entity bean itself..Problem is
    I am doing lookup for stateful and stateless both since both objects are called by extending MainBean in same entity bean else will give null pointer exception..
    So whenever i call a Stateful or Stateless method from entity bean Which ultimately extends/calling MainBean and thereby calling home.create methods of stateful and stateless both..creating objects..Is this way fine or it will affect the performance?
    Do i need to segregate the Calls/invokation to Stateful / Stateless methods at entity bean level too..
    For ex:- Whenever i call Methodxyz() method ..at the same time it create 2 objects as its extending MainBean...i want to extend/create 1 object either of stateful or stateless one for stateful and stateless methods call respectively..
    See the code in entity bean is like
    public class EntityBean extends MainBean
    Public Methodxyz
    stfobj.MakeConn(); call to stateful method defined in stateful bean
    stlobj.getXyz();// call to stateless method defined in stateless bean
    stfobj.CloseConn(); call to stateful method defined in stateful bean
    ------------------------------------------------------------

  • Why I can't call my native method from my package?

    it is fine if my java code didn't complied into a package.
    But if I complied my java code as a package, and call its native method outside. It give me "UnsatisfiedLinkError". And can not find my method. It is indeed the method is inside.
    Thank a lot any helps. Email me on [email protected]

    I have found that javah does not generate the correct JNI function names when the native function is in a class that is within a Java package. The net result is an Unsatisfied link error.
    The JNI function name must be included in the package name. The naming is a bit complicated and that's why javah should be used, except in this case it does not work. I can't quite remember exactly how it works, something like adding in packagename_1 into the JNI name. The SWIG tool (http://www.swig.org) does generate the correct names when using packages. It is a tool which takes C or C++ header files and generates the JNI and Java classes for you so that you can call C/C++ code from Java. Once you have installed SWIG and run 'make check', have a look in the directory Examples/test-suite/java for the JNI naming for packages. I'll try remember to post the exact naming if you don't want to install SWIG.

Maybe you are looking for

  • Help with Recurrsion program

    I seem to be having a little problem with my program. In my main program, depending on which method comes first, the other methods wont work for example the way my main program is not, with occurance method before removeLetter method, the occurance m

  • Compressor failing: "3x should not be auto-detect at this point"

    I have something that I can't seem to fix. I'm trying to render to MPEG2 but the job keeps failing with "Status: Failed - 3x should not be auto-detect at this point" error message in the status window of Batch Monitor. The logs show: <mrk tms="273146

  • Quicktime Dance movies won't load correctly - here is a link - please help

    Hello, Finally got the project to this point . . . I could not figure out the html ActiveXcoding Apple recommended in for our QT movies, so I hired a guy to code it for me - but the movies will not play (for me) correctly . . . . he says they play fi

  • MBP Early 2009 17" HDD 'clicking'

    I have a MBP 17" that was manufactured in early 2009 that is making clicking sounds. Originally the macbook made the noise constantly, a gentle click-click sound and not booting up. It just showed a grey screen with an icon that it could not find the

  • Web module colour shift

    As soon as I go to the web module in lightroom the colours in my images look terrible especially reds, and magentas. Even if I first change the images to sRGB it makes no difference. This only happens in the web module. Any ideas, as its making it un