IllegalArgumentException NamedQuery not found

Hello,
I define my metadata natively in TopLink i.e. using the TopLink Workbench I define the following files:
- session.xml
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-eclipselink/src/test/resources/sessions.xml?view=markup
- PersonProject.xml
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-eclipselink/src/test/resources/ExampleProject.xml?view=markup
PersonProject.xml includes couple of named queries depicted in the link above "Person.findByName" and "Person.findByAge" that I use to test both Named query with positional and named argument matching respectively.
I load the project using TopLink native interfaces and immediately switch to JPA interfaces, I do that using the following code:
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-eclipselink/src/main/java/org/perfectjpattern/jee/integration/dao/EclipseLinkSessionStrategy.java?view=markup
My problem is that I continuously get the "IllegalArgumentException NamedQuery not found" exception. It happens only when trying to set the value of a parameter.
The exception happens in the following file in line 159 and not in 153 so the query seems to be found but when assigning the argument values it throws the IllegalArgumentException:
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-jee/src/main/java/org/perfectjpattern/jee/integration/dao/JpaBaseDao.java?view=markup#l_138
The project provides Base and Generic Dao implementations. This issue of named queries is the last bit left to have an EclipseLink implementation of the Generic Dao.
Thanks in advance,
Best regards,
Giovanni
Edited by: bravegag on 28.05.2009 04:05

Hello,
Some progress report. I have not been able to make this work using pure JPA so far but overriding the findByNamedQuery and using native TopLink interface Session executeQuery I got the one with positional arguments working, see:
http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-eclipselink/src/main/java/org/perfectjpattern/jee/integration/dao/EclipseLinkGenericDao.java?view=markup#l_53
I got this findByNamedQuery passing all test cases.
Missing only to get the named parameters alternative to work. I created a separate thread with that question alone "how to execute named queries with named parameters using TopLink native Session interface"
Thanks in advance,
Best regards,
Giovanni

Similar Messages

  • Spring + weblogic. NamedQuery not found

    I've posted this at the [Spring forum|http://forum.springframework.org/showthread.php?t=67389] as well(, just wanted to try here too...
    We're new to about all of the technology we're working with, and we're having a hard time to get it all right. Please bear with us...
    We are developing a web application in JDeveloper 11g, using the integrated WebLogic Server and trying to configure Spring correctly. We don't have any experience with Spring, so we're just looking at examples and trying to figure it out. When running the application on the server, it seems that we get a connection to the database, but there are no Spring instances visible in the console...and when loading a jsf page, we get this error:
    12.feb.2009 10:51:16 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: ADFc: Det oppstod et uventet unntak: javax.ejb.EJBException, mld=EJB Exception: : java.lang.IllegalArgumentException: NamedQuery of name: CseAnalysis.findAll not found.
         at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getDatabaseQuery(EJBQueryImpl.java:454)
         at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setAsSQLReadQuery(EJBQueryImpl.java:117)
         at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:503)
         at no.csam.plexus.configmanager.lab.dao.LabDAOImpl.queryCseAnalysisFindAll(LabDAOImpl.java:166)
         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:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy110.queryCseAnalysisFindAll(Unknown Source)
         at no.csam.plexus.configmanager.lab.service.LabEJBBean.queryCseAnalysisFindAll(LabEJBBean.java:111)
         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:597)
    Here are some snippets of code:
    EntityBean:
    @Entity
    @NamedQueries({
    @NamedQuery(name = "CseAnalysis.findAll", query = "select o from CseAnalysis o")
    @Table(name = "CSE_ANALYSIS")
    @IdClass(CseAnalysisPK.class)
    public class CseAnalysis implements Serializable {
    DAO:
    @Transactional
    @Repository
    public class LabDAOImpl implements LabDAO{
    @PersistenceContext
    private EntityManager em;
    /** <code>select o from CseLabAnalysis o</code> */
    public List<CseLabAnalysis> queryCseLabAnalysisFindAll() {
    return em.createNamedQuery("CseLabAnalysis.findAll").getResultList();
    SessionBean:
    @Stateless(name = "LabEJB", mappedName = "LabEJBBean")
    @PersistenceContext(name="CM_Service/EntityManager",unitName="CM_Service")
    @Remote
    @Local
    public class LabEJBBean extends AbstractStatelessSessionBean implements LabEJB, LabEJBLocal {
    private LabDAO labDAO;
    public LabEJBBean(){}
    protected void onEjbCreate() {
    labDAO = (LabDAO)getBeanFactory().getBean("labDAO");
    public List<CseLabAnalysis> queryCseLabAnalysisFindAll() {
    return labDAO.queryCseLabAnalysisFindAll();
    Spring config:
    <jee:jndi-lookup id="entityManagerFactory"
    jndi-name="java:comp/env/persistenceUnit"/>
    <bean id="transactionManager"
    class="org.springframework.transaction.jta.WebLogicJtaTransactionManager"/>
    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
    <bean id="LabEJB" class="no.csam.plexus.configmanager.lab.service.LabEJBBean">
    <property name="labDAO" ref="labDAO"/>
    </bean>
    <bean id="labDAO" class="no.csam.plexus.configmanager.lab.dao.LabDAOImpl"></bean>
    <tx:annotation-driven/>
    persistence.xml:
    <persistence-unit name="CM_Service" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/ODSDS</jta-data-source>
    <properties>
    <property name="eclipselink.logging.level" value="FINE"/>
    <property name="javax.persistence.jtaDataSource"
    value="jdbc/ODSDS"/>
    <property name="eclipselink.target-server" value="WebLogic_10"/>
    </properties>
    </persistence-unit>
    Any hints or guidance will be appriciated.
    Thanks in advance

    Hi,
    if you have no experience with Spring, how did you get your application developed ? Anyway, I suggest you try the WLS forum here on OTN since the server configuration is not in the domain of JDeveloper
    WebLogic Server - General
    Frank

  • Named query not found

    Please help me, for God's sake, the following error is occurring:
    *12:03:28,550 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException: Named query not found: Configuracao*
    ConfiguracaoManagerBean.java
    public Configuracao getConfiguracao(Long codcid, String parametro) {
              EntityManager em = (EntityManager) ctx.lookup('sincronia-unit');
              Query query = em.createNamedQuery("*Configuracao*");
              query.setParameter("codcid", codcid);
              query.setParameter("parametro", parametro);
              try {
                   return (Configuracao) query.getSingleResult();
              } catch (NoResultException e) {
                   return null;
    Configuracao.java
    package br.com.dsfnet.entity;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    @NamedQueries({
         @NamedQuery(name = "Configuracao", query = "Select o From Configuracao o Where o.codcid = :codcid and o.parametro = :parametro")
    @Table(name = "TBLCONFIGSIN", schema = "SPDNET")
    public class Configuracao implements Serializable {
         private static final long serialVersionUID = 1L;
         @Column(name = "CODCID")
         private Long codcid;
         @Column(name = "PARAMETRO")
         private String parametro;
         @Column(name = "VALOR")
         private String valor;
         public void setCodcid(Long codcid) {
              this.codcid = codcid;
         public Long getCodcid() {
              return codcid;
         public void setParametro(String parametro) {
              this.parametro = parametro;
         public String getParametro() {
              return parametro;
         public void setValor(String valor) {
              this.valor = valor;
         public String getValor() {
              return valor;
    Grateful now

    You specified both a datasource and a dbtype. In this case, since you are querying a database (and not running a query-of-queries), you should leave out the dbtype attribute. See the cfquery documentation for details.

  • PL/SQL Web Service Error: IllegalArgumentException : No Deserializer found

    I deployed a pl/sql web service on a stand-alone OC4J, when I test this I am getting error "IllegalArgumentException : No Deserializer found to deserialize". Find below the detailed response:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <SOAP-ENV:Body>
    - <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Server.Exception:</faultcode>
    <faultstring>java.lang.IllegalArgumentException: No Deserializer found to deserialize a 'http://cmem.oracle.apps.cs.ws/ICmem_cs_ws_pkg.xsd:cmem_oracle_apps_cs_ws_CmemServiceRequestParamObj' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.</faultstring>
    <faultactor>/cmemws/CmemServiceRequests</faultactor>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I was using a complex parameter as well as response. Below is the WSDL. If anyone has any idea what could be the issue, let me know.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <!-- Generated by the Oracle JDeveloper Web Services WSDL Generator
    -->
    - <!-- Date Created: Tue Oct 27 12:30:19 CST 2009
    -->
    - <definitions name="CmemServiceRequests" targetNamespace="http://cmem/oracle/apps/cs/ws/CmemServiceRequests.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cmem/oracle/apps/cs/ws/CmemServiceRequests.wsdl" xmlns:ns1="http://cmem.oracle.apps.cs.ws/CmemServiceRequests.xsd">
    - <types>
    - <schema targetNamespace="http://cmem.oracle.apps.cs.ws/CmemServiceRequests.xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://www.w3.org/2001/XMLSchema">
    - <complexType name="cmem_oracle_apps_cs_ws_CmemServiceRequestParamObjUser" jdev:packageName="cmem.oracle.apps.cs.ws" xmlns:jdev="http://xmlns.oracle.com/jdeveloper/webservices">
    - <all>
    <element name="srId" type="decimal" nillable="true" minOccurs="0" />
    <element name="srNumber" type="string" nillable="true" minOccurs="0" />
    <element name="srGroupOwner" type="string" nillable="true" minOccurs="0" />
    <element name="srOwner" type="string" nillable="true" minOccurs="0" />
    <element name="srDateFrom" type="dateTime" nillable="true" minOccurs="0" />
    <element name="srDateTo" type="dateTime" nillable="true" minOccurs="0" />
    <element name="caller" type="string" nillable="true" minOccurs="0" />
    <element name="inspector" type="string" nillable="true" minOccurs="0" />
    <element name="problemCode" type="string" nillable="true" minOccurs="0" />
    </all>
    </complexType>
    - <complexType name="cmem_oracle_apps_cs_ws_CmemServiceRequestObjUser" jdev:packageName="cmem.oracle.apps.cs.ws" xmlns:jdev="http://xmlns.oracle.com/jdeveloper/webservices">
    - <all>
    <element name="srId" type="decimal" />
    <element name="srNumber" type="string" />
    <element name="srGroupOwner" type="string" />
    <element name="srOwner" type="string" />
    <element name="srType" type="string" />
    <element name="srDate" type="dateTime" />
    <element name="statusCode" type="string" />
    <element name="srParty" type="string" />
    <element name="caller" type="string" />
    <element name="srSummary" type="string" />
    <element name="problemCode" type="string" />
    <element name="problemDescription" type="string" />
    <element name="resolutionCode" type="string" />
    <element name="resolutionDesc" type="string" />
    <element name="resolutionSummary" type="string" />
    <element name="srAddress" type="string" />
    <element name="srCity" type="string" />
    <element name="srZipCode" type="string" />
    <element name="srState" type="string" />
    </all>
    </complexType>
    </schema>
    </types>
    - <message name="getSrDetails0Request">
    <part name="pSeletionConditions" type="ns1:cmem_oracle_apps_cs_ws_CmemServiceRequestParamObjUser" />
    </message>
    - <message name="getSrDetails0Response">
    <part name="return" type="ns1:cmem_oracle_apps_cs_ws_CmemServiceRequestObjUser" />
    </message>
    - <portType name="CmemServiceRequestsPortType">
    - <operation name="getSrDetails">
    <input name="getSrDetails0Request" message="tns:getSrDetails0Request" />
    <output name="getSrDetails0Response" message="tns:getSrDetails0Response" />
    </operation>
    </portType>
    - <binding name="CmemServiceRequestsBinding" type="tns:CmemServiceRequestsPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <operation name="getSrDetails">
    <soap:operation soapAction="" style="rpc" />
    - <input name="getSrDetails0Request">
    <soap:body use="encoded" namespace="CmemServiceRequests" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    - <output name="getSrDetails0Response">
    <soap:body use="encoded" namespace="CmemServiceRequests" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    </binding>
    - <service name="CmemServiceRequests">
    - <port name="CmemServiceRequestsPort" binding="tns:CmemServiceRequestsBinding">
    <soap:address location="http://isd104364:8888/cmemws/CmemServiceRequests" />
    </port>
    </service>
    </definitions>
    Appreciate any help. Thanks.
    Binish

    Ok, this sounds like a known bug ( Bug 5908689 ) in 10.1.3.1, but this was specific to non-Windows platforms. Are you on Linux/Solaris or any other platform? It might or might not be the same problem you are hitting but it does seem quite close (can't say for sure without a close investigation, I am afraid!)
    In any case, this bug is fixed in the 10.1.3.4 patchset (besides quite a few other fixes and enhancements) - so would recommend you to first apply the 10.1.3.4 patchset and retest. The patchset is available on My Oracle Support (formerly Metalink) under Patch 7272722. Or you could go a step ahead, and apply the 10.1.3.5 patchset (Patch 8626084) instead which is the latest patchset for OracleAS 10.1.3.x.
    HTH,
    Yogesh

  • WebDynpro app stopped working (Object not found in lookup of JPA_DEFAULT)

    Hi,
    my scenario is as as described in my posting (java.lang.IllegalArgumentException: model object must not be null). after i got everything up and working it suddenly stopped.
    the wedynpro project is implicitly stopped, beacuse earecipe could not start, reason:
    [code]
    Error occurred on server 15129750 during startApp demo.sap.com/earecipe : com.sap.engine.services.orpersistence.container.deploy.ActionException: Clusterwide exception: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of JPA_DEFAULT.
    at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:582)
    at... [see details]
    Error occurred on server 15129750 during startApp demo.sap.com/earecipe : com.sap.engine.services.orpersistence.container.deploy.ActionException: Clusterwide exception: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of JPA_DEFAULT.
    at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:582)
    at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:343)
    at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at com.sap.engine.services.orpersistence.container.deploy.impl.ComplexModuleCreator.initDataSources(ComplexModuleCreator.java:277)
    at com.sap.engine.services.orpersistence.container.deploy.impl.ComplexModuleCreator.initRuntimeModels(ComplexModuleCreator.java:246)
    at com.sap.engine.services.orpersistence.container.deploy.impl.ComplexModuleCreator.createModule(ComplexModuleCreator.java:151)
    at com.sap.engine.services.orpersistence.container.deploy.impl.ComplexModuleCreator.execute(ComplexModuleCreator.java:81)
    at com.sap.engine.services.orpersistence.container.deploy.impl.ComplexActionAdapter.execute(ComplexActionAdapter.java:34)
    at com.sap.engine.services.orpersistence.container.deploy.impl.ApplicationCreator.execute(ApplicationCreator.java:74)
    at com.sap.engine.services.orpersistence.container.deploy.impl.PersistenceContainer.prepareStart(PersistenceContainer.java:187)
    at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:211)
    at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:171)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:393)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:480)
    at com.sap.engine.services.deploy.server.application.StartTransaction.makeAllPhasesImpl(StartTransaction.java:537)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.runMe(ParallelAdapter.java:149)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter$2.run(ParallelAdapter.java:350)
    at com.sap.engine.frame.core.thread.Task.run(Task.java:73)
    at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:130)
    at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:226)
    [/code]
    whats that supposed to mean, i'm not using any JPA functionality at the moment.
    regards,
        christian

    Hi,
    you have to define a datasource alias for your db (in "Application Resources" in SAP Netweaver Administrator) or use an existing one and add it as a "jta-data-source" child for your corresponding persistence unit within your persistence.xml
    regards,
      christian

  • "method (...) not found in class (...)" problem

    I am having trouble with my GUI class not recognizing methods from a STACK class from the same package. Here's the skinny:
    I have a GUI class named WordGUI.
    I hava a STACK class named WordStack.
    within WordGUI I instantiate an instance of a WordStack and call it myStack. Example below:
    WordStack myStack = new WordStack();
    When I call WordStack methods from WordGUI I get the error message even though display is a method from WordStack:
    "WordGUI.java": Error #: 300 : method display(java.awt.Graphics, int) not found in class assign4.WordStack at line 34, column 13
    Complete code for both classes is below:
    WordGUI class:
    package assign4;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class WordGUI extends Applet implements ActionListener{
    WordStack myStack = new WordStack();
    private Button testButton;
    private TextField wordField;
    public void init(){
    //add(myStack);
    wordField = new TextField(20);
    add(wordField);
    wordField.addActionListener(this);
    testButton = new Button("Test for palindromes");
    add(testButton);
    testButton.addActionListener(this);
    }//init()
    public void paint (Graphics g){
    g.drawString("Enter a word in the textField above and click", 25, 100);
    g.drawString("the button to check if the word is a palindrome", 25, 115);
    myStack.display(g, 150);
    }//paint()
    public void actionPerformed(ActionEvent event){
    if(event.getSource() == testButton){
    String userInput = wordField.getText();
    myStack.evaluate(userInput);
    repaint();
    }//actionPerformed()
    }//class WordGUI
    WordStack class:
    package assign4;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class WordStack implements Cloneable{
    private char[] data;
    private int manyItems;
    public WordStack(){
    final int initialCapacity = 20;
    manyItems = 0;
    data = new char[initialCapacity];
    }//generic constructor
    public WordStack(int initialCapacity){
    if(initialCapacity < 0){
    throw new IllegalArgumentException
    ("initialCapacity too small: " + initialCapacity);
    manyItems = 0;
    data = new char[initialCapacity];
    }//constructor
    public int getCapacity(){
    return data.length;
    }//getCapacity()
    public boolean isEmpty(){
    return (manyItems == 0);
    }//isEmpty()
    public char pop(){
    if(manyItems == 0){
    //throw new EmptyStackException();
    return data[--manyItems];
    }//pop()
    public void push(char item){
    if(manyItems == data.length){
    ensureCapacity(manyItems * 2 + 1);
    data[manyItems] = item;
    manyItems++;
    }//push()
    public void ensureCapacity(int minimumCapacity){
    char biggerArray[];
    if(data.length < minimumCapacity){
    biggerArray = new char[minimumCapacity];
    System.arraycopy(data, 0, biggerArray, 0, manyItems);
    data = biggerArray;
    }//ensureCapacity()
    public String evaluate(String userInput){
    char charToProcess;
    for(int charNum = 0; charNum < userInput.length(); charNum++){
    push(userInput.charAt(charNum));
    }//evaluate()
    public void display(Graphics g, int yLoc){
    for(int i = 0; i < data.length; i++){
    g.drawString("" + data, 25, yLoc);
    yLoc += 15;
    }//display()
    }//class WordStack
    Any help would be appreciated greatly. Thank you

    you need to make your graphics call against the GUI object

  • Javax.naming.NameNotFoundException: buslogic.HRAppFacade not found, help!!!

    I have followed the tutorial on http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm to create my own EJB with Jdeveloper, but I got some errors. Please help.
    When I run the client, it gave out the following errors:
    javax.naming.NameNotFoundException: buslogic.HRAppFacade not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at client.HRAppFacadeClient.main(HRAppFacadeClient.java:15)
    Process exited with exit code 0.
    I have created the entity and facade (with interface), but the client couldn't lookup the facade, giving out the above error. How to solve the problm? Thanks.
    The following is my source code:
    Employees.java
    package buslogic.persistence;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    @Entity
    @NamedQueries({
    @NamedQuery(name = "Employees.findAll", query = "select o from Employees o"),
    @NamedQuery(name = "Employees.findEmployeeById", query = "select o from Employees o where o.empid = :empid")
    @Table(name = "\"employees\"")
    public class Employees implements Serializable {
    @Id
    @Column(name="empid")
    private int empid;
    @Column(name="name")
    private String name;
    @Column(name="phone")
    private int phone;
    public Employees() {
    public int getEmpid() {
    return empid;
    public void setEmpid(int empid) {
    this.empid = empid;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public int getPhone() {
    return phone;
    public void setPhone(int phone) {
    this.phone = phone;
    (HRAppFacadeBean.java)
    package buslogic;
    import buslogic.persistence.Employees;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name="HRAppFacade")
    public class HRAppFacadeBean implements HRAppFacade, HRAppFacadeLocal {
    @PersistenceContext(unitName="EJB_Project")
    private EntityManager em;
    public HRAppFacadeBean() {
    public Object mergeEntity(Object entity) {
    return em.merge(entity);
    public Object persistEntity(Object entity) {
    em.persist(entity);
    return entity;
    /** <code>select o from Employees o</code> */
    public List<Employees> queryEmployeesFindAll() {
    return em.createNamedQuery("Employees.findAll").getResultList();
    /** <code>select o from Employees o where o.empid = :empid</code> */
    public Employees queryEmployeesFindEmployeeById(int empid) {
    return (Employees)em.createNamedQuery("Employees.findEmployeeById").setParameter("empid", empid).getSingleResult();
    public void removeEmployees(Employees employees) {
    employees = em.find(Employees.class, employees.getEmpid());
    em.remove(employees);
    (HRAppFacade.java)
    package buslogic;
    import buslogic.persistence.Employees;
    import java.util.List;
    import javax.ejb.Remote;
    @Remote
    public interface HRAppFacade {
    Object mergeEntity(Object entity);
    Object persistEntity(Object entity);
    List<Employees> queryEmployeesFindAll();
    Employees queryEmployeesFindEmployeeById(int empid);
    void removeEmployees(Employees employees);
    (HRAppFacadeLocal.java)
    package buslogic;
    import buslogic.persistence.Employees;
    import java.util.List;
    import javax.ejb.Local;
    @Local
    public interface HRAppFacadeLocal {
    Object mergeEntity(Object entity);
    Object persistEntity(Object entity);
    List<Employees> queryEmployeesFindAll();
    Employees queryEmployeesFindEmployeeById(int empid);
    void removeEmployees(Employees employees);
    }

    I hit the exact same error. In my case it was due to missing "@Id" line in Departments.java. I must have accidently deleted it when pasting in some code.
    (my clue was the errors I got when starting imbedded OC4J)
    This section of Departments.java should read as follows:
    public class Departments implements Serializable {
    @Id
    @GeneratedValue(strategy=SEQUENCE, generator="DEPARTMENTS_SEQ")
    @Column(name="DEPARTMENT_ID", nullable = false)
    After fixing this, I ran a "make" of "HRApp", restarted the embedded OC4J server (terminate it, then right click HRAppFacadeBean.java, and click Run).
    Then ran the application...

  • Parent key 1393696 not found when adding child 1393727.

    By posting, I received this :
    An error in the system has occurred. Please contact the system administrator if the problem persists.
    type: java.lang.IllegalArgumentException
    java.lang.IllegalArgumentException: Parent key 1393696 not found when adding child 1393726.
    at com.jivesoftware.util.LongTree.addChild(LongTree.java:99)
    at com.jivesoftware.forum.database.DbTreeWalker.addChild(DbTreeWalker.java:233)
    at com.jivesoftware.forum.database.DbForumThread.addMessage(DbForumThread.java:617)
    at com.jivesoftware.forum.proxy.ForumThreadProxy.addMessage(ForumThreadProxy.java:145)
    at com.jivesoftware.forum.action.PostAction.createMessage(PostAction.java:1083)
    at com.jivesoftware.forum.action.PostAction.execute(PostAction.java:946)
    at com.jivesoftware.forum.action.PostAction.doPost(PostAction.java:666)
    at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:300)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:166)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.jivesoftware.forum.action.JiveExceptionInterceptor.intercept(JiveExceptionInterceptor.java:63)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.jivesoftware.base.action.JiveObjectLoaderInterceptor.intercept(JiveObjectLoaderInterceptor.java:56)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at oracle.wocapps.forum.action.OracleLocaleInterceptor.intercept(OracleLocaleInterceptor.java:74)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:71)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
    at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
    at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:272)
    at com.jivesoftware.base.util.JiveWebWorkServlet.service(JiveWebWorkServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    at com.jivesoftware.util.SetResponseCharacterEncodingFilter.doFilter(SetResponseCharacterEncodingFilter.java:53)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
    at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    at com.jivesoftware.util.SetRequestCharacterEncodingFilter.doFilter(SetRequestCharacterEncodingFilter.java:48)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)

    Check the adapter that is attached to the child table , compile it again and try adding .
    BTW which connector you are using and paste the error trace from log files
    Thanks
    Suren

  • Creator dies without warning due to "Child tree not found."

    *********** Exception occurred ************ at 6:09 PM on Apr 14, 2006
    Annotation: Exception occurred in Request Processor
    java.lang.IllegalArgumentException: Child tree not found.
    at org.netbeans.modules.javacore.parser.ASTProvider.findTree(ASTProvider.java:264)
    at org.netbeans.modules.javacore.parser.ASTProvider.findTree(ASTProvider.java:260)
    at org.netbeans.modules.javacore.parser.ASTProvider.findTree(ASTProvider.java:260)
    at org.netbeans.modules.javacore.parser.ElementInfo.refreshASTree(ElementInfo.java:80)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getASTree(MetadataElement.java:961)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getASTree(MetadataElement.java:451)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.cachePositions(ResourceImpl.java:491)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.getFeaturePosition(ResourceImpl.java:479)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.FeatureImpl.getPosition(FeatureImpl.java:271)
    at org.netbeans.modules.javacore.JMManager.getElementPosition(JMManager.java:704)
    at org.netbeans.modules.javacore.JMManager.getElementPosition(JMManager.java:690)
    at org.netbeans.modules.java.OverrideAnnotation$Descriptor.getLine(OverrideAnnotation.java:157)
    at org.netbeans.modules.java.OverrideAnnotation.updateLine(OverrideAnnotation.java:64)
    at org.netbeans.modules.java.OverrideAnnotationSupport$1.run(OverrideAnnotationSupport.java:148)
    at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1033)
    at org.netbeans.modules.java.OverrideAnnotationSupport.processOverriddenAnnotation(OverrideAnnotationSupport.java:155)
    at org.netbeans.modules.java.OverrideAnnotationSupport.processOverriddenAnnotationImpl(OverrideAnnotationSupport.java:179)
    at org.netbeans.modules.java.OverrideAnnotationSupport.access$400(OverrideAnnotationSupport.java:44)
    at org.netbeans.modules.java.OverrideAnnotationSupport$Request.computeAnnotations(OverrideAnnotationSupport.java:418)
    at org.netbeans.modules.java.OverrideAnnotationSupport$Request.run(OverrideAnnotationSupport.java:402)
    at org.openide.util.Task.run(Task.java:189)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
    [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)
    *********** Exception occurred ************ at 6:09 PM on Apr 14, 2006
    Annotation: Exception occurred in Request Processor
    java.lang.IllegalArgumentException: Child tree not found.
    at org.netbeans.modules.javacore.parser.ASTProvider.findTree(ASTProvider.java:264)
    at org.netbeans.modules.javacore.parser.ElementInfo.refreshASTree(ElementInfo.java:80)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getASTree(MetadataElement.java:961)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getASTree(MetadataElement.java:451)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.cachePositions(ResourceImpl.java:491)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.getFeaturePosition(ResourceImpl.java:479)
    at org.netbeans.modules.javacore.jmiimpl.javamodel.FeatureImpl.getPosition(FeatureImpl.java:271)
    at org.netbeans.modules.javacore.JMManager.getElementPosition(JMManager.java:704)
    at org.netbeans.modules.javacore.JMManager.getElementPosition(JMManager.java:690)
    at org.netbeans.modules.java.OverrideAnnotation$Descriptor.getLine(OverrideAnnotation.java:157)
    at org.netbeans.modules.java.OverrideAnnotation.updateLine(OverrideAnnotation.java:64)
    at org.netbeans.modules.java.OverrideAnnotationSupport$1.run(OverrideAnnotationSupport.java:148)
    at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1033)
    at org.netbeans.modules.java.OverrideAnnotationSupport.processOverriddenAnnotation(OverrideAnnotationSupport.java:155)
    at org.netbeans.modules.java.OverrideAnnotationSupport.processOverriddenAnnotationImpl(OverrideAnnotationSupport.java:179)
    at org.netbeans.modules.java.OverrideAnnotationSupport.access$400(OverrideAnnotationSupport.java:44)
    at org.netbeans.modules.java.OverrideAnnotationSupport$Request.computeAnnotations(OverrideAnnotationSupport.java:418)
    at org.netbeans.modules.java.OverrideAnnotationSupport$Request.run(OverrideAnnotationSupport.java:402)
    at org.openide.util.Task.run(Task.java:189)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
    [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)

    Hi There,
    Please provide more information as to when this behaviour occurs,
    Does it happen everytime or just ocassinally?
    What are you doing when this happens?
    Also which OS are you on?
    K

  • Item cost not found for one or more items - Inventory Posting

    Good Day Mentors,
    My user has encountered an error during Inventory Posting and its "Item cost not found for one or more items".
    The specific Message ID from SAP's System Message Log is 10001287.
    I found a similar post which addresses this error here.
    But unfortunately it did not help me solve my user's problem.
    I already checked if the items had a defined "Item Cost" in the Item Master Data Inventory Tab, and they all have "Item Cost" defined.
    I'm not sure if this will help, but below is the Inventory Audit Report of one of the items that is throwing the "Item cost not found" error.
    I am not a business consultant neither am I literate in accounting, so thanks for the patience.
    SAP Version: 9.0 PL5
    Valuation Method: Moving Average
    Thanks in advance!
    Sean

    Hi Augusto and Raviraj,
    I've already verified in our production database the points you made:
    - Is the "Manage Item cost per warehouse" selected in the Basic Initialization Screen?
    YES
    - Is the "Manage Inventory by Warehouse" ticked/checked in the "Inventory Data" tab of the "Item Master Data" screen?
    YES
    * I apologize for not have been able to give this information upfront.
    Anyway, the database only has one warehouse at the moment.
    I've checked the items, like the item in the screen shot above, and it does have an item cost.
    Below is the screenshot of the sample item from my original post,
    Thanks in advance!
    Sean

  • Itunes wont open at all, error message : quicktime was not found .... please reinstall ... i did that but no luck this only seems to have happened since the 10.4 update, im on windows 7 ..

    itunes wont open at all, error message : quicktime was not found .... please reinstall ... i did that but no luck this only seems to have happened since the 10.4 update, im on windows 7 ..

    Can you start QuickTime on your computer?
    You'll probably have to search for the Windows Installer Cleanup Utility and use it to remove QuickTime Player and iTunes. Then download and install the iTunes again.

  • I was updating Firefox from version 6 to version 7, after updating I tried to open Firefox and the message I got is this: This application has failed to start because xul.dll was not found. How can I fix this?

    I was updating Firefox to the newest version 7.0.1 from version 6.0.2 I think it was, I clicked the restart Firefox button that always comes up after updating. It started updating and then Firefox never restarted like it was supposed to after it was done updating. I then tried to open Firefox and it told me "This application has failed to start because xul.dll was not found." I did have Firefox crash on maybe about 30 minutes or so earlier which bothered me because I have been using Firefox for years and never had it crash on me before but I didn't think much of it at the time it happened because I was able to go back onto Firefox and finish what I had been working on. A while later I checked for updates and updated. The first time I tried to update it didn't work though so I had to shutdown Firefox and reopen Firefox and start the update a second time. It was after the second time that when I tried to open Firefox I got that message about failing to start because xul.dll can't be found. I filed a crash report when my Firefox crashed. This would have been around 1am-2am in the morning that Firefox first crashed and then wouldn't allow me to open it after updating. I have a DELL laptop running the Windows XP operating system but the laptop is probably at least 6 or 7 years old. The laptop will no longer charge so I always have to have it plugged into an outlet. Both my laptop hard drive and my external hard drive give me messages that I am running out of disk space on my hard drive. I bought this laptop 6 or 7 years ago second hand so it could be even older. In short it's a piece of crap and it gives me all kinds of issues but I currently can't afford a new one, but I have never had any problems with Firefox and I use Firefox more than any other aspect of my laptop so it's really really bothering me. May you please help me fix it?

    Unfortunately I tried that and it didn't work. Thanks for the help though. I tried to uninstall and it said I couldn't because the file is corrupt or something, but I think I finally got it uninstalled and/or deleted or whatever, but now I try to reinstall/download it again from the beginning and I can't. No matter what I do I can not get Firefox working again. No matter how many times I try to redownload it. Any other suggestions?

  • JBO:33001 bc4j.xcfg file not found in class path

    Hi,
    I am yet another victim of the age-old error JBO:33001 bc4j.xcfg file not found in class path, When i have my BC4JApp.jar in Tomcat Web-inf/lib directory. All the other jar files and class files in my webserver-application web-inf classes and lib directory works.
    But Tomcat server is not able to read this bc4j.xcfg file. I can see in my jar file that this bc4j.xcfg exists and in the specified package directory. still the problem persists. My BC4JApp.jar is perfectly working when i use JDeveloper. but not when i use tomcat4.0 and call a JSP using BC4JApp.jar from browser (My environment is Jdeveloper3.2, Tomcat4.0+IIS in middle tier and oracle 8i as DB, everything on windows2k)
    I have gone through almost all the threads possible that relates to this error in this form. None of them have a answer except to say "put the file in classpath". and last reply is "will fix in jDeveloper 9i. So what happens to us who are working in Jdeveloper 3.2?
    1. I have this file in my jar file.
    2. I also tried creating a seperate directory manually, with the same name as my package under web-inf/classes, web-inf/lib , just under web-inf directory and atlast under approot directory also. I tried having my package directory containing bc4j.xcfg in these folders one at a time and also tried having this directory in all these folders at the same time.
    Still no solution.
    Itz frustrating that neither proper documentation nor a right url page nor i am aware of available addressing this. page links given in above threads only gives me the wonderful page of ie's "Page cannot be displayed".
    Is there a answer to this error and my problem. If this doesn't work, then i have to all the way develop from scratch creating my jsp using JDBC calls and Stored packages etc.
    I don't want to give up on this Jdeveloper at this final moment because if this bc4j.xcfg file is found, my application will work perfectly. on these final moments, if this doesn't work, i am frightened to imagine to develop my application in standard way. Atlast, if thatz the option left,we have to do that bcos our production date is close by.
    Please can some one in this forum or Jdeveloper help me to solve this problem. I am desperate and very urgent.
    Waiting for a reply from Jdev team very much...
    ( I just posted in the other thread which is pretty old, dated backto May 2001, which was relevant to this error. Just to make sure it is noticed, I am posting it seperately too)
    Thanks
    Hari(2/3/02)

    Hi All,
    For those who are following this thread, I got a solution for this error with the help of Jdev Team.
    This solution may work, if you have deployed your application in Tomcat4.0.1. This is the environment in which I work and tested.
    As you may be aware, Tomcat ignores value in CLASSPATH variable.
    To see any files that are existing or newly deployed, it has it own way of detecting it.
    Addition information on Tomcat working, you can follow this link,
    http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html
    Coming to point, Tomcat has got five classloaders and each classloader invoked, looks in their related directories for files in following order.
    1. /WEB-INF/classes of your web-application
    2. /WEB-INF/lib/*.jar of your web application
    3. BootStrap classes of your JVM (Tomcat's $JAVA_HOME/jre/lib/ext)
    4. System class loader classes($CATALINA_HOME/bin/bootstrap.jar,CATALINA_HOME/lib/tools.jar)
    5. $CATALINA_HOME/common/classes
    6. $CATALINA_HOME/common/lib/*.jar
    7. $CATALINA_HOME//classes
    8. $CATALINA_HOME/lib/*.jar
    So All your individual application related files should be deployed in your application's WEB-INF/classes or WEB-INF/lib directory accordingly.
    If your application files are unpacked, they should be deployed or copied under WEB-INF/classes directory
    if the files are within a jar, they should be under WEB-INF/lib directory.
    If your Jar-files contains bc4j components, then those jar files should be deployed under WEB-INF/lib directory. Also,do the next step to copy all relavant BC4J runtime libraries under lib directory.
    IMPORTANT: Please remember to copy and paste all the required BC4j runtime libraries in the Same WEB-INF/lib directory along with your application jar files. This is the real reason which can solve this JBO:33001 to disappear. It worked for me.
    To configure your directory for tag-lib uri's, use web.xml to set the taglib-uri attribute.
    Put your web.xml and DataTags.tld in the WEB-INF directory.
    Your simple web.xml may look like as follows.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
         <taglib>
              <taglib-uri>
                   /webapp/DataTags.tld
              </taglib-uri>
              <taglib-location>
                   /WEB-INF/DataTags.tld
              </taglib-location>
         </taglib>
    </web-app>
    You may then modify this web.xml to suit further requirements of your application.
    Remember to stop and restart the Tomcat Server (service) by using shutdown and startup scripts after updating any jar files/class files/ JSP or source files deployed in Tomcat.
    Sometimes, only this helps even though your context's reloadable attribute is set to true in Tomcat Server's server.xml file.
    Hope this above information helps you to solve this error in Tomcat environment. My Sincere thanks once again to Juan and Jdev team for their help and efforts to solve this problem.
    Thanks
    Hari

  • File not found error

    I get the following error, but don't know why it can't find the file. Is there anything in this script that would call "\" instead of "/"? Is there any line of code that will switch a wayward "\" back?
    01-09-24 09:37:02 - path="" :jsp: init
    2001-09-24 09:43:42 - path="" :LoginServlet: init
    2001-09-24 09:44:15 - path="" :CourseServlet: init
    2001-09-24 09:46:48 - path="" :LessonServlet: init
    2001-09-24 09:46:54 - path="" :Error: /usr/local/apache/sites/tesco.spinweb.net/htdocs/cmi/courses\Food Service/Intro/AU00.html (No such file or directory)
    The script is below. Thanks for any help anyone can provide me.
    import cmi.xml.AU;
    import cmi.xml.Block;
    import cmi.xml.CourseReader;
    import cmi.xml.CSFElement;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import java.util.Vector;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import org.jdom.JDOMException;
    public class LessonServlet extends HttpServlet
    public void init (ServletConfig config) throws ServletException
    super.init (config);
    try {
                   Class.forName (GlobalData.DatabaseDriverName);
                   _jdbcConnection = DriverManager.getConnection (GlobalData.DatabaseName, "tesco", "scorm");
    _jdbcConnection.setAutoCommit (true);
    //should I do this?
    //_jdbcConnection.setAutoCommit (false);
    //load serialized course data
    loadCourseData();
              catch (Exception xcp) {
                   xcp.printStackTrace();     
                   getServletContext().log("Error: " + xcp.getMessage());     
    public void doGet( HttpServletRequest request,
                             HttpServletResponse response)
              throws ServletException, IOException
    boolean normalMode = true;
    try {
    HttpSession session = request.getSession (true);
    //can I load the session given the id??
    //System.out.println ("Lesson.valid session " + session.getId() + ": " + request.isRequestedSessionIdValid());
    response.setContentType ("text/html");
    JDBCHelper dbHelper = new JDBCHelper (_jdbcConnection);
    //get student ID
    Integer studentID = (Integer) session.getAttribute ("studentID");
    //get course ID
    Integer courseID = (Integer) session.getAttribute ("courseID");
    //get lesson ID
    String lessonID = request.getParameter ("lessonID");
    if (lessonID == null) {
    lessonID = (String) session.getAttribute ("lessonID");
    if (studentID == null || courseID == null || lessonID == null) {
    //reset session data by re-logging the user
    sendProfileError (response.getOutputStream());
    return;
    //store lesson ID in session
    session.setAttribute ("lessonID", lessonID);
    String auID = request.getParameter ("auID");
    String mode = request.getParameter ("mode");
    if (mode != null) {
    session.setAttribute ("mode", mode);
    else {
    mode = (String) session.getAttribute ("mode");
    if (mode.equalsIgnoreCase ("review")) {
    normalMode = false;
    else {
    normalMode = true;
    //synchronize access to course hash table
    synchronized (_courseHash)
    //make sure _courseHash is in tact
    if (_courseHash == null) {
    //try reloading it....
    loadCourseData();
    if (_courseHash == null) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data");
    if (! _courseHash.containsKey (courseID.toString())) {
    //try reloading it....
    loadCourseData();
    if (! _courseHash.containsKey (courseID.toString())) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data (course not found)");
    if (auID == null) {
    //show course menu
    Hashtable hash = (Hashtable) _courseHash.get (courseID.toString());
    sendAvailableAUs (hash, studentID.intValue(), courseID.intValue(), lessonID, response.getOutputStream(), response, dbHelper);
    return;
    //if AU has not been attempted, initialize it
    Integer auDataID = new Integer (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper));
    //if (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper) == -1) {
    if (auDataID.intValue() == -1) {
    int newID = initializeAUData (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper);
    dbHelper.addAUToPath (studentID.intValue(), courseID.intValue(), lessonID, auID);
    auDataID = new Integer (newID);
    session.setAttribute ("AUID", auID);
    session.setAttribute ("AUDataID", auDataID);
    sendAU (studentID.intValue(), courseID.intValue(), lessonID, auID, auDataID.intValue(), normalMode, response.getOutputStream(), dbHelper);
    //to do: detailed messages should be sent to the client depending on which
    // exception was thrown. Don't have one try/catch....have one for each situation
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    public void destroy()
              try {
                   if (_jdbcConnection != null) {
                        _jdbcConnection.close();
              catch (Exception ignored) {}
    private int initializeAUData (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    String sqlQuery = null;
    ResultSet results = null;
    try {
    //get student's name
    sqlQuery = "SELECT Full_Name" +
    " FROM " + GlobalData.StudentTable +
    " WHERE Student_ID = " + studentID;
    results = dbHelper.doQuery (sqlQuery);
    if (! results.next()) {
    //error
    return -1;
    String studentName = results.getString (1);
    results.close();
    //the lock prevents CMIServlet from reading AU_ID before it's committed
    //sqlQuery = "LOCK TABLES " + GlobalData.AUDataTable + " WRITE;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    sqlQuery = "Insert Into " + GlobalData.AUDataTable +
    "(Course_ID, Lesson_ID, AU_ID, student_id, student_name, lesson_location, credit," +
    " lesson_status, entry, exit, score_raw, score_max, score_min, total_time," +
    " session_time, lesson_mode, suspend_data, launch_data, Evaluation_ID, Objective_ID)" +
    " Values (" + courseID + ", '" + lessonID + "', '" + auID + "', " + studentID + ", '" + studentName + "'," +
    " 'NA', 'credit'," + " 'not attempted', 'ab-initio', " + "'NA', " + 0 + ", " + 0 + ", " + 0 +
    ", '00:00:00.0', '00:00:00.0', " + " 'normal'" + ", 'NA', " + "'NA', " + 0 + ", " + 0 + ");";
    dbHelper.executeUpdate (sqlQuery);
    return getAUDataID (studentID, courseID, lessonID,auID, dbHelper);
    //sqlQuery = "UNLOCK TABLES;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    return -1;
    private int getAUDataID (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    throws SQLException
    String sqlQuery = "SELECT AUData_ID, lesson_status, lesson_mode, exit" +
                                  " FROM " + GlobalData.AUDataTable +
                                  " WHERE student_id = " + studentID +
                                  " AND Course_ID = " + courseID +
    " AND Lesson_ID = " + "'" + lessonID + "'" +
    " AND AU_ID = '" + auID + "';";
    ResultSet results = dbHelper.doQuery (sqlQuery);
    if (results.next()) {
    return results.getInt ("AUData_ID");
    return -1;
    private void sendAU (int studentID, int courseID, String lessonID, String auID, int auDataID, boolean normalMode, ServletOutputStream htmlOut, JDBCHelper dbHelper)
    throws IOException, ClassNotFoundException
    Hashtable hash = null;
    synchronized (_courseHash)
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));       
    if (hash == null) {
    loadCourseData();
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));
    if (hash == null) {
    throw new IOException ("Corrupt course data (course not found)");
    AU au = (AU) hash.get (auID);
    try {
    if (! normalMode) {
    dbHelper.setReviewMode (auDataID);
    String courseFileName = getFileName (String.valueOf (courseID), dbHelper);
    File file = new File (courseFileName);
    //create absolute path to file so we can resolve relative URLs
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();
                   BufferedReader buf = new BufferedReader (new FileReader (newFileName));
    PrintWriter htmlWriter = new PrintWriter (htmlOut);
                   String temp;
    htmlWriter.write (getAUHtml (au.getLaunchParams()));
    htmlWriter.flush();
    htmlWriter.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getAUHtml (String path){
    path = path.replace ('\\','/');
    String response;
    response = "<html>\n" +
                        "<head>\n" +
    "</head>\n" +
    "<body>\n" +
    "<script language=\"JavaScript\">\n" +
    "document.location = \"/cmi/courses/" + path + "\"\n" +
    //"win = window.open ('','displayWindow','menubar=yes,scrollbars=yes,status=yes,width=300,height=300');\n" +
    //"window.onload = \"win.close();\"" +
    "</script>\n" +
    "</body>\n" +
    "</html>\n";
    return response;
    private void sendAvailableAUs (Hashtable hash, int studentID, int courseID, String lessonID, ServletOutputStream out, HttpServletResponse response, JDBCHelper dbHelper)
    StringBuffer buf = new StringBuffer (200);
    Block block = (Block) hash.get (lessonID);
    AU au = null;
    try {
    Vector completedAUs = dbHelper.getCompletedAUs (studentID, courseID, lessonID);
    buf.append ("<html>\n" +
                        "<head>\n" +
    "<title>" + block.getTitle() + " units</title>\n" +
    "<script language=\"JavaScript\">\n" +
    "function go() {\n" +
    " var form = document.goForm;\n" +
    " var index = form.gotoSelect.selectedIndex;\n" +
    " if (index == 0) {\n" +
    " document.location = \"/servlet/CourseServlet?courseID=" + courseID + "\";\n" +
    " }\n" +
    " else if (index == 1) {\n" +
    " top.restart();\n" +
    " }\n" +
    "}\n" +
    "</script>\n" +
    "</head>\n" +
    "<body background=\"/cmi/images/marble.jpg\">\n" +
    "<center><h1><b><u>" + block.getTitle() + "</u></b></h1></center>\n" +
    "<p></p>\n<p></p>\n" +
    "<b>" + block.getTitle() + " contains the following units: </b>\n" +
    "<dl>\n");
    Enumeration enum = block.getChildren();
    while (enum.hasMoreElements()) {
    String temp = (String) enum.nextElement();
    CSFElement element = (CSFElement) hash.get (temp);
    if (element.getType().equals ("au")) {
    au = (AU) element;
    if (completedAUs.contains (au.getID())) {
    buf.append ("<dt><p><img src=\"/cmi/images/node2.gif\"><a href=\"/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=review\">" + au.getTitle() + " (<i>review</i>) </a></p></dt>\n");
    else {
    buf.append ("<dt><p><img src=\"/cmi/images/node.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=normal") + "\">" + au.getTitle() + "</a></p></dt>\n");
    else if (element.getType().equals ("block")) {
    buf.append ("<dt><p><img src=\"/cmi/images/folder.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + element.getID() + "&mode=normal") + "\">" + element.getTitle() + "</a></p></dt>\n");
    buf.append ("</dl>\n" +
    "<br><br>\n" +
    "<form name=\"goForm\">\n" +
    "<select name=\"gotoSelect\">\n" +
    " <option value=\"lesson\">Lesson Menu</option>\n" +
    " <option value=\"exit\">Exit LMS</option>\n" +
    "</select>\n" +
    "<input type=\"button\" value=\"Go\" onClick=\"go()\">\n" +
    "</form>\n" +
    "</body>\n" +
    "</html>");
    PrintWriter writer = new PrintWriter (out);
    writer.write (buf.toString());
    writer.flush();
    writer.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getFileName (String courseID, JDBCHelper dbHelper)
    throws ClassNotFoundException, SQLException
              ResultSet results = null;
              String fileName = null;
    String sqlQuery = "SELECT CourseFile" +
                                  " FROM Course" +
                                  " WHERE Course_ID = " + Integer.parseInt (courseID) + ";";
    results = dbHelper.doQuery (sqlQuery);
              if (results.next()) {
                   fileName = results.getString (1);
              else {
    //need to do more than this :)
                   System.out.println("crap");
    results.close();
    return fileName;
    private void loadCourseData()
    throws IOException, ClassNotFoundException
    //load serialized course data
    File file = new File (GlobalData.DataFileName);
    if (! file.exists()) {
    //error
    throw new FileNotFoundException (GlobalData.DataFileName + " not found.");
    FileInputStream fis = new FileInputStream (GlobalData.DataFileName);
    ObjectInputStream ois = new ObjectInputStream (fis);
    _courseHash = (Hashtable) ois.readObject();
    ois.close();
    private void sendProfileError (ServletOutputStream out)
    String html = "<html>\n" +
    "<body>\n" +
    "<p>An error has occurred with your profile. Please " +
    "<a href=\"\" onClick=\"top.restart(); return true\">login again</a>" +
    "</body>\n" +
    "</html>\n";
    PrintWriter writer = new PrintWriter (out);
    writer.write (html);
    writer.flush();
    writer.close();
    private Connection _jdbcConnection;
    private Hashtable _courseHash;

    I know that is where my error is, but why and where is
    the script calling it up way?You wrote it right? check out the sendAU() method, there is line
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();

  • Error: "file not found" when try to display image on report

    Dear All
    I have a problem when running my report.
    My Table emp_info Stores all data about employees in addition to the employee image path.
    I made a report that display employee information including its photo.
    I run my report passing the parameter p_emp_id to display the desired emploree information.
    I made a field on the report to display the employee image
    and i set its property READ FROM FILE = YES and FILE FORMAT=IMAGE
    But the following error occurs
    "File '\\iai3\iaigc\ALL\emp_images\51.JPG' not found. "
    I'm sure that the path is correct
    But i do not know why the report stops and can not read the image path.
    My platform is:
    Oracle application server installed on linux
    and oracle report builder installed on widows for development

    Dear aweiden
    thanks for replaying
    I belive you are right . I think the problem is in the path.
    But there is something that i did not mentioned to you. I work on two different servers.
    1- "iai2" : Linux server which contains oracle application server.
    2- "iai3" Windows 2003 server which contained oracle database 10g and the folder "aigc\ALL\emp_images" which contains Employees images
    I think that the problem is that Linux server can not understand the path "\\iai3\iaigc\ALL\emp_images\51.JPG".
    Do you have any idea how the path should be changed so that Linux can recognizes it.
    Thanks in advance

Maybe you are looking for

  • Tree in web dynpro

    hi, I developed a web dynpro on the base of the WDT_TREE structure. Itu2019s important to underline that each node can contain different type of sons: ITEM and NODE as you can see in the structure below   For example: ROOT    NODE1       Item 1  -> N

  • Macbook doesn't register TV

    Hi, I am trying to connect my mid-2010 Macbook Pro (running version 10.9.4 of OS X) to a brand new Magnavox TV. I am using an HDMI cord and a mini DisplayPort, both of which have worked in the past. When the TV is off, my computer recognizes the exte

  • Software update doesn't show 2.1

    When I open Software Update, Aperture 2.1 doesn't show up. One possibility for this is that I don't have Aperture installed in the Applications folder on the startup drive. Could this be the issue? The other possibility is that I have a volume licens

  • Standard report -to get Where products are manufactured?

    Hi, I’m looking for a report that will tell me where our products are manufactured in SAP? I mean SHIP-FROM. Any ideas? Regards Praveen

  • Illegal start of expression, request.getParameter

    Hello, I added the following to my jsp page <% String username = request.getParameter("username"); %>and an error pops up saying "illegal start of expression", am I missing something? Thanks EDIT: Problem solved, other code was causing the problem ;)