ERROR attempting to call HttpSession.invalidate ()  in TOMCAT 5.5.9

Can someone help me with this TOMCAT issue:-
I am attempting to implement a logout method that will invalidate the current session and redirect to the login page (based on SRLogout demo eg).
The code works fine in JDeveloper Embedded OC4J Server, but when i deploy the application to Tomcat 5.5.9 it throws an exception that the Session has already been invalidated.
I also notice that When i print the session object in JDev it is: 'HTTP Session ac104af6231ccf2bd0e9a39148c5adc1ea2714432a9e' but in Tomcat it is : 'org.apache.catalina.session.StandardSessionFacade@bfb545'
See the method below and exception below :
public String logoutButton_action() throws IOException{
ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContex();
HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
HttpSession session = (HttpSession)ectx.getSession(false);
session.invalidate();
response.sendRedirect("Login.jspx");
return null;
Exception
[2006-07-18 11:31:01] [ERROR] [http-8080-Processor23] (com.sun.faces.lifecycle.InvokeApplicationPhase:80) - #{backing_app_SRLogout.logoutCommandButton1_action}: javax.faces.el.EvaluationException: java.lang.IllegalStateException: getAttribute: Session already invalidated
javax.faces.FacesException: #{backing_app_SRLogout.logoutCommandButton1_action}: javax.faces.el.EvaluationException: java.lang.IllegalStateException: getAttribute: Session already invalidated
     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
     at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
...

After a lot of investigation, code review and tests, I finally managed to understand what's going on with this problem.
The following stack trace is the key:
java.lang.IllegalStateException: getAttribute: Session already invalidated
     org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1077)
     org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)
     oracle.adf.share.http.HttpUtil.getAttribute(HttpUtil.java:98)
     oracle.adf.share.http.HttpSessionScopeAdapter.get(HttpSessionScopeAdapter.java:240)
     oracle.adf.share.statemanager.StateManagerScopeAdapter.<init>(StateManagerScopeAdapter.java:88)
     oracle.adf.share.http.HttpStateManagerScopeAdapter.<init>(HttpStateManagerScopeAdapter.java:51)
     oracle.adf.share.http.ServletADFContext.getStateManager(ServletADFContext.java:254)
     oracle.adf.share.statemanager.StateManagerScopeAdapter$ADFScopeListenerImpl.scopeInvalidated(StateManagerScopeAdapter.java:251)
     oracle.adf.share.ADFScopeHelper.fireScopeInvalidated(ADFScopeHelper.java:53)
     oracle.adf.share.http.HttpSessionScopeAdapter.invalidate(HttpSessionScopeAdapter.java:265)
     oracle.adf.share.http.HttpSessionScopeAdapter.valueUnbound(HttpSessionScopeAdapter.java:324)
     org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1686)
     org.apache.catalina.session.StandardSession.expire(StandardSession.java:801)
     org.apache.catalina.session.StandardSession.expire(StandardSession.java:644)
     org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1158)
     org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:150)
oracle.adf.share.http.HttpSessionScopeAdapter.valueUnbound(HttpSessionScopeAdapter.java:324)*
org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1686)*
org.apache.catalina.session.StandardSession.expire(StandardSession.java:801)*
catalina first invalidate the session by setting expire property to true
then it removes all attributes by calling removeAttributeInternal()
which calls whatever attributes valueUnbound method...
in this case, oracle's HttpSessionScopeAdapter try to get an attribute on the session
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)
oracle.adf.share.http.HttpUtil.getAttribute(HttpUtil.java:98)
catalina does not permit accessing the attributes when it is invalidated... so you get the mighty java.lang.IllegalStateException: getAttribute: Session already invalidated exception...
the solution to this problem is to remove oracle attributes BEFORE invalidating the session. This should work in any appserver implementation.
For example, in our case, the oracle attribute was a scope attribute (HttpStateManagerScopeAdapter in our stack trace)... We found those attributes using the
HttpSession.getAttributeNames() method, and removed them manually before invalidating the session.
session.removeAttribute("ORA_adf_sessionScope");
session.removeAttribute("__adf_session_scope__");
// remove private attributes
// and invalidate the session
session.invalidate();
I think that it makes sense that catalina invalidates the session before any call to the listeners, because any problem in those attributes could mean an improperly invalidated session...
Cheers.

Similar Messages

  • Error attempting to call WSDL in Livecycle form

    Hi,
         I am trying to call a WSDL through a Livecycle generated form, but it shows an error saying "Error attempting to read from file".....(file name). I am previewing the form in Acrobat Professional 8. This is the case when I try execting the call at client. when I change it to run at server, I get the error "Couldn't post data to ''".
         I also tried to load the WSDL in the Webservice component in Workbench, but it failed to load and threw up an error message. Please help.
    Thanks,
    Nakul

    Hi,
         I am trying to call a WSDL through a Livecycle generated form, but it shows an error saying "Error attempting to read from file".....(file name). I am previewing the form in Acrobat Professional 8. This is the case when I try execting the call at client. when I change it to run at server, I get the error "Couldn't post data to ''".
         I also tried to load the WSDL in the Webservice component in Workbench, but it failed to load and threw up an error message. Please help.
    Thanks,
    Nakul

  • "Error attempting to read file" at Webservice call from Adobe Form.

    Hi Experts,
    We have designed a Webservice form a Function Module in ECC 6.0, In the soamanager transaction the webservice works fine. But at the time of call from the Adobe form, it gives an error stating that "Error attempting to read from file" and then the URL of the Webservice to be excuted.
    and if i attempt to open that file, it gives me this error:
    - <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
      <soap-env:Header />
    - <soap-env:Body>
    - <soap-env:Fault>
      <faultcode>soap-env:Server</faultcode>
      <faultstring xml:lang="en">SRT: Wrong Content-Type and empty HTTP-Body received</faultstring>
    - <detail>
    - <ns:SystemFault xmlns:ns="http://www.sap.com/webas/710/soap/runtime/abap/fault/system/">
      <Host>undefined</Host>
      <Component>COREMSG</Component>
    - <ChainedException>
      <Exception_Name>CX_SOAP_CORE</Exception_Name>
      <Exception_Text>SRT: Wrong Content-Type and empty HTTP-Body received</Exception_Text>
      </ChainedException>
      </ns:SystemFault>
      </detail>
      </soap-env:Fault>
      </soap-env:Body>
      </soap-env:Envelope>
    In case I give my user the "SAP_ALL" role, this all works fine, so i think it is somewhere related to a missing role to be assigned.
    any clues..??
    any help would be appreciated, Please help..
    Thanks,
    Amita

    Hi Juergen,
    I am using it as a WSDL based data connection.
    How do i check this WSDL through a web browser? I have checked it through SICF Transaction code, It gives the output in explorer as given in the first post of this thread..
    Please help me resolving this issue, i feel that this issue is somewhere related to the role assignment of the user as if i provide this user an authorization of SAP_ALL then everything starts working fine, but after removing SAP_ALL this error is encountered, do u hav any pin points on this??
    Thanks
    Amita

  • LR4: error message on import : attempt to call field 'isNSImage' (a nil value)

    I have just installed LR4 on my mac and when I click on import I get the error message -
    : attempt to call field 'isNSImage' (a nil value)
    Can anyone give me any idea what this means or how to rectify it.
    I am new at all this and really don't have a clue
    Thanks

    Forgotten ... Windows 8 64Bit.
    Haven't tried the preferences yet, was thinking about it though. I'll try tonight.
    Thanks so far.

  • An error occurred when attempting to call the providers register function.

    Hi
    I am getting the following error while registering the Portlet to a WSRP portal.
    ]An error occurred when attempting to call the providers register function. (WWC-43134)
    An error occured during the call to the WSRP Provider: Java stack trace from root exception:
    java.rmi.ServerException: Internal Server Error (caught exception while handling request: oracle.webdb.wsrp.server.ContainerRuntimeException: An internal error has occurred in method <init>)
    at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:384)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:245)
    at oracle.webdb.wsrp.WSRP_v1_Registration_PortType_Stub.register(WSRP_v1_Registration_PortType_Stub.java:183)
    at oracle.webdb.wsrp.client.design.v1.OraWSRP_v1_Registration_PortType.register(Unknown Source)
    . (WWC-43273)
    I have done all the required configuration which includes the following.
    1. Installation of Infrastructure.
    2. Installtion of Portal.
    3. Created OC4J_WSRP instance on Portal_Home, configured DAD which is UP.
    4. Deployed the application which URL while registering giving me the above year.
    Can anybody give me an Instant Solution.

    I am receiving the same error messages under the same conditions.
    I have not not added any .jar files to the database and do have invalid 'java class' objects in my 'user_objects' table/view.
    A 'Troubleshooting Pdk Services for Java' article (search OTN for WWC-43134) mentions
    'recompiling the invalid objects'. How does one do this?

  • While attempting to download and install LR/GMail 2.0 I get the following error: ./LRLib_SelfUpdateV2.lua:865: attempt to call global 'DBG' (a nil value).

    I have been unsuccessful in my attempts to update LR/Gmail to version 2.0 and get the following error message, 'An Internal Error has occurred, ./LRLib_SelfUpdateV2.lua:865: attempt to call gloval 'DBG' (a nil value).

    Hi Bibin,
    Try to unplug, plug the AIM-CUE and settle down again. If it doesn't work, then most probably you should do an RMA.
    HTH
    Iber
    If this helps, please rate

  • An error occurred when attempting to call the providers register function. (WWC-43134

    Dear All,
    While i'm trying to register my provider i got the following exception:
    An error occurred when attempting to call the providers register function. (WWC-43134)
    The following error occurred during the call to Web provider: oracle.webdb.provider.v2.utils.soap.SOAPException: Can't read deployment properties for service: UserRegister_Provider
    at oracle.webdb.provider.v2.utils.soap.SOAPProcessor.locateService(Unknown Source)
    at oracle.webdb.provider.v2.utils.soap.SOAPProcessor.processInternal(Unknown Source)
    at oracle.webdb.provider.v2.utils.soap.SOAPProcessor.process(Unknown Source)
    at oracle.webdb.provider.v2.adapter.SOAPServlet.doSOAPCall(Unknown Source)
    at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    (WWC-43147)
    Any help will be appreciated.
    Regards,
    Mohammed Amin

    Mohammed,
    Make sure the file called UserRegister_Provider.properties does exist in your WEB-INF/deployment directory. The easiest way of creating it is: create a copy of the default.properties file, rename it, and specify the location of your provider definition file (usually provider.xml): definition=<providerlocation>
    Hope this helps.
    Peter

  • Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.boots

    When attempting to create a new Account in siebel integrated with OEDQ the following error occurs.
    ERROR
    Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.bootstrap.library.path)(SBL-APS-00118)
    STEPS
    The issue can be reproduced at will with the following steps:
    1) from EDQ director we have imported the EDQ_CDS,EDQ-REFERENCE DATA & EDQ_HISTORICAl DATA packages sucessfully.
    2) Created dnd.param file in SIebel server SDQCOnnector folder.
    3) Copied the libdnd.so file to siebsrvr lib directory(32 bit)
    3) In dnd.param file we have mentioned the javalib file and instllation directory path(<Siebsrvr roo>/dnd/install)
    4) Unzipped the EDQ-Siebel Connector files in dnd/install folder
    5) Copied the dnd.properties file in dnd/install directory and modified it accordingly to point to installed EDQ instance.
    6) Configured the Siebel components for EDQ integration.
    7) Realtime EDQ jobs are running.
    8) Create a new Account
    Env details are
    On : 8.2.2.14 [IP2014] version, Client Functionality
    EDQ 11.1.1.7.4
    IBM JDK 1.7 32 bit
    Using Open UI
    Any Champ have faced this issue and overcame it please let me know the resolution steps. your help is
    Regards
    Monoj Dey
    9007554589

    Hi Monoj,
    A few questions:
    - What OS is Siebel running on?
    - What version of the Siebel connector are you using?
    - Which libdnd.so file are you using?
    - What's the contents of your dnd.parms file?
    thanks,
    Nick

  • Org.apache.jasper.JasperException: Error: Attempt to clear a buffer that's

    Hi,
    All I am trying to do is execute a <jsp:forward page=""/> commend. The page I am refering to does exists and three other pages that have the same commend are able to forward to the said page with little issue. All the pages are in the same directory and the path indicator to them is correct. Any help in this matter will be highly appreciated.
    org.apache.jasper.JasperException: Error: Attempt to clear a buffer that's already been flushed
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         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:256)
         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:2415)
         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:171)
         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:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:534)

    jsp:forward always flushes the buffer before proceeding.
    Do you have a statement in your jsp like out.flush() before your use jsp:forward? If you do, try removing it

  • HttpSession Invalidate not working with WAS LTPA

    I normally handle site logout with a JSP that executes <% session.invalidate(); %> then redirects to the home page. Now I am running on WebSphere Application Server 5.1 authenticating against a Novell eDirectory LDAP server using LTPA and a SSL Certificate. Session.invalidate() does not work. Someone suggested it is because WAS is using LTPA. LTPA creates an authentication cookie that is not cleared by session.invalidate (?).
    IBM does have a proprietary logout JSP I could use**, but I don't want to use a vendor specific solution. Has anybody tackled a session logout that clears the LTPA cookie without being tied to a vendor's J2EE container?
    Thanks!
    Steve Mitchell
    http://www.byteworksinc.com
    ** http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/xsec_formlogin.html

    I saw this old post of mine and thought I would follow-up. I never found a vendor neutral solution. When running on WebSphere I redirect to a JSP that posts to ibm_security_logout. When testing on Tomcat I just call session.invalidate(). My Struts LogoutAction does the following:
    if ( serverInfo.toUpperCase( ).indexOf( "WEBSPHERE" ) > -1 )
    return mapping.findForward( "websphereLogoutForward" );
    session.invalidate( );
    return mapping.findForward( "success" );
    Steve Mitchell
    http://www.byteworksinc.com

  • Using 'merge' to compare sequential rows from SQL causes "invalid attempt to call Read when reader is closed"

    Hello,
    The use case is each row logs a cumulative data point, like an odometer, and I need to be able to subtract a previous row from a following row in order to see the change between two rows.
    I can do this if I create a Power Query "From Table," but if I do the same thing when the data source is SQL, I get an error message "invalid attempt to call Read when reader is closed".
    Given a trivial data table, this works:
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
        #"Added Index1" = Table.AddIndexColumn(#"Added Index", "Index.1", 1, 1),
        Merge = Table.NestedJoin(#"Added Index1",{"Index.1"},#"Added Index1",{"Index"},"NewColumn"),
        #"Expand NewColumn" = Table.ExpandTableColumn(Merge, "NewColumn", {"Odometer"}, {"NewColumn.Odometer"})
    in
        #"Expand NewColumn"
    But attempting the same technique against data from SQL, I get the above error "invalid attempt to call Read when reader is closed".
    Any suggestions? If this is a feature (or bug) that can't be overcome, is there another way to compare values between two rows?
    Thanks,
    Ed

    Please use "send a frown" to report the bug so we can fix it. Is the data very big? The simplest workaround is likely to be the use of "Table.Buffer" to buffer the table locally before doing this work; that will cause us to stop any
    attempt to do the processing on the server. If the table is very big, though, this isn't an attractive approach.

  • Grtting error Attempt to access dead view row of persistent id 1

    Hi,
    I have created one custom method which takes two object:
    Method is:
    public void testDeprtment(DepartmentsViewRowImpl department,CountriesViewRowImpl Country){
    try{
    ViewObjectImpl departmentView = getDepartmentsView1();
    ViewObjectImpl countryView= getCountriesView1();
    departmentView.insertRow(department);
    countryView.insertRow(Country);
    }catch(Exception e){
    e.printStackTrace();
    In my application I have connected the Depatment with Employee and Country with Location table.
    Now I am passing the values for the Department Object(Values for both Department and Employee) and Country Object(Values for both Countries and Location)
    It is inserting the records on all the four tables but it is giving me the error after inserting.
    Error: Attempt to access dead view row of persistent id 1
    I am using Jdeveloper 11.1.1.5
    Thanks,
    Vicky

    Is this in an Application Module method that you call from a backing bean? If this is the case, try using CreateInsert instead of Create so you can avoid calling this method just to insert the rows.

  • An internal error occured while calling 'getBlob' API. (error: ERR_WIS_3027

    Hi Team,
    Please help me in resolving the below error message.
    One of my user is experiencing this when trying to run a report.
    "An internal error occured while calling u2018getBlobu2019 API. (error: ERR_WIS_30270)". I have checked the previous discussion on the same, But I could not get it. Could some one help me as what I can do to resolve this.
    Thanks in Advance
    Mmvihar

    Hi George Pertea,
    Appreciate your prompt response.
    I found a simple solution for this.
    This error message occurs when the TOMCAT server memory exceeds more than 1.3 gb. Hence, restart the TOMCAT server would resolve this issue.
    Here are the steps in detail.
    1. Log into each server through either citrix, remote desktop or mstsc from run command.
    2. Click on task Manager.
    3. Click on process, if you find TOMCAT memory is more than 1.3 gb, come back to CCM and stop tomcat server.
    4. Wait for 20 seconds and then start tomcat server. Check all the remaining servers and do the same
    This resolved the issue.
    Thanks & Regards
    Mmvihar

  • ?:0: attempt to call upvalue '?' (a nil value)

    I can't seem to get rid of this error (' ?:0: attempt to call upvalue '?' (a nil value) ').  What is "?:0:" ?
    Thanks in advance for any help!
    script:
    local LrApplication = import 'LrApplication'
    local LrDialogs = import 'LrDialogs'
    local LrFileUtils = import 'LrFileUtils'
    local catalog = LrApplication.activeCatalog()
    local LrTasks = import 'LrTasks'
        function searchNtag()
            local targPhotos = catalog.getAllPhotos()
            for _, photo in ipairs(targPhotos) do
                local status = photo:getPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean')
                if status then
                    if status == nil then
                        local location = photo:getRawMetadata('path')
                        if LrFileUtils.isDeletable(location) == true then
                            photo:setPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean', false, 2)
                        else
                            photo:setPropertyForPlugin('com.jonathonlefaive.tagstatus', 'tagboolean', true, 2)
                        end
                    end
                end
            end
        end
    function task()
        catalog.withPrivateWriteAccessDo(searchNtag)
    end
    LrTasks.startAsyncTask(task)

    You're welcome Jonathon,
    And, here's my wild guess as to the meaning of the error message:
    When you use a dot, the function is still being called, its just that the first argument is nil (the expected 'self' argument), and
    - There are no symbols for it - thus the question mark instead of a name.
    - The value is zero - thus the zero (nil == 0).
    Summary: Not sure what an "upvalue" is, but it makes sense to me in this context that its referring to the missing 'self' argument.
    Just a guess.
    _R_

  • Help with simple stateless EJB Illegal attempt to call EJBObject.getPrimary

    I have the following, what i want to do is through a servlet, run a EJB method helloWorld() which will print out "Hello World". But i'm having a problem with it throwing an expection " EJB Illegal attempt to call EJBObject.getPrimary "
       Remote Interface
    package hello;
    import java.rmi.*;
    import javax.ejb.*;
    public interface HelloWorldServer extends EJBObject {
      public String helloWorld() throws RemoteException;
       Home Interface
    package hello;
    import java.rmi.*;
    import javax.ejb.*;
    public interface HelloWorldServerHome extends EJBHome {
      public HelloWorldServer create ()
             throws RemoteException, CreateException;
       EJB Implementation class
    package hello;
    import javax.ejb.*;
    public class HelloWorldServerBean
                 implements SessionBean {
      SessionContext sessionContext;
      // SessionBean methods
      public void setSessionContext (SessionContext sc) {
        this.sessionContext = sc;
      // Argument list must match create() method
      // in HelloWorldServerHome interface
      public void ejbCreate() { }
      public void ejbRemove() { }
      public void ejbActivate() { }
      public void ejbPassivate() { }
      // Now our business logic methods
      public String helloWorld() {
        String result = "Hello EJB World!\n";
        return (result);
    deployment descriptors:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC
    '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
    'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
        <enterprise-beans>
          <session>
            <ejb-name>HelloWorld</ejb-name>
            <home>hello.HelloWorldServerHome</home>
            <remote>hello.HelloWorldServer</remote>
            <ejb-class>hello.HelloWorldServerBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
          </session>
        </enterprise-beans>
        <assembly-descriptor>
          <container-transaction>
            <method>
               <ejb-name>HelloWorld</ejb-name>
               <method-intf>Remote</method-intf>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
          </container-transaction>
        </assembly-descriptor>
    </ejb-jar>
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
    'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
      <weblogic-enterprise-bean>
        <ejb-name>HelloWorld</ejb-name>
        <stateless-session-descriptor>
          <pool>
            <max-beans-in-free-pool>100</max-beans-in-free-pool>
          </pool>
        </stateless-session-descriptor>
        <jndi-name>ejb/HelloWorld</jndi-name>
      </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    Finally a servlet:
    import hello.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.util.*;
    public class HelloWorldServlet extends HttpServlet {
      public void doGet (HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {
        res.setContentType("text/plain");
        PrintWriter out = res.getWriter();
        out.println("----------------------------------------");
        try {
          Context ctx = new InitialContext();
          out.println("Got context");
          HelloWorldServerHome hwsh;
          // EJB 1.1 style to get home stub for non EJB 2.0 server.
          //hwsh = (HelloWorldServerHome)
          //    ctx.lookup("ejb/HelloWorld");
          // Required by new RMI-IIOP. Use 1.1 style if this causes errors.
          Object ref = ctx.lookup("ejb/HelloWorld");
          hwsh = (HelloWorldServerHome) PortableRemoteObject.narrow(ref,
                  HelloWorldServerHome.class);
          out.println("Got home interface");
          HelloWorldServer hws = hwsh.create();
          out.println("Created EJB");
          out.println(hws.helloWorld());
        catch (Exception e) {
          e.printStackTrace(out);
        out.println("----------------------------------------");
    }When i run the servlet i just get "----------------------------------------
    Got context
    Got home interface
    Created EJB
    java.rmi.RemoteException: [EJB:010171]Illegal attempt to call EJBObject.getPrimaryKey() on a session bean.
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at hello.HelloWorld_ap17lf_EOImpl_812_WLStub.helloWorld(Unknown Source)
         at HelloWorldServlet.doGet(HelloWorldServlet.java:37)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    I've pinpointed the problem:
    out.println(hws.helloWorld());
    but i still can't figure what's actually causing the problem.

    Are u sure that when u deployed ur ejb u didnt get any exeption or erro??
    Make sure that there is no bean named Helloworld already resides in ur server..
    regards
    Shanu

Maybe you are looking for