Results 1 to 3 of 3
  1. #1
    tarat is offline Member
    Join Date
    Jan 2008
    Posts
    2
    Rep Power
    0

    Unhappy Jasper report + JPQL

    Hi!

    I've a problem and I didn't find any information on WEB about it so I try to use your experiment.
    I try to use Jasper Report with EJBQL:
    <queryString language="ejbql"><![CDATA[SELECT p, k FROM
    PmUser p JOIN p.PmUserBeosztasCollection c JOIN c.beosztas k]]></queryString>
    The problem is...p and k also have a field with a same name.

    So when I try to use these names:

    <field name="p.nev" class="java.lang.String"/>
    <field name="aktiv" class="java.lang.Short"/>
    <field name="admin" class="java.lang.Short"/>
    <field name="k.nev" class="java.lang.String"/>

    I have got an error:
    Error retrieving field value from bean : p.nev
    ------------------
    This works quite well:

    <queryString language="ejbql"><![CDATA[SELECT p FROM
    PmUser p JOIN p.PmUserBeosztasCollection c JOIN c.beosztas k]]></queryString>

    <field name="nev" class="java.lang.String"/>
    <field name="aktiv" class="java.lang.Short"/>
    <field name="admin" class="java.lang.Short"/>

    but I have to use k.nev..

    Please help me!
    Thanks a lot...tarat

  2. #2
    tarat is offline Member
    Join Date
    Jan 2008
    Posts
    2
    Rep Power
    0

    Default

    OK..
    I have the answer.
    Every column in Jasper has an autoincrement field so the fields are:

    <queryString language="ejbql"><![CDATA[SELECT
    p.nev, p.aktiv, p.admin, k.nev
    FROM
    PmUser p JOIN p.PmUserBeosztasCollection c JOIN c.beosztas k]]></queryString>

    <field name="COLUMN_1" class="java.lang.String"/>
    <field name="COLUMN_2" class="java.lang.Short"/>
    <field name="COLUMN_3" class="java.lang.Short"/>
    <field name="COLUMN_4" class="java.lang.String"/>

  3. #3
    kahlel is offline Member
    Join Date
    Aug 2008
    Posts
    1
    Rep Power
    0

    Default

    Quote Originally Posted by tarat View Post
    I have got an error:
    Error retrieving field value from bean : p.nev
    Te voy a contestar en español así que tal vez tengas que buscar un traductor

    Este código genera esa excepción

    if (bean != null)
    101 {
    102 try
    103 {
    104 value = PropertyUtils.getProperty(bean, propertyName);
    105 }
    106 catch (java.lang.IllegalAccessException e)
    107 {
    108 throw new JRException("Error retrieving field value from bean : " + propertyName, e);
    109 }
    110 catch (java.lang.reflect.InvocationTargetException e)
    111 {
    112 throw new JRException("Error retrieving field value from bean : " + propertyName, e);
    113 }
    114 catch (java.lang.NoSuchMethodException e)
    115 {
    116 throw new JRException("Error retrieving field value from bean : " + propertyName, e);
    117 }
    118 catch (IllegalArgumentException e)
    119 {
    120 //FIXME replace with NestedNullException when upgrading to BeanUtils 1.7
    121 if (!e.getMessage().startsWith("Null property value for "))
    122 {
    123 throw e;
    124 }
    125 }

    bean es el objeto que estas intentando obtener, así que ahí esta el error a la hora de hacer get al bean el .jar te envía esa excepción así que asegurar de que ese bean esta bien construido, yo te recomendaría también que no uses punto al escribir los nombres tal vez puedas usar el caracter _

Similar Threads

  1. Crystal report with JSP
    By fred in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 12-17-2008, 09:27 PM
  2. Error With Sql And Jasper Report
    By Heather in forum JDBC
    Replies: 4
    Last Post: 12-03-2008, 12:31 PM
  3. org.apache.jasper.JasperException: null
    By ranjan_ashish26 in forum Java Servlet
    Replies: 1
    Last Post: 03-21-2008, 06:06 AM
  4. Jasper iReports and Java
    By shinky in forum New To Java
    Replies: 2
    Last Post: 08-09-2007, 10:24 AM
  5. Jasper Report + iReport + NetBeans 4
    By Ed in forum NetBeans
    Replies: 2
    Last Post: 07-02-2007, 08:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •