IllegalArgumentException when using Constructor expression in Named Query.

I have the following JPQL-query:
SELECT NEW se.callista.test.dto.EmployeeReportData(e.firstName, e.lastName, a.city, e.employmentPeriod.startDate) FROM Employee e JOIN e.address a ORDER BY e.lastName, e.firstNamewhere EmployeeReportData is a dto (not an entity). The query works fine when running it as a normal query. When I put it as a named query however, I get the following error message when trying to execute it: java.lang.IllegalArgumentException: Object: se.callista.test.dto.EmployeeReportData@10f9644 is not a known entity type.
I can't find anything in the JPA-spec that says a named query cannot contain a constructor expression - am I missing something?
Found the error. It works fine now :)
Message was edited by:
Sofia_Jonsson

I had the same problem.
It seems that the Entity class is not loaded by the JVM at the moment of calling createNamedQuerey(string).
I've solved this problem by loading the entity class manually in the caller by calling "Class.forName(string)" and passing the entity's class name as a parameter.

Similar Messages

  • 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.

  • Problem when using About Operator in Contains Query

    Hi,
    I'm new to Oracle and this forums too. I have a problem when using about operator in contains query.
    I create a table with some records and then create a context index on 'name' column.
    CREATE TABLE my_items (
      id           NUMBER(10)      NOT NULL,
      name         VARCHAR2(200)   NOT NULL,
      description  VARCHAR2(4000)  NOT NULL,
      price        NUMBER(7,2)     NOT NULL
    ALTER TABLE my_items ADD (
      CONSTRAINT my_items_pk PRIMARY KEY (id)
    CREATE SEQUENCE my_items_seq;
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Car', 'Car description', 1);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Train', 'Train description', 2);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'Japan', 'Japan description', 3);
    INSERT INTO my_items VALUES(my_items_seq.nextval, 'China', 'China description', 4);
    COMMIT;
    EXEC ctx_ddl.create_preference('english_lexer','basic_lexer');
    EXEC ctx_ddl.set_attribute('english_lexer','index_themes','yes');
    EXEC ctx_ddl.set_attribute('english_lexer','theme_language','english');
    CREATE INDEX my_items_name_idx ON my_items(name) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('lexer english_lexer');
    EXEC ctx_ddl.sync_index('my_items_name_idx');Then I perform contains query to retrieve record :
    SELECT count(*) FROM my_items WHERE contains(name, 'Japan', 1) > 0;
    COUNT(*)
          1
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Japan)', 1) > 0;
    COUNT(*)
          1But the problem is when I using ABOUT operator like in Oracle's English Knowledge Base Category Hierarchy it return 0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(Asia)', 1) > 0;
    COUNT(*)
          0
    SELECT count(*) FROM my_items WHERE contains(name, 'about(transportation)', 1) > 0;
    COUNT(*)
          0I can't figure out what 's wrong in my query or in my index.
    Any help will be appreciated.
    Thanks,
    Hieu Nguyen
    Edited by: user2944391 on Jul 10, 2009 3:25 AM

    Hello (and welcome),
    You'd be best asking this question in the Oracle Text forum, here:
    Text
    And by the way, it will help others to analyse if you put {noformat}{noformat} (lowercase code in curly brackets) before and after your code snippets.
    Good luck!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can i use any wireless printer when using air express

    can i use any wireless printer when using air express

    If you are looking for a new printer, any wireless model will work with the AirPort Express.
    But, since you indicate that you have an iPad, you would want to make sure that the printer you choose is AirPrint compatible. This way, you will be able to print from your iPad....if you need that function.
    See this Apple support document for info on AirPrint and compatible models.
    http://support.apple.com/kb/HT4356

  • Is there any way to stop the delay between different sets of speakers when using airport express?

    Is there any way to stop the delay between different sets of speakers when using airport express?

    Unfortunately, I don't have either a Slingbox or iHome speakers so I won't be able to reproduce any of the issues you are having. With the fact that you live in large apartment complex would still lead me to believe that Wi-Fi interference may be the reason that you are having streaming issues.
    I suggest you perform a simple site survey, using utilities like iStumbler, or AirRadar to determine potential areas of interference, and then, try to either eliminate or significantly reduce them where possible.

  • Unknown error when using daq express vi's

    Hi there i get unknown error when trying to use DAQ express VI's. I have downloaded and installed NI device drivers which was required to generate EXE since then this problem was occuring what should i do i have done all that was mentioned in the following thread
    (http://forums.ni.com/ni/board/message?board.id=170&message.id=336246&query.id=2154746#M336246) but no use i am not able to figure out the problem can anyone help me. 
    Solved!
    Go to Solution.

    Hi
    Ok, if that is the situation and you've tried everything in the other thread. In the solution of this thread there's a zipfile posted that contains instructions and an application that can help you uninstall all NI software on a computer and start freesh.
    Best Regards
    David
    Message Edited by Davidek on 10-01-2009 01:56 AM
    Message Edited by Davidek on 10-01-2009 01:59 AM

  • Can't access some sites when using Aiport Express, why?

    I'm using Windows 7 and my router is a wireless Apple Airport Express that is approximately two years old. Suddenly I can't access some sites (for example www.sthlm.friskissvettis.se, or www.vegetarian-shoes.co.uk, some streamed tv-shows on svtplay.se, and a number of other random sites) when connecting to internet with my router. It worked good until recently and I'm fairly sure this problem emerged when my ISP upgraded from 10/10mbit to 100/10mbit speed. Most other sites like facebook and google works fine.
    When using my network cable to connect to internet everything works fine and I can access these sites.
    Firmware is current and I've tried reseting the router to factory defaults.
    Tried different browsers, and I can't ping the "blocked" sites either. Tracert www.sthlm.friskissvettis.se starts with 10.0.0.1 and continues through a number of long addresses until it says timeout. The last working address before timeout was sth-tcy-ipcore01-ge-0-2-0.neq.dgcsystems.net [83.241.252.13], if it matters. Tracert www.vegetarian-shoes.co.uk also eventually gives me a timeout.
    When the network cable is plugged in, I still get timeout on tracert www.sthlm.friskissvettis.se even though I can access the site in Chrome. Weird. www.vegetarian-shoes.co.uk doesn't give me a tracert timeout when the cable is plugged in, and I can access the site as usual.
    I've tried changing DNS servers to use opendns servers instead, but to no use.
    I've tried pinging these two sites with a lower MTU packet size (with this method: http://www.richard-slater.co.uk/archives/2009/10/23/change-your-mtu-under-vista- or-windows-7/), but still can't access them through ping...
    I don't know what to do anymore.... any suggestions???
    Thanks

    Hi Punice
    first try to disable JavaScript from : Firefox button (or Tools menu) > Options > Content panel > '''UNcheck''' Enable JavaScript.
    if the above does not help check with a few malware/virus scan programs for virus. You need to use all programs because each detects different malware. Make sure to update each program to get the latest version before doing a scan.
    http://housecall.trendmicro.com/ - Trendmicro online
    http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    http://www.superantispyware.com/ - SuperAntispyware
    http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    http://www.microsoft.com/windows/antivirus-partners/windows-xp.aspx
    check also for a rootkit infection with TDSSKiller.
    http://support.kaspersky.com/viruses/solutions?qid=208280684
    thank you

  • Problem with 0FIGL_VC1 when use constant selection in the query

    Please kindly help me. I have this problem for 2 weeks already.
    When I create a query from virtual cube 0FIGL_VC1 (balance sheets / p&l statements), if I use constant selection in any of key figure, my report could not display financial statment correctly. 
    My report layout
    Columns :  key figures  (including 0FIGL_VC1_CK001)
    Rows:  0GLACCEXT  (financial statement item) << as hierarchy
    Initially, the query is processed correctly.
    However, based on the requirement from my customer, I really have to use "constant selection" for some of my columns. Whenever I do so, the query display incorrectly. (Some nodes of financial statement item just disappear. (it seem like all contra item will disappear.)  
    Please help!

    If I dont use constant selection in the query, data are display correctly.
    But If I use constant selection in the query, some financial statement item dont display any value
    Example :
       Financial statement item(Display in hier)     Period1   Total Period1(Constant selection)
                 A                                                       10            60
                 B                                                       20            60
                 C                                                       30            60
                 D                                                       0              60
    - Financial statement item "D"  has some value.
    - Financial statement item "D"  is in the hierarchy,one gl account has been assigned to more than one group differentiated by debit/credit indicator.
    Please help!!

  • When using airport express with magic jack it disconnects when i use the phone.

    When the airport express is used with magic jack it disconnects internet service when i use the phone. That is with incomming or out going calls.

    I went through that very same issue with two of my Samsung phones. ....my problem turned out to be corrupted files within my 1st phone programming due to a bad OS update
    The second phone issue occurred because my phones data became corrupted by a mild virus  therefore it was necessary in both cases to replace the phones. ..
    But,  there is also a third option,  try removing any recent apps you've added then turn your phone off and back on to refresh
    Or try doing a factory rese, I know I realize how frustrating these are but,  in some cases it fixes the issue without additional challenges. ..
    You should also add the Verizon protection and security app to your phone to prevent virus and other such problems from affecting your phone going forward. ...
    The best thing about this app aside from its protection is that it also enables the user to easily save and transfer their phone content between phones and backs everything up to a minimum of 25GB of the cloud
    But,  you also need to turn your android phone off at least once every 3-days to maintain a good connection to the Verizon network

  • JPQL, error when using constructor in query

    I have such query:
    sb.append("select new ibs.parliament.model.stateless.cd.helperobject.PersonWithAccessCount(p, sum(personCounters.count))");
    sb.append(" from Person p left join p.counter personCounters where personCounters.date>= :startPeriodDate and  personCounters.date<= :endPeriodDate");
    sb.append(" group by p.id");PersonWithAccessCount has fields for Person and count for sum result.
    @Entity
    public class Person{
        @OrderBy("date")
        @ManyToMany(fetch=FetchType.EAGER, cascade={CascadeType.ALL}, mappedBy="person")
        private List<PersonAccessCounter> counter;
    //other fields, getters and setters
    @Entity
    public class PersonAccessCounter {
         @Id
          @ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.ALL})
         private Person person;
         @Id
         private Date date;
         private long count;
    //other fields, getters and setters
    public class PersonWithAccessCount implements Comparable<PersonWithAccessCount>{
         private Person person;
         private long count;
    //getters and setters
    }I get such error:
    org.apache.openjpa.kernel.jpql.ParseException: There is "," in symbol 82, but expected: ["."].
    82 is here: (p*,* sum(personCounters.count))
    What does it mean? Why this error happens, please, tell me.

    My query is:
            sb.append("select new ibs.parliament.model.stateless.cd.helperobject.PersonWithAccessCount(personCounters.person, sum(personCounters.count))");
         sb.append(" from PersonAccessCounter personCounters where personCounters.date>= :startPeriodDate and  personCounters.date<= :endPeriodDate");
         sb.append(" group by personCounters.person");I get this error:
    >
    Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: DB2 SQL Error: SQLCODE=-134, SQLSTATE=42907, SQLERRMC=BIOGRAPHY, DRIVER=3.50.152 {prepstmnt 1306676706
    SELECT t1.id, t1.accessCounter, t1.biography, t1.birthdayDate,
            t1.firstLetter, t1.firstName, t1.lastName, t1.lastUpdateDate,
            t1.medialogyUid, t1.patronymic, t1.portrait_id, t1.sourceUri,
            SUM(t0.count)
        FROM Parliament.PersonAccessCounter t0 INNER JOIN Parliament.Person t1
            ON t0.person_id = t1.id
        WHERE (t0.date >= ? AND t0.date <= ?) GROUP BY t1.id, t1.accessCounter,
            t1.biography, t1.birthdayDate, t1.firstLetter, t1.firstName,
            t1.lastName, t1.lastUpdateDate, t1.medialogyUid, t1.patronymic,
            t1.portrait_id, t1.sourceUri FETCH FIRST 10 ROWS ONLY
    [params=(Timestamp) 1988-10-15 17:19:16.734, (Timestamp) 2008-10-15 17:19:16.734]} [code=-134, state=42907]
    >
    This is problem field "biography".
            @Lob
         @Basic(fetch=FetchType.LAZY)
         @Column(nullable=false, length=100000)
         private String biography;I've annotated it as "LAZY field". Now, I'll try to make a query...(
    I've found this:
    SQL Reference for usage of VARCHARs greater than 255 bytes:
    A VARCHAR string with a maximum length that is greater
    than 255 bytes or any CLOB string is a Long String.
    Following indicates the contexts in which long strings cannot be referenced.
    A GROUP BY clause
    An ORDER BY clause
    A CREATE INDEX statement
    A SELECT DISTINCT statement
    A subselect of a UNION without the ALL keyword

  • Syntax Error when using SQL Expression

    Morning all,
    When I try to type any SQL Expression within Crystal I am getting syntax errors, even when I type only SELECT {field name} FROM {table name}.
    Here is the query I did which gave me the following error:
    Query
    SELECT  order_progress . date_created
    FROM order_progress
    WHERE  order_progress . order_no = order_header . order_no
    AND  order_progress . order_status =77
    ORDER BY  order_progress . date_created DESC
    Error
    Error in compiliing SQL Expression
    Database connector Error: 'HY000[Informix] [Informix ODBC Driver]General Error. Syntax Error[Database Vendor Code-11060]'.
    Now this means, 1: I am getting a connection error with my db, for no apperent reason. 2: my syntax is not approved?!
    Can someone explain why is this happening and how to resolve this?
    many thanks
    Kind Regards
    Jehanzeb

    Morning Kyle,
    Thanks for the informative answer, I have found out the formula which counts number of days however, I am not sure what you meant by the following:
    >
    Kyle McAdam wrote:
    > create a formula that does the datediff....this will be a group.
    Done this, it counts the working days as in weekdays and takes bank holidays out as well
    here is the formula:
    WhileReadingRecords;
    //{order_progress.order_status}= 77;
    //{order_header.order_status}>=77;
    Local DateVar Start := {order_header.date_entered};   // Starting Date
    Local DateVar End := {order_header.act_despatch};  // Ending Date
    Local NumberVar Weeks;
    Local NumberVar Days;
    Local Numbervar Hol;
    DateVar Array Holidays;
    Weeks:= (Truncate (End - dayofWeek(End) + 1
    - (Start - dayofWeek(Start) + 1)) /7 ) * 5;
    Days := DayOfWeek(End) - DayOfWeek(Start) + 1 +
    (if DayOfWeek(Start) = 1 then -1 else 0)  +
    (if DayOfWeek(End) = 7 then -1 else 0);  
    Local NumberVar i;
    For i := 1 to Count (Holidays)
    do (if DayOfWeek ( Holidays<i>) in 2 to 6 and
      Holidays<i> in start to end then Hol:=Hol+1 );
    Weeks + Days - Hol;
    You will then have a formula field that is evaluated to 1, if the status is 77.
    you mean second formula? How I used,
    If Order_header.Order_Status=77 then
    1
    else
    2;
    however this doesn't seem to be working.
    > Now, sum that formula in each group footer. Suppress the detail lines...
    which formula to sum up?
    > **Don't use a cross tab with this solution. For a cross tab, you would have to calculate the totals in a different manner.
    so far I used Cross tab and it is showing the right days, however not showing the correct jobs per day.
    You might be right there that it calculates the totals differently, additionally how am I suppose to get the right Percentage if using the Cross tab. The percentage should be, count of number of jobs % Total jobs.
    hence:
    {#NumofJobs} % {#Total_Jobs}
    however, when I create this formula it does not let me add that into the cross tab.
    I also need to put a subreport in my report, can I use Crosstab to contain a link to my subreport?
    Many thanks
    Kind Regards
    Jehanzeb

  • IllegalArgumentException when using Introspector to get bean info

    hi all
    i have a bean class that has two strings and one vector. when i use introspector to read and write bean value to a new object of same type, i got an IllegalArgumentException :
    Exception in thread "main" java.lang.IllegalArgumentException: argument type mis
    match
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at IntrospectTest.copy(IntrospectTest.java:61)it happens when it tried to access the vector which contains two string values. here is my method
         public static Object copy(Object o)
              System.out.println("in copy...");
              Object newObject = null;
              System.out.println("object : "+o);
              try
                   Class c = o.getClass();
                   System.out.println("Class from o : "+c);
                   newObject = c.newInstance();
                   System.out.println("newObject : "+newObject);
                   PropertyDescriptor p[] = null;
                   p = Introspector.getBeanInfo(o.getClass()).getPropertyDescriptors();          
                   Object[] args = new Object[1];
                   System.out.println("p has "+p.length+" elements");
                   for (int i = 0; i < p.length; i++)
                        String name = p.getName();
                        System.out.println("name : "+name);
                        if(!"class".equals(name))
                             Object value = p[i].getReadMethod().invoke(o, new Object[0]);
                             System.out.println("value : "+value);
                             args[0] = name;
                             p[i].getWriteMethod().invoke(newObject, args);
              }catch (IntrospectionException ie)
                   System.out.println("IntrospectionException : "+ie.getMessage());
              }catch (InvocationTargetException ite)                     
                   System.out.println("InvocationTargetException : "+ite.getMessage());
              }catch (IllegalAccessException ile)
                   System.out.println("IllegalAccessException : "+ile.getMessage());
              }catch(InstantiationException ine)
                   System.out.println("InstantiationException : "+ine.getMessage());
              return newObject;
    does anyone know how i can read and write vector object in a bean? thanks.

    Normally I would be happy to help you, but after several years of trying to help here, I've decided not to contribute anymore because of the piss-poor way in which this site is being administered.
    Others are still helping, but more may leave if things don't improve. May I recommend devshed or javaranch?
    http://www.devshed.com/
    http://www.javaranch.com/
    If you would like to complain to the admins of this forum, either click the "Report Abuse" link or the "Feedback" link.
    The forum denizen formerly known as jverd

  • Error when using the expression operator

    Hi All
    When i'm using the following expression in the expression editor i'm getting an error message "expression is not properly formed, error expression cannot be validated". But when i use the same expression in TOAD i'm getting the result. Can any one please help me where i'm going wrong?
    SUBSTR (INGRP1.site_id_nbr, 1, 11)
    || DECODE (SUBSTR (INGRP1.site_id_nbr, -1, 1),
    1, '1',
    2, '1',
    3, '3',
    4, '3'
    Thanks

    This may be a bug in the expression validation, decode is valid in an expression operator always when Set Based code generation only is used (you may get errors if row based is used), if you configure the mapping to set based only code generation mode and default operating mode then try deploying the mapping you should be OK. Otherwise you build an expression that is valid SQL (set based) and PLSQL (row based), the CASE statement will give you this
    Cheers
    David

  • Speed issue when using Airport Express

    Hello.
    I have had an ongoing battle recently with Internet download speeds.
    I connect my iMac to my Airport Express.
    iMac has Firewall ON.
    When I connect this way, I get slow connection / download speeds.
    The file I am using in this example is the MS Office 2003 SP3 update.
    I get around 200kbps.
    However....
    When I connect my iMac directly via Ethernet to my Cable Modem, I am getting 1.5mbps download.
    Can anyone shed any light on this and advise how I can correctly configure the Airport to get nearer this speed?
    Many thank in advance
    Glenn

    Have you repaired Permissions since the last update/upgrade?
    If not, either do that or get Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, reboot holding down CMD+s, then when the prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 5 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start
    While watching Activity Monitor>Networks, are there dips in the download speed, or just flat slow input?
    How many bars do you get?
    What speed does it say it's connecting at in Network Utility?

  • Help - Receive message "an error occurred printing this document" when using airport express and Ipad

    Hi, I am trying to set up an airport express hub to work with a Star tsp100 receipt printer and IPad 2. The IPad is being used to accept credit card payments and I was hoping to print receipts out wirelessly using the airport express and receipt printer. I checked to make sure the airport express has the latest firmware and it does. The IPad software is also updated to the latest 7.1.  I then connected the Airport express and IPad and the network setup with no problems. I connected the receipt printer to the airport express using the USB slot available. While the printer comes up as available, when I attempt to print something, I get the error message "An error occurred printing this document" and I can cancel or Try again. No matter how many times I try, I continue to get this message and I lost as to the cause. When I disconnect and reconnect, another instance of the printer appears, but receive the same cryptic error message when I try to print. Totally lost, please help

    Hi kelston3,
    In order to print from an iPad you will need to use a printer that is compatible with AirPrint, which is described in the following article -
    About AirPrint
    http://support.apple.com/kb/HT4356
    AirPrint printers must be wireless on your network - not connected via USB to the base station. There is a list of printers that are known to be compatible with AirPrint in the article.
    Thanks for using Apple Support Communities.
    Best,
    Brett L

Maybe you are looking for

  • Trouble downloading photos from iphone to iphoto

    when i try and download my photos from my iphone 4s i get a message that says "iphoto cannot import your photos because there was a problem downloading an image" and the it stops downloading.  It doesn't indicate which image there is a problem with. 

  • Why is my iMac so slow?

    Do I need to reduce the number of applications working? Does it get slower when I charge my iPhone at the same time? It did not perform so slowly in the past. Sometimes it takes 15 seconds to bring up an application.

  • Mac mini Overscan problem

    Hello, i just purchased a Mac mini and have connected it with DVI to HDMI onto my Panasonic plasma TV. The problem with this was if i turn overscan on the display is too big and is extended over the sides and some area isn't visble to me. If i turn o

  • Vertical distance- IMAQ clamp max Function

    I need to find Vertical distance in an image- First of all, I select a region using a rectangle box. Then i choose the scan direction : Left to right OR Top to Bottom. For the Left to right scan direction, I use a IMAQ Clamp max function to calculate

  • Transport tablespace issue

    Hi, My ALTER TABLESPACE MFGDMDATA READ ONLY command was stuck. Problem :- I am unable to understand if there is no query on that tablespace then why My query was stuck for 2 hours? My finding was below =================== SQL> SELECT SQL_TEXT, SADDR