Mysql w/ JDeveloper EJB Named Query Error

I have the following named query:
@NamedQuery(name = "Node.topParent", query = "select o from Node o where o.node is null")
However, when converted to a SQL query (connected to MySQL) it shows:
select * from "node" where (parentId IS NULL)
The "node" causes MySQL to error however if I manually remove them then it works. Why is the query using "" and how can I configure it to by MySQL compliant?
Thanks in advance,
Kris

Appears that by default JDeveloper uses \" in the annotations for table name.

Similar Messages

  • Help with EJB Named Query

    How do you reference a user-defined database function in an EJB Named Query. There doesn't seem to be any problems in using built in functions like max and min. Any help is greatly appreciated.

    A little more information. It seems I have to retract one thing I said, I stated that the internal functions of the database were ok, this is incorrect. If I use the upper function in a named query I get the following.
    example:
    Internal Exception: Exception [TOPLINK-0] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.EJBQLException
    Exception Description: Syntax Recognition Problem parsing the EJBQL [select object(o) from SysUsers o where o.racfId = :racfId and o.inactiveDate is null and upper(o.pswd) = :pswd]. The parser returned the following [unexpected token: upper].
    In this example query I am trying to use the database upper function. Any Help?
    Thanks

  • Named Query Error

    Hi,
    I'm having trouble passing argument to a named query in the mapping workbench.
    Here is my SQL:
    SELECT COUNT(*) FROM VALID_PARTY_CLASSIF, CLASSIF_TYPE WHERE CLASSIF_TYPE.CLASSIF_TYPE_ID = VALID_PARTY_CLASSIF.CLASSIF_TYPE_ID AND CLASSIF_TYPE.CLASSIF_TYPE_ID = #ID
    and when I find and execute the query, getting following error
    Execute query ReadObjectQuery(com.amgen.bria.business.bizobject.ClassificationTypeBO)
    SELECT COUNT(*) FROM VALID_PARTY_CLASSIF, CLASSIF_TYPE WHERE CLASSIF_TYPE.CLASSIF_TYPE_ID = VALID_PARTY_CLASSIF.CLASSIF_TYPE_ID AND CLASSIF_TYPE.CLASSIF_TYPE_ID = ?
         bind => [56]
    Exception [TOPLINK-6044] (OracleAS TopLink - 10g (9.0.4) (Build 031018)): oracle.toplink.exceptions.QueryException
    Exception Description: The primary key read from the row [DatabaseRow(
         => 0)] during the execution of the query was detected to be null. Primary keys must not contain null.
    Query: ReadObjectQuery(com.amgen.bria.business.bizobject.ClassificationTypeBO)Local Exception Stack:
    Exception [TOPLINK-6044] (OracleAS TopLink - 10g (9.0.4) (Build 031018)): oracle.toplink.exceptions.QueryException
    Exception Description: The primary key read from the row [DatabaseRow(
         => 0)] during the execution of the query was detected to be null. Primary keys must not contain null.
    Query: ReadObjectQuery(com.amgen.bria.business.bizobject.ClassificationTypeBO)
         at oracle.toplink.exceptions.QueryException.nullPrimaryKeyInBuildingObject(QueryException.java:541)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:262)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:226)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:344)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:498)
         at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:111)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1968)
         at oracle.toplink.threetier.ServerSession.internalExecuteQuery(ServerSession.java:629)
         at oracle.toplink.threetier.ClientSession.internalExecuteQuery(ClientSession.java:392)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1096)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1065)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:966)
         at com.amgen.bria.persistence.module.toplink.TopLinkPersistenceService.internalExecuteQuery(TopLinkPersistenceService.java:137)
         at com.amgen.bria.persistence.PersistenceService.executeQuery(PersistenceService.java:97)
         at com.amgen.cma.persistence.service.ClassificationPersistenceService.findCustomerForClassifTypeCount(ClassificationPersistenceService.java:405)
         at com.amgen.cma.persistence.service.ClassificationPersistenceServiceTest.testFindCustomerForClassifTypeCount(ClassificationPersistenceServiceTest.java:193)
         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 junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
    client released
    Please let me know if I am missing anything.
    Thanks
    Saket

    Saket, the problem is right here:
    ReadObjectQuery(com.amgen.bria.business.bizobject.Clas
    ificationTypeBO)
    When you read a an object mapping back, the primary key you have specified for that object mapping in Toplink has to be part of this search criteria (it is how it's stored in toplink's identity map/cache)
    Since you are only executing a 'select count(*)', it is erroring out
    HTH,
    Sean

  • EJB QL query error... why??

    Ok, so I'm getting an error in my EJB QL and don't know why... do you see anything strange in this query? I append the whole error from the deploytool's verifier. I've double checked that countryBranch exists as a CMR field in BranchCatalog. Any idea?
    Error: [ select object(bc) from BranchCatalog bc, in (bc.countryBranch) cb where cb = ?1 ] has parsing error(s)
    Exception occured : [Encountered "in ( bc . countryBranch )" at line 1, column 24.
    Was expecting one of:
        "AbstractSchemaName" ...
        "IN" "(" "IdentificationVar" "." "SingleValuedCmrField" "." ...
        "IN" "(" "IdentificationVar" "." "CollectionValuedCmrField" ...
    EJB QL statement : 'select object(bc) from BranchCatalog bc, in (bc.countryBranch) cb where cb = ?1'
    EJB QL method    : public abstract com.actaris.eprocurement.domain.catalog.LocalBranchCatalog com.actaris.eprocurement.domain.catalog.LocalBranchCatalogHome.findByCountryBranch(com.actaris.eprocurement.domain.organization.LocalCountryBranch) throws javax.ejb.FinderException
    eProcurement: Some tests failed.

    This my ejb-jar.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!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>
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>Product</display-name>
    <ejb-name>Product</ejb-name>
    <home>Project.ProductHome</home>
    <remote>Project.Product</remote>
    <local-home>Project.ProductLocalHome</local-home>
    <local>Project.ProductLocal</local>
    <ejb-class>Project.ProductBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Long</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Product</abstract-schema-name>
    <cmp-field>
    <field-name>productid</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>productname</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>productactive</field-name>
    </cmp-field>
    <primkey-field>productid</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params/>
    </query-method>
    <ejb-ql>select object(o) from Product o</ejb-ql>
    </query>
    </entity>
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>Project</display-name>
    <ejb-name>Project</ejb-name>
    <home>Project.ProjectHome</home>
    <remote>Project.Project</remote>
    <local-home>Project.ProjectLocalHome</local-home>
    <local>Project.ProjectLocal</local>
    <ejb-class>Project.ProjectBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Long</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Project</abstract-schema-name>
    <cmp-field>
    <field-name>projectid</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>projectname</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>projectactive</field-name>
    </cmp-field>
    <primkey-field>projectid</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params/>
    </query-method>
    <ejb-ql>select object(o) from Project o</ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByProjectname</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql>select object (o) from Project o where o.projectname = ?1</ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByProjectproduct</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql>select object (o) from Project as o, in (o.projectproduct) as p where p.productname = ?1 and o.projectactive = ?2</ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <relationships>
    <ejb-relation>
    <ejb-relation-name>Project - Product</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Project may have one Product</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <relationship-role-source>
    <ejb-name>Project</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>product_projectproduct</cmr-field-name>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>Product may have many Project</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>Product</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>project_projectproduct</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>Product</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>Project</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>

  • EJB QL query error

    Hi,
    When I deploy my EJB application and run the client application, I get an error that says :
    RemoteException occured in server thread
    No EJB QL defined for public abstract "findByLastName" method.
    I am using CMP and in the J2EE deployment wizard, I have given the SQL query for the method but its not displaying the EJB QL. Dont know why..
    Is there any settings that needs to be done to make the container generate and display the EJB QL ?
    Somebody please guide me..
    Thanks

    Hi,
    I tried writing the EJB QL qeuery for the method "findByLastname" and when I say "Generate default SQL" it says :
    " The SELECT clause has a return type that does not match with the return type of the select query for which it was defined."
    I just need to select all rows which have the lastnames that is supplied as the input parameter to the find method.
    The EJB QL query I wrote was:
    SELECT OBJECT(p) FROM Customer p WHERE p.lastname= ?1
    I have defined the find method to return of type "Enumeration"
    I am not sure what the mistake is.
    Help me out..
    Thanks

  • JDeveloper, JPA named query String parameter with length of 1

    Hi,
    I use JDeveloper 11.1.1.2.0. and have the following table:
    CREATE SEQUENCE COUNTRY_SEQ;
    CREATE TABLE COUNTRY (
    COUNTRY_ID NUMBER NOT NULL,
    COUNTRY_NAME VARCHAR2(40),
    COUNTRY_CODE CHAR(2) NOT NULL,
    CONSTRAINT COUNTRY_ID_PK PRIMARY KEY (COUNTRY_ID)
    INSERT INTO COUNTRY VALUES (COUNTRY_SEQ.NEXTVAL, 'Belgium', 'B');
    INSERT INTO COUNTRY VALUES (COUNTRY_SEQ.NEXTVAL, 'Netherlands', 'NL');
    COMMIT;
    I made a JPA Entity with two queries:
    @NamedQueries({
    @NamedQuery(name = "Country.findAll", query = "select o from Country o"),
    @NamedQuery(name = "Country.findByCountryCode", query = "select o from Country o where o.countryCode = 'B' or o.countryCode ='NL'")
    The first works fine, gives back both B and NL. But the second gives back only NL. I have no clue why.
    If I change 'B' to 'BE' both in the DB and the code, it works. If I change to 'b', it doesn't. So it seems that the problem comes with 1 char long Strings.
    Is it an EclipseLink bug?
    I use Oracle Database 11g Enterprise Edition Release 11.1.0.7.0. But
    SELECT COUNTRY_ID, COUNTRY_NAME, COUNTRY_CODE FROM COUNTRY WHERE COUNTRY_CODE = 'B' OR COUNTRY_CODE = 'NL';
    works in SQL*Plus.
    Thx, Donat

    Hi,
    That's true, it uses value bindings while the values are hard coded. I use the default EclipseLink embedded into JDeveloper 11.1.1.2, with the default settings. The JPA bean runs in the default embedded WebLogic of JDeveloper. This might be a default setting of EclipseLink to use bindings for hard coded values.
    Here is a fragment of Country.java:
    @Entity
    @NamedQueries({
    //@NamedQuery(name = "Country.findAll", query = "select o from Country o")
    @NamedQuery(name = "Country.findAll", query = "select o from Country o where o.countryCode ='B' or o.countryCode ='NL'")
    public class Country implements Serializable {
    @Id
    @Column(name="COUNTRY_ID", nullable = false)
    private Long countryId;
    @Column(name="COUNTRY_CODE", nullable = false)
    private String countryCode;
    @Column(name="COUNTRY_NAME", length = 40)
    private String countryName;
    And I have a JavaServiceFacade.java:
    public class JavaServiceFacade {
    private EntityManagerFactory emf = Persistence.createEntityManagerFactory("EjbModel-1-Outside");
    public JavaServiceFacade() {
    public static void main(String [] args) {
    final JavaServiceFacade javaServiceFacade = new JavaServiceFacade();
    List<Country> countries;
    countries = javaServiceFacade.getCountryFindAll();
    for (Country country : countries) {
    System.out.println(country.getCountryCode());
    private EntityManager getEntityManager() {
    return emf.createEntityManager();
    /** <code>select o from Country o</code> */
    public List<Country> getCountryFindAll() {
    return getEntityManager().createNamedQuery("Country.findAll").getResultList();
    BR, Donat

  • AVG calculation and syntax error while parsing a named query

    Hi all,
    I've to calcolate the average of polling results for each value column (5 value column in total). I want to use this single row result line for a bar graph.
    I created a new named query in the EJB:
    @NamedQueries({
      @NamedQuery(name = "Polls.findAll", query = "select o from Polls o"),
      @NamedQuery(name = "Polls.findAVG", query = "select o AVG(Value1) as Value1, AVG(Value2)  as Value2, AVG(Value3)  as Value3, AVG(Value4)  as Value4, AVG(Value5)  as Value5 o from Polls o")   // <-- my named query
    ...I tried it in the sql query tool of Oracle 10g XE and sql syntax is ok, but when I run my javaServiceFacade on JDev I receive this message:
    Exception in thread "main" Local Exception Stack:
    Exception [EclipseLink-8023] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.JPQLException
    Exception Description: Syntax error parsing the query [Polls.findAVG: select AVG(Value1) as Value1, AVG(Value2)  as Value2, AVG(Value3) as Value3, AVG(Value4) as Value4, AVG(Value5) as Value5 o from Polls o].
    Internal Exception: org.eclipse.persistence.internal.libraries.antlr.runtime.EarlyExitException
    ...Where is the syntax error in my named query?
    Edited by: Silicio on 22-nov-2008 1.05

    Thanks Shay, now I think syntax is correct for gain an average for each column:
    @NamedQuery(name = "Polls.findAVG", query = "select AVG(o.value1), AVG(o.value2), AVG(o.value3), AVG(o.value4), AVG(o.value5) from Polls o")But still got some trouble to get a bar graph...
    If I drag&drop that query from data control, I get an empty graph with 5 values ,look http://img153.imageshack.us/img153/8710/emptygraphag7.png .
    In the log there is some errors (due that named query and its methods in EJB):
    AVVERTENZA: Transient state added to StateManager.  State may not be serialized.  State id:  data.oracle_view_risultatiPageDef.Polls1__cubicDefinition
    23-nov-2008 11.08.28 oracle.adf.share.http.HttpSessionStateManagerImpl putState
    AVVERTENZA: Transient state added to StateManager.  State may not be serialized.  State id:  data.oracle_view_risultatiPageDef.Polls1__dataModel
    [EL Info]: 2008.11.23 11:08:29.546--ServerSession(20936795)--EclipseLink, version: Eclipse Persistence Services - 1.0.1 (Build 20080905)
    [EL Info]: 2008.11.23 11:08:29.562--ServerSession(20936795)--Server: WebLogic Server Temporary Patch for CR380042 Thu Sep 11 13:33:40 PDT 2008
    [EL Info]: 2008.11.23 11:08:29.562--ServerSession(20936795)--file:/C:/Oracle/Middleware/jdeveloper/system/system11.1.1.0.31.51.56/o.j2ee/drs/Application13/Application13-Model-ejb/-Model login successful
    23-nov-2008 11.08.37 oracle.adfinternal.view.faces.config.rich.RegistrationConfigurator handleError
    GRAVE: Server Exception during PPR, #1
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: groovy.lang.MissingPropertyException, msg=Exception evaluating property 'id' for java.util.Arrays$ArrayList, Reason: groovy.lang.MissingPropertyException: No such property: id for class: java.lang.Double
         at oracle.jbo.ExprEval.internalEvaluateGroovyScript(ExprEval.java:753)
         at oracle.jbo.ExprEval.doEvaluate(ExprEval.java:779)
         at oracle.jbo.ExprEval.evaluateForRow(ExprEval.java:690)
         at oracle.jbo.server.AttributeDefImpl.evaluateTransientExpression(AttributeDefImpl.java:1816)
         at oracle.jbo.server.ViewRowStorage.getAttributeInternal(ViewRowStorage.java:1554)
         at oracle.jbo.server.ViewRowImpl.getAttributeValue(ViewRowImpl.java:1634)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:746)
         at oracle.adf.model.bean.DCDataRow.getAttributeInternal(DCDataRow.java:352)
         at oracle.jbo.server.ViewRowImpl.getKey(ViewRowImpl.java:598)
         at oracle.adf.model.bean.DCDataRow.getKey(DCDataRow.java:149)
         at oracle.adf.model.binding.DCIteratorBinding.buildFormToken(DCIteratorBinding.java:3836)
         at oracle.adf.model.binding.DCBindingContainerState.buildStringBuffer(DCBindingContainerState.java:71)
         at oracle.adf.model.binding.DCBindingContainerState.toString(DCBindingContainerState.java:590)
         at oracle.adf.model.binding.DCBindingContainer.getStateToken(DCBindingContainer.java:4293)
         at oracle.adfinternal.controller.application.model.SaveStateTokenListener.afterPhase(SaveStateTokenListener.java:54)
         at oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.afterPhase(ADFLifecycleImpl.java:529)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchAfterEvent(LifecycleImpl.java:118)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.dispatchAfterPagePhaseEvent(LifecycleImpl.java:166)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.dispatchAfterPagePhaseEvent(ADFPhaseListener.java:122)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:68)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:51)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:354)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:203)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:278)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:102)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: groovy.lang.MissingPropertyException: Exception evaluating property 'id' for java.util.Arrays$ArrayList, Reason: groovy.lang.MissingPropertyException: No such property: id for class: java.lang.Double
         at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:2978)
         at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1368)
         at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:2578)
         at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:178)
         at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:474)
         at Script1.run(Script1.groovy)
         at oracle.jbo.ExprEval.internalEvaluateGroovyScript(ExprEval.java:741)
         ... 50 more
    ## Detail 0 ##
    groovy.lang.MissingPropertyException: Exception evaluating property 'id' for java.util.Arrays$ArrayList, Reason: groovy.lang.MissingPropertyException: No such property: id for class: java.lang.Double
         at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:2978)
         at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1368)
         at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:2578)
         at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:178)
         at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:474)
         at Script1.run(Script1.groovy)
         at oracle.jbo.ExprEval.internalEvaluateGroovyScript(ExprEval.java:741)
         at oracle.jbo.ExprEval.doEvaluate(ExprEval.java:779)
         at oracle.jbo.ExprEval.evaluateForRow(ExprEval.java:690)
         at oracle.jbo.server.AttributeDefImpl.evaluateTransientExpression(AttributeDefImpl.java:1816)
         at oracle.jbo.server.ViewRowStorage.getAttributeInternal(ViewRowStorage.java:1554)
         at oracle.jbo.server.ViewRowImpl.getAttributeValue(ViewRowImpl.java:1634)
         at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:746)
         at oracle.adf.model.bean.DCDataRow.getAttributeInternal(DCDataRow.java:352)
         at oracle.jbo.server.ViewRowImpl.getKey(ViewRowImpl.java:598)
         at oracle.adf.model.bean.DCDataRow.getKey(DCDataRow.java:149)
         at oracle.adf.model.binding.DCIteratorBinding.buildFormToken(DCIteratorBinding.java:3836)
         at oracle.adf.model.binding.DCBindingContainerState.buildStringBuffer(DCBindingContainerState.java:71)
         at oracle.adf.model.binding.DCBindingContainerState.toString(DCBindingContainerState.java:590)
         at oracle.adf.model.binding.DCBindingContainer.getStateToken(DCBindingContainer.java:4293)
         at oracle.adfinternal.controller.application.model.SaveStateTokenListener.afterPhase(SaveStateTokenListener.java:54)
         at oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.afterPhase(ADFLifecycleImpl.java:529)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchAfterEvent(LifecycleImpl.java:118)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.dispatchAfterPagePhaseEvent(LifecycleImpl.java:166)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.dispatchAfterPagePhaseEvent(ADFPhaseListener.java:122)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:68)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:51)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:354)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:203)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:278)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:102)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)I try to print out a singlue AVG value in this way (main method of javaServerFacade class):
        public static void main(String [] args) {
            final JavaServiceFacade javaServiceFacade = new JavaServiceFacade();
            //  TODO:  Call methods on javaServiceFacade here...
            List<Polls> pollsAVG = javaServiceFacade.queryPollsFindAVG();
            for (Polls a: pollsAVG){
                System.out.println(a.getValue1());
    ...I get this error:
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to oracle.model.Polls
         at oracle.model.JavaServiceFacade.main(JavaServiceFacade.java:25)
    Process exited with exit code 1.
    ...I've searched for Ljava in the documantation finding nothing interesting.

  • Named query problem, [TOPLINK-6008] error

    I created a simple table in database (one column, two rows). I created java class and Data Control and dragged the Data Control onto JSP page. Data were shown ok. Then I tried to create named query (simple SELECT MyCol FROM FROM MyTable). This time the new Data Control on JSP didn't work (no data shown). So I tried this scriptlet on jsp:
    <%
    String sDC = "MyDataControl";
    DCDataControl dc = HttpBindingContext.getContext(request).findDataControl(sDC);
    ClientSession cs = ((ToplinkDataControl)dc).getClientSession();
    Vector all = (Vector)cs.executeQuery("MyNamedQuery",mypackage.MyTable.class);
    %>
    Last row causes error
    Exception [TOPLINK-6008] (OracleAS TopLink - 10g (9.0.4) (Build 031126)): oracle.toplink.exceptions.QueryException
    Description: Missing descriptor for [mypackage.MyTable] for query named [MyNamedQuery].
         at oracle.toplink.exceptions.QueryException.descriptorIsMissingForNamedQuery(QueryException.java:282)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:878)
         at dataPage.jspService(dataPage.jsp:26)
    Does anybody have an idea why the jsp page with Data Control based on named query is empty and why above scriptlet causes that error ? Thanks.

    This solution only applies to earlier version of JDeveloper. In 10.1.3 the TopLink metadata (XML deployment descriptor) is automatically generated during the build/make process as required. In earlier version this is a required step after any change is made to the mappings .
    Doug

  • Javax.naming.NameNotFoundException: error in whil calling EJB Bean

    Dear friends,
    I have created (Bean Managed Entity) a remote,home and bean objects for adding a country in a database. When i convert
    into jar and and deploy means, its working fine. But if i put into a package means it does work
    and raise "javax.naming.NameNotFoundException" error.
    i keep my files as following folder structure
    d:\siva\projects\ShopCart\
    (under this )
    CountryMas.java
    CountryHome.java
    CountryBean.java
    CountryMasPK.java
    <meta-inf>
    ejb-jar.xml
    weblogic-ejb-jar.xml
    and deployed in weblogic 6.1 using console.
    i have copied the source code here with
    Remote interface
    package ShopCart;
    import javax.ejb.*;
    import javax.rmi.*;
    public interface CountryMas extends EJBObject {
    Home Interface
    package ShopCart;
    import javax.ejb.*;
    import java.rmi.*;
    public interface CountryHome extends EJBHome {
         public CountryMas create(String Cname) throws CreateException,RemoteException;
         public CountryMas findByPrimaryKey(CountryMasPK pk) throws      
    FinderException,RemoteException;
    BEAN OBJECT
    package ShopCart;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.ejb.*;
    import javax.naming.*;
    public class CountryBean implements EntityBean {
         private EntityContext ctx;
         private int CountryId;
         private String CountryName;
         public void setEntityContext(EntityContext ctx){
              this.ctx = ctx;
         public void unsetEntityContext(){
              this.ctx = null;
         public void ejbActivate(){
         public void ejbPassivate(){
         public void ejbLoad(){
         public void ejbStore(){
         public void ejbRemove(){
              Connection con = null;
              PreparedStatement ps = null ;
              try {
                   con = getConnection();
                   ps = con.prepareStatement("Delete from CountryMas where id=?");
                   ps.setInt(1,CountryId);
                   if (ps.executeUpdate() !=1) {
                        String Error = "JDBC did not create any row";
                        throw new CreateException (Error);
              }catch (Exception e){
                   System.out.println (e);
         public CountryMasPK ejbCreate(String Cname) throws CreateException {
              this.CountryName =Cname;
              Connection con = null;
              PreparedStatement ps = null ;
              try {
                   con = getConnection();
                   ps = con.prepareStatement("insert into CountryMas values(?)");
                   ps.setString (1,CountryName);
                   if (ps.executeUpdate() !=1) {
                        String Error = "JDBC did not delete any row";
                        throw new CreateException (Error);
                   con.commit();
              }catch (Exception e){
                   System.out.println (e);
              int PKid=0;
              ResultSet rs;
              PreparedStatement ps1 = null;
              try {
                   ps1 = con.prepareStatement("select max(id) as Mid from CountryMas");
                   rs = ps1.executeQuery();
                   PKid = rs.getInt("mid");
              }catch(Exception e){
                   System.out.println (e);
              return new CountryMasPK(PKid);
         public void ejbPostCreate(String Cname) throws CreateException {
         private Connection getConnection()throws SQLException {
              InitialContext initCtx = null;
              DataSource ds = null;
              try{
                   initCtx = new InitialContext ();
                   ds = (javax.sql.DataSource)
                        initCtx.lookup("java:comp/env/jdbc/ShopCartPool");
              }catch(Exception e){
                   System.out.println(e);
              return ds.getConnection();           
         public CountryMasPK ejbFindByPrimaryKey(CountryMasPK pk)throws ObjectNotFoundException {
              Connection con= null;
              PreparedStatement ps = null ;
              try{
                   con = getConnection();
                   ps = con.prepareStatement("select cname from CountryMas where id=?");
                   ps.setInt(1,pk.ID);
                   ps.executeQuery();
                   ResultSet rs= ps.getResultSet();
                   if (rs.next()){
                        this.CountryName = rs.getString(1);
              }catch(Exception e){
                   System.out.println(e);
              //return new CountryMasPK(pk.i);
              return pk;
    PRIMARY KEY OBJECT
    package ShopCart;
    import java.io.Serializable;
    public class CountryMasPK implements java.io.Serializable {
         public int ID;
         public CountryMasPK(int ID){
              this.ID =ID;
         public CountryMasPK(){
         public CountryMasPK(CountryMasPK pk){
                   this.ID = pk.ID;
         public String toString(){
                   return new Integer(ID).toString();
         public int hashCode(){
              return new Integer(ID).hashCode();
         public boolean equals(Object countrymas){
              //return ((CountryMasPK)countrymas).ID.equals(ID);
              return true;
    EJB-JAR.XML
    <?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>
    <entity>
    <ejb-name>ShopCart</ejb-name>
    <home>ShopCart.CountryHome</home>
    <remote>ShopCart.CountryMas</remote>
    <ejb-class>ShopCart.CountryBean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>ShopCart.CountryMasPK</prim-key-class>
    <reentrant>False</reentrant>
    <resource-ref>
    <res-ref-name>jdbc/ShopCartPool</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>ShopCart</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    WEBLOGIC-EJB-JAR.XML
    <?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>ShopCart</ejb-name>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/ShopCartPool</res-ref-name>
         <jndi-name>ShopCartDataSource</jndi-name>
    </resource-description>
    </reference-descriptor>
    <jndi-name>Country</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    i converted jar file like this
    d:\siva\projects\> set claapath=%classpath%;.;
    cd d:\siva\projects\ShopCart > javac *.java
    cd d:\siva\projects\ShopCart > jar -cvf Sh.jar *
    cd..
    d:\siva\projects> java weblogic.ejbc ShopCart\Sh.jar ShopCart\Shop.jar
    and deployed using weblogic 6.1 console
    and client code as follows
    Client.java
    import java.io.*;
    import javax.naming.*;
    import javax.ejb.*;
    import javax.rmi.*;
    import java.util.*;
    import ShopCart.*;
    class Client {
         public static void main(String args[]){
              Context ctx=null;
              try{
                   Properties pr = new Properties();
                   pr.put(Context.INITIAL_CONTEXT_FACTORY,
                        "weblogic.jndi.WLInitialContextFactory");
                   pr.put(Context.PROVIDER_URL,"t3://localhost:7001");
                   ctx= new InitialContext(pr);
                   Object obj = ctx.lookup("Country");
                   CountryHome cm = (CountryHome)
    javax.rmi.PortableRemoteObject.narrow(obj,CountryHome.class);
                   cm.create(args[0]);
                   System.out.println ("Creating Country " + args[0] +" ..... [Done]");          
              }catch (Exception e){
                   System.out.println(e);
    when i run this file it raise the error
    D:\Siva\Projects>java Client.java
    Exception in thread "main" java.lang.NoClassDefFoundError: Client/java
    D:\Siva\Projects>java Client
    javax.naming.NameNotFoundException: Unable to resolve Country. Resolved: '' Unre
    solved:'Country' ; remaining name ''
    D:\Siva\Projects>
    This is the error message. Please observe it and do let me know what would be the error. There
    would be small configuration error. But i couldn't locate it . plz help me somebody.
    Thanx & Regards,
    Siva.

    you need to use the name java:comp/env/Country in the client.
    and the client deployment descriptor will need an ejb-ref entry:
    <ejb-ref>
      <ejb-ref-name>
        Country
      </ejb-ref-name>
      <ejb-ref-type>
        Session
      </ejb-ref-type>
      <home>
        ShopCart.CountryHome
      </home>
      <remote>
        ShopCart.CountryMas
      </remote>
    </ejb-ref>toby

  • Derby db named query causes parse error when using derby db MONTH function

    Hi all!
    I'm trying to create an application using the persistance api and beans binding. I have created my database and entity classes.
    My problem is creating a named query that uses some of the functionality from the derby database (which is embedded in the application).
    I have a named query:
    @NamedQuery(name = "Vehicles.findbymotmonth", query = "SELECT v FROM Vehicles v WHERE MONTH(v.lastmotdate) = :monthnumber") The actual query works fine when I send it directly to the db (with the parameter filled in) but causes an exception when used as a named query:
    Local Exception Stack:
    Exception [TOPLINK-8025] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EJBQLException
    Exception Description: Syntax error parsing the query [Vehicles.findbymotmonth: SELECT v FROM Vehicles v WHERE MONTH(v.lastmotdate) = :monthnumber], line 1, column 32: unexpected token [MONTH].
    Internal Exception: line 1:32: unexpected token: MONTH
            at oracle.toplink.essentials.exceptions.EJBQLException.unexpectedToken(EJBQLException.java:389)
    ... I've tried looking for solutions online but it seems evryone just writes up the original java db application example provided by sun and no one has tried doing more than "select c from customers c".
    I'm using the netbeans ide (6.5).
    Please tell me there is a simple solution to this and the persistance API can handle complex queries!
    Thanks in advance.

    one solution: assume the toplink library to be so full of bugs as to be unusable and switch to the hibernate persistance manager where it works fine.
    Edited by: pointer2null on Feb 17, 2009 11:02 AM

  • Using sysdate in a ejb 3.0 named query

    Hello,
    Giving the following ejb 3 Named query:
    @NamedQuery(name = "DcaMessage.findNew", query = "select o from DcaMessage o where o.nbAvisEmis<1 or (o.indMsgConsulte=0 and sysdate-o.dtDernierAvis>:nbJours)")
    The result is:
    Exception [TOPLINK-8004] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.EJBQLException
    Exception Description: A parsing problem was encountered resolving the alias - [sysdate].
    How do I use sysdate (or any other element) to compute the number of days between now and the date defined in dtDernierAvis?
    Thanks

    Hi,
    According to the EJB 3.0 specification, there are three date and time functions that can be used in EQL:
    functions_returning_datetime:=
    CURRENT_DATE |
    CURRENT_TIME |
    CURRENT_TIMESTAMP
    The datetime functions return the value of current date, time, and timestamp on the database server.
    I suppose your query should look like this
    @NamedQuery(name = "DcaMessage.findNew", query = "select o from DcaMessage o where o.nbAvisEmis<1 or (o.indMsgConsulte=0 and CURRENT_DATE-o.dtDernierAvis>:nbJours)")
    I never used these three functions myself, but it should be something like that.
    HTH, Wouter van Reeven

  • Error when use stored procedure in Named Query and Custom SQL

    This is a toplink development on Jdev 1013. A package with a function is created which returns a "ref cursor" in a oracle 9i database. I tried to access the function in jdev toplink descriptor editor either through custom sql (Readall) or a named query (procedureTest) and I got java.sql.SQLException: SQL string is not Query. Note: I am NOT talking about programatic storedprocedurecall object.
    The client access code is following (where error was thrown):
    results = (Collection) session.executeQuery("procedureTest", WuTest.class);

    Any responses? Thanks.

  • ERROR: Cannot create authcontext with null org-Naming query failed  code:21

    I use OpenSSO Enterprise 8.0 Update 1 Patch1 Build 6.1(2009-June-9 12:56)
    I try to evaluate the Apache 2.2 web agent.
    It's been installed without errors, and both the OpenSSO and Apache server restarted.
    The agent profile's been created. Also, I use the default (OpenDS) configuration repository
    for OpenSSO, but an external (DSEE) user data directory.
    I think I did all the required steps with regards to both directories, since I don't see any error
    in the LDAP logs, each entry seems to be found as expected, the BIND operations are all
    successfull.
    Also, I use a sub-realm rather than the default top realm, and thus, I've modified the agent configuration
    (in the agent profile) so that the login URL is now ... /UI/Login?realm=myrealm
    When I try to access the Apache homepage, I get an error 500. The most recent OpenSSO server log file
    (...../opensso/debug/Authentication) contains the following message:
    ERROR: Cannot create authcontext with null org
    The most recent agent log file (....../apache22_agent/Agent_001/logs/debug/amAgent) has the following error:
    2009-07-07 17:08:11.992 Error 10513:80149a50 PolicyEngine: am_policy_evaluate: InternalException in Service::update_policy with error message:Naming query failed. and code:21
    I don't know what else I can do to debug this problem and find a solution. Any idea ?

    Thank you Shubba,
    With all available log details enabled, I now have the following messages on the agent side:
    2009-07-09 10:14:51.731MaxDebug 5613:80149a50 all: No value specified for key com.sun.identity.agents.config.profile.attribute.mapping, using default value .
    2009-07-09 10:14:51.731 Debug 5613:80149a50 NamingService: BaseService::doRequest(): Using server: http://portable.antibes.net:8080/opensso/namingservice.
    2009-07-09 10:14:51.731MaxDebug 5613:80149a50 NamingService:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="com.iplanet.am.naming" reqid="10">
    <Request><![CDATA[                                                                                                                      
      <NamingRequest vers="3.0" reqid="2" sessid=""AQIC5wM2LY4SfcyaGFgc5h9Y7/kpf4f//ml82oVfNlbWxQE=@AAJTSQACMDE=#"">                             <GetNamingProfile>                                                                                                                         </GetNamingProfile>                                                                                                                        </NamingRequest>]]> </Request>
    </RequestSet>
    2009-07-09 10:14:51.712MaxDebug 5613:80149a50 NamingService: BaseService::sendRequest Request line: POST /opensso/namingservice HTTP/1.0
    2009-07-09 10:14:51.712 Debug 5613:80149a50 NamingService: BaseService::sendRequest Cookie and Headers =Host: portable.antibes.net
    2009-07-09 10:14:51.712 Debug 5613:80149a50 NamingService: BaseService::sendRequest Content-Length =Content-Length: 334
    2009-07-09 10:14:51.712 Debug 5613:80149a50 NamingService: BaseService::sendRequest Header Suffix =Accept: text/xml
    Content-Type: text/xml; charset=UTF-8
    2009-07-09 10:14:51.712MaxDebug 5613:80149a50 NamingService: BaseService::sendRequest(): Total chunks: 7.
    2009-07-09 10:14:51.712MaxDebug 5613:80149a50 NamingService: BaseService::sendRequest(): Sent 7 chunks.
    2009-07-09 10:14:51.728 Debug 5613:80149a50 NamingService: HTTP Status = 500 (Internal Server Error)
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: Http::Response::readAndParse(): Reading headers.
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: Server: Apache-Coyote/1.1
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: Content-Type: text/html;charset=utf-8
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: Date: Thu, 09 Jul 2009 08:14:51 GMT
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: Connection: close
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: Http::Response::readAndParse(): Reading body content of length: 13830487939496281954
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 all: Connection::waitForReply(): returns with status success.
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: Http::Response::readAndParse(): Completed processing the response with status: success
    2009-07-09 10:14:51.729MaxDebug 5613:80149a50 NamingService: <html><head><title>Apache Tomcat/6.0.18 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: AMSetupFilter.doFilter
    com.sun.identity.setup.AMSetupFilter.doFilter(AMSetupFilter.java:117)
    </pre></p><p><b>root cause</b> <pre>java.lang.NullPointerException
    com.iplanet.services.naming.service.NamingService.processRequest(NamingService.java:361)
    com.iplanet.services.naming.service.NamingService.process(NamingService.java:352)
    com.iplanet.services.comm.server.PLLRequestServlet.handleRequest(PLLRequestServlet.java:180)
    com.iplanet.services.comm.server.PLLRequestServlet.doPost(PLLRequestServlet.java:134)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    com.sun.identity.setup.AMSetupFilter.doFilter(AMSetupFilter.java:91)
    </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html>
    2009-07-09 10:14:51.729 Warning 5613:80149a50 NamingService: BaseService::doHttpPost() failed, HTTP error = 500
    2009-07-09 10:14:51.729 Debug 5613:80149a50 NamingService: NamingService()::getProfile() returning with error code HTTP error.
    2009-07-09 10:14:51.729 Error 5613:80149a50 PolicyEngine: am_policy_evaluate: InternalException in Service::update_policy with error message:Naming query failed. and code:21
    In my Tomcat server (OpenSSO server web container), I have the following errors:
    Jul 9, 2009 10:12:35 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 22746 ms
    [Fatal Error] :2:46: Element type "NamingRequest" must be followed by either attribute specifications, ">" or "/>".
    java.lang.NullPointerException
    at com.iplanet.services.naming.service.NamingService.processRequest(NamingService.java:361)
    at com.iplanet.services.naming.service.NamingService.process(NamingService.java:352)
    at com.iplanet.services.comm.server.PLLRequestServlet.handleRequest(PLLRequestServlet.java:180)
    at ...
    It seems like the problem comes from the couple of closing square brackets in the NamingRequest tag:
    </NamingRequest>]]>
    I don't know where it comes from, so if you've an idea I'd enjoy .
    Cheers,

  • Update Named query in EJB

    Hi Experts,
    I have created an EJB DC to interact with CE database using JPA's and named query. My read query is working fine and i can see the output in WS Navigator. For "Update" i have written a named query like :
    @NamedQuery(name = "updatePos", query = "UPDATE StorePos p SET p.name= ?1 WHERE p.id= ?2 ")
    To use this named query i have written a method in session bean which is
    public int updateStorePos(String id, String name){
              Query update_query = em.createNamedQuery("updatePos");
              update_query.setParameter(1, name);
              update_query.setParameter(2, id);
              int updateData = update_query.executeUpdate();
              return updateData;
    Now when i execute this method in web service updateData returns value 0,1,2 depending on the number of Id's found. That means I am able to update at JPA layer but when i again execute the read method it displays old value. I am assuming there is some problem with commit. Can some one suggest how to resolve this issue.
    Regards
    Pranav

    Hi Adrian,
    Thanks a lot for quick reply. That was indeed a very help full reply. But sorry for sounding ignorant, this is my first try on JPA's and named query. I am not able to figur out the exact problem by myself. Giving you brief on what i am doing is:
    I have added a class in newly created EJB DC. This class holds my named queries and name of this class is StorePos.java
    This is the code which i have generated
    @Entity
    @NamedQueries( {
         @NamedQuery(name = "findAllPos",
         query = "SELECT p FROM StorePos p"),
         @NamedQuery(name = "updatePos",
                   query = "UPDATE StorePos p SET p.name= ?1 WHERE p.id= ?2 ")})
    @Table(name="TMP_TEST")
    public class StorePos implements Serializable {
         private static final long serialVersionUID = 1L;
         @Id
         private String id;
         private String name ;
          * @return the id
         public String getId() {
              return id;
          * @param id the id to set
         public void setId(String id) {
              this.id = id;
          * @return the name
         public String getName() {
              return name;
          * @param name the name to set
         public void setName(String name) {
              this.name = name;
    Now i have created a session bean to access this class and to make the things available as WS. Name of the bean is StorePosSessionBean.java and code written in it is
    @SuppressWarnings("unchecked")
    @Stateless
    @WebService
    public class StorePosSessionBean implements StorePosSessionLocal {
         @PersistenceContext(unitName="POS")
         private EntityManager em;
         public List<StorePos> getStorePos() {
         List<StorePos> storePos = em.createNamedQuery("findAllPos").getResultList();
         return storePos;
         public int updateStorePos(String id, String name){
              Query update_query = em.createNamedQuery("updatePos");
              update_query.setParameter(1, name);
              update_query.setParameter(2, id);
              int updateData = update_query.executeUpdate();
              em.setFlushMode(FlushModeType.COMMIT);
    //          em.close();
              return updateData;
    i am following this article for reference. this is for reading data from table
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b030e7fb-2662-2b10-0dab-c4aa52c3550b?quicklink=index&overridelayout=true
    Regards
    Pranav

  • Duplicate annotation - named query

    Hi,
    Jdeveloper Studio Edition Version 11.1.2.3.0.
    I added a named query to EJB bean, but I receive the following message:
    Error(13,1): duplicate annotation
    @NamedQueries( { @NamedQuery(name = "MyEntity.test", query = "SELECT /*+ FIRST_ROWS */ DISTINCT     f1.cid AS CONID\n" + JPQL Syntax error. What could be the problem?
    Thanks!

    Can you paste the complete NamedQueries annotation bit please ?

Maybe you are looking for