Exception: Entity must be managed to call remove

hello guys, I'm still here. I have another problem with toplink and jpa.
I have the following method:
+private void eliminaCliente(Evento evento) {+
+ Cliente cliente = this.finestraCliente.getCliente();+
+ ClienteFacade facade = new ClienteFacade();+
+ try {+
+ facade.getEm().getTransaction().begin();+
+ facade.getEm().merge(cliente);+
+ facade.getEm().remove(cliente);+
+ facade.getEm().flush();+
+ } catch(PersistenceException e) {+
+ String messaggio;+
+ if(e.getCause() instanceof ConstraintViolationException) { // vincolo di integrità violato+
+ messaggio = "Impossibile completare l'operazione a causa della violazione di un vincolo di integrità:\n---> ";+
+ messaggio += e.getCause().getCause().getMessage();+
+ } else // errore generico+
+ messaggio = e.getMessage();+
+ apriFinestraMessaggio(evento, e.getMessage());+
+ } finally {+
+ facade.getEm().close();+
+ }+
+ }+
Its duty is to get an entity from the gui, and remove it. The problem is that on the line in wich I call the remove method, it generate this exception:
java.lang.IllegalArgumentException: Entity must be managed to call remove: Abba Pino, try merging the detached and try the remove again.
why?

The call to merge will return a managed instance that you can use in your remove call.
private void eliminaCliente(Evento evento) {
        Cliente cliente = this.finestraCliente.getCliente();
        ClienteFacade facade = new ClienteFacade();
        try {
            facade.getEm().getTransaction().begin();
            Cliente managedCliente = facade.getEm().merge(cliente);
            facade.getEm().remove(managedCliente);
        ...Doug

Similar Messages

  • Can I override the default ReadObjectQuery for an entity and specify my own call

    Hi,
    I am trying to override the default ReadObjectQuery and the ReadAllQuery for an entity and supply my own call.The entities have to be read from the database using a StoredProcedure.I tried doing something like
    Descriptor desc=evt.getSession().getDescriptor(Configuration.class);
    desc.getQueryManager().setReadObjectQuery(new ReadObjectQuery());
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("CONFIGSVC");
    call.addUnamedArgument("CATEGORY");
    call.addUnamedArgument("CFGKEY");
    call.addUnamedArgument("VALUE");
    desc.getQueryManager().getReadObjectQuery().setCall(call1);
    desc.getQueryManager().getReadObjectQuery().addArgument("CATEGORY");
    desc.getQueryManager().getReadObjectQuery().addArgument("CFGKEY");
    desc.getQueryManager().getReadObjectQuery().addArgument("VALUE");
    When I try to execute the query
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expr = (builder.getField("category").equal("GOESVC.GETTDEV")).and(
              new ExpressionBuilder().getField("configKey").equal("GOESVC.REQ")).and(
              new ExpressionBuilder().getField("value").equal("$ENV.$ORIGIN.GOESVC.REQ"));
    ReadObjectQuery query = new ReadObjectQuery(Configuration.class, expr);
    session.executeQuery(query);
    I can see in the log that it completely ignores the call I set and tries to execute using the default call and that too with incorrect mappings between the "entity" field names and the actual database field names.
    2002.11.01 08:50:52.640--ClientSession(8218801)--Thread[main,5,main]--#executeQuery(ReadObjectQuery(com.fmrco.gett.toplink.Configuration))
    2002.11.01 08:50:52.750--ServerSession(7721862)--Thread[main,5,main]--Connection(5230193)--SELECT CFGKEY, CATEGORY, VALUE FROM CONFIG_ETT WHERE (((category = 'GOESVC.GETTDEV') AND (configKey = 'GOESVC.REQ')) AND (value = '$ENV.$ORIGIN.GOESVC.REQ'))
    2002.11.01 08:50:53.375--ClientSession(8218801)--Thread[main,5,main]--EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 with StoredProcedureCall patch [email protected] 28/10/2002 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: [SQL0206] Column CONFIGKEY not in specified tables.
    INTERNAL EXCEPTION: java.sql.SQLException: [SQL0206] Column CONFIGKEY not in specified tables.
    How to I solve this issue?
    Thanks,
    Harini

    Hi,
    The "ReadObjectQuery" in a descriptor's query manager can only be used to change the primary key read query. It will be used only for a ReadObjectQuery that either has a selection key, selection object, or an expression that exactly matches the primary key.
    If you have a non-primary key query that you want to use, you can add it as a named query to the descriptor's query manager.
    I'm not sure of the primary key of your descriptor, assuming that it is a 3 part composite key, then your ReadObjectQuery procedure is defined correctly in the descriptor. However the ReadObjectQuery is incorrect, you must use "get" not "getField", also you must use a single expression builder.
    i.e.
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expr = (builder.get("category").equal("GOESVC.GETTDEV")).and(
    builder get("configKey").equal("GOESVC.REQ")).and(
    builder.get("value").equal("$ENV.$ORIGIN.GOESVC.REQ"));
    ReadObjectQuery query = new ReadObjectQuery(Configuration.class, expr);
    session.executeQuery(query);
    you could also do,
    Vector key = new Vector(3);
    key.add("GOESVC.GETTDEV");
    key.add("GOESVC.REQ");
    key.add("$ENV.$ORIGIN.GOESVC.REQ");
    ReadObjectQuery query = new ReadObjectQuery(Configuration.class);
    query.setSelectionKey(key);
    session.executeQuery(query);
    If the descriptor primary key is not 3 part, then add this query as a named query.
    Descriptor desc=evt.getSession().getDescriptor(Configuration.class);
    ReadObjectQuery query = new ReadObjectQuery();
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("CONFIGSVC");
    call.addUnamedArgument("CATEGORY");
    call.addUnamedArgument("CFGKEY");
    call.addUnamedArgument("VALUE");
    query.setCall(call);
    query.addArgument("CATEGORY");
    query.addArgument("CFGKEY");
    query.addArgument("VALUE");
    desc.getQueryManager().addQuery("findConfigSVC", query);
    To execute the query,
    Vector arguments = new Vector(3);
    arguments.add("GOESVC.GETTDEV");
    arguments.add("GOESVC.REQ");
    arguments.add("$ENV.$ORIGIN.GOESVC.REQ");
    session.executeQuery(Configuration.class, "findConfigSVC", arguments);

  • Reference to entity must end with ;

    Hi All,
    My application uses SAX parser to strip and parse the incoming xml file. My problem is whenever the payload contains L@amp;T symbol, it is throwing 'SAX Exception saying that Reference to the entity must end with ;'.
    But, i could open the xml file using xml tool such as xml spy and xml notepad. And as far i know, @amp; is valid representation in xml. I really don't understand why i am getting this exception?
    For testing purpose i put one more ';' at the end of '&' like 'L&;T'. The file was processed successfully and in the output i saw 'L&;T', which was supposed to be L&T.
    I will post the problamatic file as well as the exact exception phrase in my next post. In the meantime, if anybody encountered this problem before, kindly let me know the root cause of this problem and the way to resolve it.
    Your earlier advice is greatly appreciated.
    Thanks in advance for your time.
    Thanks and regards,
    ravi.

    What happens if you use
    L@amp;T
    Hi All,
    My application uses SAX parser to strip and parse the
    incoming xml file. My problem is whenever the payload
    contains L@amp;T symbol, it is throwing 'SAX
    Exception saying that Reference to the entity must
    end with ;'.
    But, i could open the xml file using xml tool such as
    xml spy and xml notepad. And as far i know, @amp; is
    valid representation in xml. I really don't
    understand why i am getting this exception?
    For testing purpose i put one more ';' at the end of
    '&' like 'L&;T'. The file was processed
    successfully and in the output i saw 'L&;T', which
    was supposed to be L&T.
    I will post the problamatic file as well as the exact
    exception phrase in my next post. In the meantime, if
    anybody encountered this problem before, kindly let
    me know the root cause of this problem and the way to
    resolve it.
    Your earlier advice is greatly appreciated.
    Thanks in advance for your time.
    Thanks and regards,
    ravi.What happens if you use

  • HttpStatusCode from an EWS Managed API call

    Hi there,
    I am in the process of converting a service from using WebDAV to the EWS Managed API for data access to an Exchange server (client is moving from Exchange 2007 to 2013). This service polls a mailbox folder, does some processing on emails that arrive there,
    and deletes or moves the emails once it is completed. The code I am working with has been using the status code from the HttpWebResponse returned from WebDAV requests for logging as well as handling WebExceptions (which have a response property for access
    to the request status).
    What I am wondering is whether the same status information is available for an EWS Managed API call - will calling Send() on a new EmailMessage always throw an exception if it is not successful? What are the common exception types to handle? So far I have
    simply been assuming success or exception and handling the WebException to get a status code if one of those is thrown. I will be starting to test against the new code shortly but it would be great if I had a better idea of whether I need to do more to handle
    call failures. I am quite new to developing against Exchange.
    Cheers,
    Richard

    Thanks for the quick reply Glen.
    Unfortunately none of the Managed API calls I'm making return ServiceResponseCollections which means there are no response messages for me to refer to so I'll just have to rely on the exception handling to log what has gone wrong.
    The only ExchangeService method I'm calling is FindFolders() and I'm calling FindItems() on the Folder class and Send(), Move(), and Delete() on the EmailMessage class. The linked page does state that any methods that don't return a response collection will
    throw an exception if the method does not complete successfully so I guess that is good enough for me.
    But also in the page you've linked to it appears I should be handling ServiceResponseExceptions if I want to access the response (and its error code) to get more information about the cause of an exception.
    It's a shame that the last ServiceResponseCollection from an EWS call is not available on the ExchangeService like the HttpResponseHeaders are.
    Thanks again!

  • Enable Batch Management w/o removing Stock

    Hi!
    We would like to start using the feature of batch number in SAP BO.
    Right now all item are set to "Manage Item by None" on the General Tab under Item Master Data. We manage batches in a separate Excel spreadsheet. Not good, I know
    Is there a way to enable Batch Management w/o removing the stock?
    If not, what would be the best way to solve the problem?
    Thanks for your help,
    Christian

    Yes that is how we are going to do it:
    1. Run an Inventory Audit Report, export it to Excel and divide *** Value/ *** Qty
    2. Create a Goods Issue for all Inventory with price calculated in 1.
    3. Set "Manage by" in Item Management to "Batches"
    4. Run Inventory Audit Report see how much was released at what cost in step 2
    5. Create a goods receipt in the same order (and same price)
    as stock was released in step 2
    Unfortunately I don't see a way to do this other than manually!?

  • [svn:bz-trunk] 13051: + add the connection-manager property called cookie-policy to the HTTPProxyAdapter adapter-definition designated for code coverage

    Revision: 13051
    Revision: 13051
    Author:   [email protected]
    Date:     2009-12-17 06:58:47 -0800 (Thu, 17 Dec 2009)
    Log Message:
    + add the connection-manager property called cookie-policy to the HTTPProxyAdapter adapter-definition designated for code coverage
    Checkintests: passed with 2 failures that I had prior to adding changes.  I'll dig in some more to see if I can figure out why I'm getting these failures on my Mac
    Modified Paths:
        blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/proxy-config.mods.xml

  • How to manage my call logs on att z 10.

    How to manage my call logs on att z 10.   I need to keep my call log for business purposes and they disappeared today.  I may have accidentally deleted them but I need to find out how to save and avoid deleting in the future.

    Deleted call logs cant be restored.
    There is no special way to save it, just be careful not to tap the Clear Log option.
    If my post has helped you, give it a LIKE

  • An exception occured within the external code called by a Call Library function Node

    Good Morning,
    I built a VI that contains Matlab nodes in Labview 8.0.  I made an executable and gave it to a colleage to use who is running Windows XP.  I see in the folder C:\Program Files\National Instruments\Shared\LabVIEW Run-Time that she has 7.1 and 8.0 run time engines installed.
    On Friday the executable ran great on her machine.  Today, when she tried running it I received the following error.  "LabVIEW:  An exception occured within the external code called by a Call Library Function Node.  This might have corrupted LabVIEW's memory.  Save any work to a new location and restart LabVIEW.  'my vi' was stopped at node 0x0 of subVI "NI_AALBase.lvlib:Real A x B.vi:1".  This error occured after part of the program ran properly.  More specifically, two of the matlab nodes ran perfectly.  I am unsure about the third because the program stopped too early.  I do have to multiply two matrices using the subvi Real A x B.  Is this causing the error?
    I also saw this error when I installed it on another computer.  However I do not see this error when I run the executable or the main vi on my machine  I know there are other discussions on this topic, however I do not know why it would affect some machines and not others.  Also, I do not know why it would work on Friday and not on Monday.  Should I have checked the box that said "Enable Debugging" under the advanced section when building the executable?
    If anyone could help, I would be very appreciative.
    Thanks,
    -Richard

    molecularvisions wrote:
    Good Morning,
    I built a VI that contains Matlab nodes in Labview 8.0.  I made an executable and gave it to a colleage to use who is running Windows XP.  I see in the folder C:\Program Files\National Instruments\Shared\LabVIEW Run-Time that she has 7.1 and 8.0 run time engines installed.
    On Friday the executable ran great on her machine.  Today, when she tried running it I received the following error.  "LabVIEW:  An exception occured within the external code called by a Call Library Function Node.  This might have corrupted LabVIEW's memory.  Save any work to a new location and restart LabVIEW.  'my vi' was stopped at node 0x0 of subVI "NI_AALBase.lvlib:Real A x B.vi:1".  This error occured after part of the program ran properly.  More specifically, two of the matlab nodes ran perfectly.  I am unsure about the third because the program stopped too early.  I do have to multiply two matrices using the subvi Real A x B.  Is this causing the error?
    This is most likely an error with the use of the Call Library Node, but not in the Real A x B.vi itself. This is a VI that comes with LabVIEW and has been tried and tested many times and unless your LabVIEW installation is messed up simply shouldn't fail in such a way on its own.
    However you do include Matlab code somewhere and that might be more likely to cause this. Are you using the built in MathScript node or some other way to communicate directly to a Matlab DLL or such?
    Are you using anywhere Call Library Nodes that you have created or that did at least not come standard with LabVIEW?
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • No exception of type BPMIdentityNotFoundException can be thrown; an exception type must be a subclass of Throwable.

    How to solve this exception.
    I downloaded this jar  bpm-services.jar and i am using " LocalIdentityService.getManager(user);" this method from it which throws two exception : BPMIdentityNotFoundException, BPMIdentityException
    but i am getting compile time error as:
    "No exception of type BPMIdentityNotFoundException can be thrown; an exception type must be a subclass of Throwable"
    How to solve this error ?
    Help will be appreciated.

    Hi,
    The above provided code works fine,  As you are using SDK Exception that requires the package "com.crystaldecisions.sdk.exception.SDKException" need to be imported in the code.
    Please provide the references for ISessionMgr , and IEnterpriseSession as mentioned below.
    String username = "Administrator";
    String password = "";
    String CMS = "localhost";
    String Authen = "secEnterprise";
    try {
    ISessionMgr sm = CrystalEnterprise.getSessionMgr();
    IEnterpriseSession es = sm.logon(username, password, CMS, Authen);
    } catch (SDKException sdkException)
            out.println(sdkException.getMessage());
         out.println("The code runs.. !");
    Hope this works
    Regards,
    Rameez

  • Sign Up for NEW APJ Business Process Management Experts Call

    APJ Business Process Management Experts Call
    SAP is announcing a Business Process Management Experts Call for Asia Pacific. During this new bi-monthly call, we will share customer experiences on BPM, discuss BPM trends & directions, and discuss solutions to common BPM problems.
    Date:   20 Aug, Thursday*
    *Time:   2pm SG / 4pm Sydney / 11.30am Mumbai
    [Click here to see the full invite in your browser|http://www28.sap.com/mk/get/APJ_09_BPM_EXPERTS_AUG18_INV]
    [Sign Up Here |http://www.sap-webinars.com/bus_process_mgmt/register.php]
    On our first call, the following topics will be covered:
         u2022 Evolution to BPMN 2.0 - Learn about why Business Process Modeling Notation (BPMN) 2.0 is an important step forward for business process standards and why it needs to be in your IT and business process roadmap
         u2022 Proving the BPM ROI - Learn how an APJ customer is planning to save more than USD 20K a year from one process
         u2022 SAP's Process Modelling Strategy - Learn about the common process layer, a common design- and runtime layer for business processes catering the needs for developers, process architects as well as business process experts
    [Register for this webcast|http://www.sap-webinars.com/bus_process_mgmt/register.php] on Aug 20, Thursday at 2pm (SG) by clicking on the link above.
    Edited by: Adelyne Loke on Aug 17, 2009 10:29 AM

    SIGN UP FOR #2 BPM EXPERTS CALL ON NOV 17 (@ 1PM SG TIME)
    In this 2nd session of the BPM Experts call series, our BPM expert will share with you how BPM can be made more accessible to the general business user.
    Discover some of the upcoming technology features from SAP that can help speed up the adoption of BPM within your organization. You will learn about some of the BPM Research work we are advancing with Web 2.0 technology from Google, and look at how we can use Adobe forms for increased office productivity.
    We will also take this opportunity to share one of our customer's experiences with BPM Methodology, and why having the right methodology is important to a sustainable BPM initiative in your organization.
    Register for this webcast on Nov 17, Tuesday at 1pm (SG) below.
    To view the eDM on your browser: [Click Here|http://www28.sap.com/mk/get/SG_09_BPMXPERTS_NOV17_INV]
    REGISTER FOR BUSINESS PROCESS MANAGEMENT WEBCAST
    Date: 17 Nov, Tuesday
    Time: 1.00pm SG / 4.00 pm Sydney / 10.30am Mumbai
    [Register Here|http://sap-webinars.com/bpm_experts_call/register.php]

  • Thor.API.Exceptions.tcAPIException: The specified manager causes cycles.

    Hi experts,
    Do you people know the cause of this exception :
    Thor.API.Exceptions.tcAPIException: The specified manager causes cycles.
    I am trying to update all active user in OIM.
    while updation for one of the user whose manager is xelsysadm I am getting this exception.
    Thanks,
    Pallavi

    Example:
    User A is manager of User B and User B is manager of User C and you are trying to assign User C as manager of User A then it shows this error.
    Please check into your OIM.
    User A - User B - User C - User A (Again - Making Cycle)

  • After upgrading to iOS7 I lost all sound for my 4S except for the ring when someone calls. I can't listen to music, I don't get text or email notifications. I have tried rebooting?

    Following upgrading to iOS7 I lost all sound for my 4s except for the ring when someone calls. I can't listen to music, I don't get text or email notifications. I have tried a wipe and reinstall, I've tried hard rebooting, I tried erasing all of my music and reinstalling it, I checked my Do Not Disturb, and I tried the AssistiveTouch mute button. Nothing. I can't even play music through bluetooth or headphones. Can anyone help please as its driving me mad!

    I experience this problem too. I am using iPhone4 and just upgrade it to iOS7. And now I can not make outgoing call. I checked all the setting, and nothing wrong. I even replaced my sim card with the new one, still can not help.
    I read this link
    https://discussions.apple.com/thread/5322252
    and I try dial *#31#, it help, but not permanent solution.

  • Error #2025:The supplied DisplayObject must be a child of the caller - Removing Object from Array

    Hi guys, I'm pretty new to as3 and I'm trying to make a game where the player supposedly clicks on the stage and 3 towers which I've spawned dynamically should shoot towards the area. Everything works in terms of tower rotation, etc, but the bullets will not be removed from the stage when I exit the level into another scene. The boundary checking is fine, too.
    Here's a part of the code in the Main.as file.
    private function clickTower1(e:MouseEvent):void
    for each (var tower1:mcTower1 in tower1Array)
    var newLaser1:mcLaser1 = new mcLaser1();
    newLaser1.rotation = tower1.rotation;
    newLaser1.x = tower1.x + Math.cos(newLaser1.rotation * Math.PI / 180) * 40;
    newLaser1.y = tower1.y + Math.sin(newLaser1.rotation * Math.PI / 180) * 40;
    newLaser1.addEventListener(Event.ENTER_FRAME, laser1Handler);
    tower1BulletArray.push(newLaser1); stage.addChild(newLaser1);
      private function laser1Handler(e:Event):void
    //Make laser move in direction of turret.
    var newLaser1:MovieClip = e.currentTarget as MovieClip;
    newLaser1.x += Math.cos(newLaser1.rotation * Math.PI / 180) * laser1Speed;
    newLaser1.y += Math.sin(newLaser1.rotation * Math.PI / 180) * laser1Speed;
    //Boundary checking if (newLaser1.x < -50 || newLaser1.x > 800 || newLaser1.y > 600 || newLaser1.y < -50)
    newLaser1.removeEventListener(Event.ENTER_FRAME, laser1Handler); stage.removeChild(newLaser1);
    tower1BulletArray.splice(0, 1);
    I have a function called exitLevel, which basically, as the name states, exits the level when a button is clicked. It worked perfectly before I started coding the bullets.
        private function exitLevel(e:MouseEvent):void
    stage.frameRate = 6;
    gamePaused = false;
    clearLevel();
    gotoAndStop(1, 'exitLevel');
    btnExitLevel.addEventListener(MouseEvent.CLICK, levelSelect1);
      private function clearLevel():void
    stage.removeEventListener(Event.ENTER_FRAME, update);
    stage.removeChild(buttonCreep1); stage.removeChild(buttonCreep2);
    for (var i = creep1Array.length - 1; i >= 0; i--)
    removeChild(creep1Array[i]);
    creep1Array.splice(i, 1);
    //trace ("Creep1 Removed");
    for (var j = creep2Array.length - 1; j >= 0; j--)
    removeChild(creep2Array[j]);
    creep2Array.splice(j, 1);
    //trace ("Creep2 Removed");
    for (var k = tower1Array.length - 1; k >= 0; k--)
    removeChild(tower1Array[k]); tower1Array.splice(k, 1);
    for (var l = tower1BulletArray.length - 1; l >= 0; l--)
      stage.removeChild(tower1BulletArray[l]);
    tower1BulletArray.splice(0, 1);
    After debugging, it says the error is at the end, where i try to remove the child from the stage. What is wrong? Sorry, I'm a beginner at as3 so any answers might have to be spoonfeeding... I'll try to learn and understand, though. Thanks!
    I did take some of the code off of a guide on the web, and I don't understand it totally, so can someone explain to me what this code does as well? What is e.currentTarget? Thanks!
    var newLaser1:MovieClip = e.currentTarget as MovieClip;
    Here's the full .as file if anybody wants to take a look. http://pastebin.com/5ff4BQa5

    Hi, I managed to solve the errors (kind of) by using this code.
    for (var i:int = tower1BulletArray.length - 1; i >= 0; i--)
    if (tower1BulletArray.parent)
    tower1BulletArray[l].parent.removeChild(tower1BulletArray[l]);
    tower1BulletArray.splice(i, 1);
    However, the problem still persists that the bullets stay in the screen after I change the scene. Any solution? Thanks!

  • New Entity is not managed?

    I have created several EJB 3.0 persistence Entities using the wizard provided by netBeans 5.5 all with success. However, when I try to create my own persistent entity outside the wizard, I get an error when trying to use the .refresh method on it.
    Why would it be a non managed object?
    EJB5018: An exception was thrown during an ejb invocation on [PromoFacade]
    javax.ejb.EJBException
    at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:118)
    at $Proxy244.findByRootandPrefix(Unknown Source)
    at highsmith.servlets.AddTo.processRequest(AddTo.java:185)
    at highsmith.servlets.AddTo.doGet(AddTo.java:247)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
    at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
    at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
    at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
    at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
    at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: java.lang.IllegalArgumentException: Can not refresh not managed object: [highsmith.entities.Promo[item_number=10078]].

    Here is the code for the entire entity. it includes the code to declare the entity manager. I am not doing anything else except declaring the em object.
    * PromoFacade.java
    * Created on March 14, 2007, 8:37 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package highsmith.ejbs;
    import highsmith.entities.Promo;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    * @author pamadon
    @Stateless
    public class PromoFacade implements PromoFacadeLocal {
         @PersistenceContext
         private EntityManager em;
        /** Creates a new instance of PromoFacade */
        public PromoFacade() {
         public void create(Promo promo) {
              em.persist(promo);
         public void edit(Promo promo) {
              em.merge(promo);
         public void destroy(Promo promo) {
              em.merge(promo);
              em.remove(promo);
         public Promo find(Object pk) {
              return (Promo) em.find(Promo.class, pk);
         public List findAll() {
              return em.createQuery("select object(o) from Promo as o").getResultList();
         /** Created 03/14/07 PA
         * creates a new List of Promo instances using the root.
         public List findByRoot(String root) {
             //  built by PA
                Query query = em.createNamedQuery("Promo.findByRoot");
             query.setParameter("root", root);
             List<Promo> list = (List) query.getResultList();
                em.refresh(list);
             return list;
         /** Created 03/14/07 PA
         * creates a new instance of Promo using the root and prefix.  Returns a single promo instance
         public Promo findByRootandPrefix(String root, String prefix) {
             //  built by PA
                Query query = em.createNamedQuery("Promo.findByRootandPrefix");
             query.setParameter("item_number", root+"%");
             query.setParameter("prefix", prefix);
             List <Promo>list = (List) query.getResultList();
             em.merge(list);
                em.refresh(list);
             Promo returnedPromo = null;
             for (Promo promo : list) {
             //  just loop thru the list & return the last one.  if any root/suffix combo is on promo, the entire root will be too by rule.
              returnedPromo = promo; 
             return returnedPromo;
    }Thanks!

  • Fatal initialization exception occurs when starting Managed Server

    Hi all,
    First I configured a Adminisistration server and started it. After that I added
    a another server as ManagedServer.These two points to the same Weblogic server.
    When I try to start Managed server by running the script, it gave me following
    error. _______________________________
    <Jun 25, 2001 5:25:11 PM GMT+06:00> <Emergency> <Server> <Unable to initialize
    the server: 'Fatal initialization exception Throwable: java.lang.IllegalAccessError:
    java.security.acl.NotOwnerException java.lang.IllegalAccessError: java.security.acl.NotOwnerException
    at weblogic.security.acl.Realm.getRealm(Realm.java:91) at weblogic.security.acl.Realm.getRealm(Realm.java:36)
    at weblogic.security.acl.Realm.authenticate(Realm.java:183) at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java:233)
    at weblogic.security.acl.internal.Security.authenticate(Security.java:116) at
    weblogic.jndi.WLInitialContextFactoryDelegate.pushUser(WLInitialContextFactoryDelegate.java:444)
    at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:287)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:259)
    at weblogic.jndi.Environment.getContext(Environment.java:135) at weblogic.jndi.Environment.getInitialContext(Environment.java:118)
    at weblogic.management.Admin.initializeRemoteAdminHome(Admin.java:891) at weblogic.management.Admin.start(Admin.java:305)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:331) at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:169)
    at weblogic.Server.main(Server.java:35) ______________________________________________
    I suspect reason for this might be weblogic.policy file. There you need to edit
    some lines replacing the location of the directory in which you installed WebLogic
    Server. I did this but still error occurs.
    Do u have any idea why above error occurs and if it is due to the weblogic.policy
    file entry please tell me how it correctly done.
    I am using WL60(sp2)in Win NT,
    My installed dir: E:\bea\wlserver6.0\
    Thanks Nalika

    Hi
    (It was me and Berit that sent the original question).
    After some experimentation we saw that the managed server did get
    some configuration from the admin server, so the problem was in
    there somewhere.
    I had added an (empty) cluster and machine to the admin server, just
    to test adding. When I removed them everything worked fine afterward.
    So it was some kind of configuration error from our side, but we never
    did find out what it was.
    I guess the lesson is to only define things when you really need them :-)
    Regards
    Mikael
    Timothy Fry wrote:
    We're getting the same problem, but on Solaris 2.7.
    Did you get a solution from bea yet?
    Tim
    "Berit Bylund" <[email protected]> wrote in message
    news:[email protected]..
    Hello
    We are trying to start a managed server (under the examples
    domain, NT 4.0, WLS 6.0 Beta 2)
    We start the managed server with the parameter
    -Dweblogic.management.server=http://127.0.0.1:7001

Maybe you are looking for

  • Lumia Audiobook, Music and Video Functionality

    WP8 appears to completely lack the most basic Audiobook functioanlity. No seek/skip in audio or video? No bookmarking or remembering location in files?! I mean... I would like to see more advanced functionality specific to Audiobooks but these types

  • Fm for retrieving subordinates details when manager employeeid is given.

    Hi, is there any function module to retrieve the subordinate details when managers employee id is given other than BAPI_EMPLOYEE_GETDATA. for this requirement a fm is to be created.so can i know what are the basic fm's that could be included in the m

  • Export and Re-import bulk PTR reverse lookup records

    Hi, If I were to export an existing zone let's say 0.168.192 which has hundreds of PTR records and I want to create new zones 1.168.192, 2.168.192, 3.168.192 and so on - what would be the best action of exporting this whole zone (0.168.192) and impor

  • Installing Oracle8i Std Edition

    I have installed Oracle and run the Database Assistant. I did not create a database, but created the script files instead. I have a user called "oracle", member of "dba" who I used to install oracle. If I log in as oracle though, I cannot run svrmgrl

  • Crashes with source sequences in timeline

    Hey Guys, I use the new feature of making my selects from a sequence as a source timeline. However I get crashes about 40% of the time when I close one of the sequences tabs. Also I get this message. then: Anyone experience this? I am running: Premie