DataControl and Java Generics

I tried to make DataControl from SessionBean:
@Stateless(name="SessionEJB")
public class SessionEJBBean implements SessionEJB, SessionEJBLocal {
@PersistenceContext(unitName="ExampleUnit")
private Entity Manager em;
public SessionEJBBean() {
public List<Employees> getAll(Employees p) {
return null;
public Result<Employees> getResult(Employees parametar) {
return null;
But my GENERIC type Result<T>, in the second method, caused problems.
When I remove this method, everything work just fine.
Is this a BUG, or I'm doing something wrong ?
ERROR:
java.lang.NullPointerException
     at oracle.adfdtinternal.model.ide.managers.BeanManager.findOrCreateBean(BeanManager.java:70)
     at oracle.adfdtinternal.model.ide.managers.BeanManager.findOrCreateBean(BeanManager.java:53)
     at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.build(StructureDefinitionBuilder.java:628)
     at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.generateXmlIfNecessary(StructureDefinitionBuilder.java:293)
     at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.buildMethods(StructureDefinitionBuilder.java:416)
     at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder$1.runHandlingExceptions(StructureDefinitionBuilder.java:647)
     at oracle.adfdt.jdev.transaction.JDevTransactionManager$1.performTask(JDevTransactionManager.java:54)
     at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:172)
     at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:103)
     at oracle.adfdt.jdev.transaction.JDevTransactionManager.runTaskUnderTransaction(JDevTransactionManager.java:43)
     at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.build(StructureDefinitionBuilder.java:653)
     at oracle.adfdtinternal.model.ide.objects.builders.JSR227BeanXmlBuilder.build(JSR227BeanXmlBuilder.java:32)
     at oracle.adfdtinternal.model.ide.adapter.AdapterDCHelper.addCreatableTypes(AdapterDCHelper.java:175)
     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:585)
     at oracle.adfdt.model.datacontrols.JUDTAdapterDataControl.internalRefreshStructure(JUDTAdapterDataControl.java:624)
     at oracle.adfdt.model.datacontrols.JUDTAdapterDataControl.refreshStructure(JUDTAdapterDataControl.java:275)
     at oracle.adfdtinternal.model.ide.factories.adapter.DCFactoryAdapter.createDataControl(DCFactoryAdapter.java:365)
     at oracle.adfdtinternal.model.ide.factories.adapter.DCFactoryAdapter.createDataControl(DCFactoryAdapter.java:236)
     at oracle.adfdtinternal.model.ide.ProjectCompileListener.invokeFactory(DataControlFactoryMenuListener.java:250)
     at oracle.adfdtinternal.model.ide.DataControlFactoryMenuListener.handleCreateDataControl(DataControlFactoryMenuListener.java:207)
     at oracle.adfdtinternal.model.ide.DataControlFactoryMenuListener.mav$handleCreateDataControl(DataControlFactoryMenuListener.java:35)
     at oracle.adfdtinternal.model.ide.DataControlFactoryMenuListener$1.run(DataControlFactoryMenuListener.java:141)
     at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:615)
     at java.lang.Thread.run(Thread.java:595)

Hi,
I tried the usecase with POJOs
package pojo;
import java.util.ArrayList;
public class SessionFacade {
    ArrayList<Employees> al = new ArrayList<Employees>();
    public SessionFacade() {
        Employees e1 = new Employees();
        e1.setAge(2);
        e1.setFirstname("Hello");
        e1.setName("Test");
        al.add(e1);
    public void setAl(ArrayList<Employees> al) {
        this.al = al;
    public ArrayList<Employees> getAl() {
        return al;
package pojo;
public class Employees {
String name;
String firstname;
int age;
    public Employees() {
    public void setName(String name) {
        this.name = name;
    public String getName() {
        return name;
    public void setFirstname(String firstname) {
        this.firstname = firstname;
    public String getFirstname() {
        return firstname;
    public void setAge(int age) {
        this.age = age;
    public int getAge() {
        return age;
}with no errors
Frank

Similar Messages

  • Can someone help me understand this? (java generics wildcards)

    Hi all.
    First of all this is my first post on sun forums. Besides that i only used java for few weeks now and i think java is quit a nice language.
    I do have a question regarding java generics and wildcard casting (if you can call it that).
    Assume you have following code.
    public class Test <T extends Number> {
         private T x;
         Test(T x)
              this.x = x;
         T getX()
              return x;
         <U extends Number> void setX(U x)
              this.x = (T)x;
    public class Main {
         public static void main(String[] args) {
              Test<Integer> p = new Test <Integer>(5);
              System.out.println(p.getX());
              p.setX(53.32);
              System.out.println(p.getX());
    }This compiles with following results:
    5
    53.32
    Question:
    First: If I declared p to be of type Test<Integer> then why did x in Test class changed its type from Integer to Double?
    Second: Is this a possible unchecked casting behavior? and if so why does this work but doing something like this :
    Integer x = 5 ;
    Double y = 6.32;
    x=(Integer)y;fails with compile time error?

    Hello and welcome to the Sun Java forums.
    The behavior you describe would not occur if your setX(?) method used T instead of another type constraint.
    However, let's look at why it works!
    At line 1 in main, you create your Test with a type parameter of Integer; this becomes the type variable T for that particular instance of Test. The only constraint is that the type extends/implements Number, which Integer does.
    At line 2 you obtain a reference to a Number, which is what getX() is guaranteed to return. toString() is called on that object, etc.
    At line 3 you set the Number in the Test to a Double, which fits the type constraint U extends Number, as well as the type constraint T extends Number which is unused (!). Note that using a different type constraint for U, such as U extends Object or U super Number, could cause a compile-time error.
    At line 4 you obtain a reference to a Number, which is what getX() is guaranteed to return.
    The quirky behavior of setX is due to the second type constraint, which is obeyed separately; in this case, you probably want to use void setX(T x) {
    this.x = x;
    }edit: For the second part of your question, x = (Integer)y; fails because Integer and Double are distinct types; that is, Integer is not a subclass of Double and Double is not a subclass of Integer. This code would compile and work correctly: Number x = 5 ;
    Double y = 6.32;
    x=y;s
    Edited by: Looce on Nov 15, 2008 7:15 PM

  • SQLJ and Java Stored Procedures

    Hi,
    Am very sorry, if I am taxing you too much with Java Stored Procedures!!
    However, I have struggling with it for more than 3 days or so.So please bear with me
    I am facing a peculiar problem on the subject.
    I have deployed a Java Stored Procedure using Connection name as "JDBC" through JDev.
    My client calls the Stored procedure getDept as follows:
    int deptNo = 0;
    String deptName = null,
    deptLoc = null;
    #sql {
    call sample.getDept( :out deptNo,
    :out deptName,
    :out deptLoc)
    In my project properties , in SQLJ tab, when I select "JDBC" as my connectionName, and leave the ContextName blank(i.e. DefaultContext), I get the following error :
    Error: [26] Not Found: SAMPLE.GETDEPT There is no stored procedure with this name
    When I leave the ConnectionName as blank (which I suppose means donot do online checking!!), it compiles OK.
    Howvever, it is not able to run my SQLJ file!!
    Cannot figure out why this is happening.Please help!!
    TIA
    Sandeep
    null

    Looks like Java stored procedure don't support the return of result sets to the client. Given the complexity and non-generic 'cursor ref' approach that Oracle has always implemented, I guess it is not too surprising. I suggest throwing the select into a work table and pulling the rows from there. If you are in a COM capable environment, you can use 0040 to get back a Dynaset, but be aware, it is live!
    Good luck.
    Cal

  • Icon file for windows, of Duke and java cup, etc.

    Hi Folks,
    I'm looking for a file that contains icons of Duke, the Java steaming cup, and other generic Java icons.
    I want to associate these icons with my *.java, *.class, and *.jar files on my windows platform.
    I found Duke in
    C:/WINNT/system32/plugincpl131_01.cpl
    but I'd like others, too.
    Thanks,
    Jeremy |-)
    [email protected]

    Hi Folks,
    I'm looking for a file that contains icons of Duke,
    the Java steaming cup, and other generic Javaicons.
    I want to associate these icons with my *.java,
    *.class, and *.jar files on my windows platform.
    I found Duke in
    C:/WINNT/system32/plugincpl131_01.cpl
    but I'd like others, too.
    Thanks,
    Jeremy |-)
    [email protected]
    Hi Folks,
    Me again. I used iconRipper in my Java installation
    (at the suggestion of another poster in this forum)
    and found the steaming cuppa Joe in:
    .../jdk1.3.1_01/jre/bin/awt.dll
    and a thumbs up Duke and arms akimbo Duke in:
    .../jdk1.3.1_01/jre/bin/jpishare.dll
    What icons do others use (if any) for their various
    Java files on windows?
    Thanks,
    Jeremy |-)
    [email protected]
    Hi Folks,
    Me again. Looks like I'm talking to myself. Well, that's ok. Us English are known to do that (but only after years of acquaintance).
    I guess we're out of luck. In Java 1.4, all the Duke icons disappeared from the files mentioned above. The steaming java ones are mostly still there, but sligtly modified. And the one file (jpishare.dll) has fuzzy low-res cups in place of the Dukes!
    Ah well,
    Jeremy |-)

  • One thing java generics are missing

    specialization!
    I'll give you a templated example with a function here:
    template <typename T>
    inline std::string to_string(const T& t)
    std::istringstream ss;
    ss << t;
    return ss.str();
    that's one of those standard conversion snippets that everyone uses... as long as T supports the "<<" operator, it will convert just fine...
    Now, if you're using this function in other template based code, the problem comes up:
    template <typename T>
    void foo(const T& t)
    std::string s = to_string(t);
    ... do something with s now...
    it makes sense, if you want to do operations with a string... but what if the type T *was* a string... the to_string function just did a whole mess of needless operations (stringstream conversion)...
    here comes template specialization to the rescue:
    template <> inline std::string to_string<std::string>(const std::string& t)
    return t;
    there we go... no extra steps... because it's inlined to begin with, the compiler will remove it... (this is what's called a conversion shim).  Now when the to_string function is called with an std::string argument, it does nothing.

    Hmmm, it seems I didn't explain it too well:
    the 3rd snippit is the same as the first, however the "typename T" has been removed and all instances of "T" have been replaced with a specific type: this is template specialization... it allows for you to have different code for each type... it's a complicated form of function overloading....
    what I'm saying is that, in a java generic collection, you may have all this code that works for all types, but could be optimized for one of those types... I used string above...
    for instance... let's say there's a member function to count the number of characters used if the type were converted to a string... the easiest thing to do would be to convert it to a string an get the length.... however, in the case of numbers, there's a much, much more efficient way to do it (can't recall the algorithm... but you can get the number of digits with division and maybe a log10 or something...)... this is a mundane case, but even if you did want to use that math for the int version of that generic, you couldn't...

  • Programming task: Java Generics

    Hi,
    I am new to Java Generics.
    Please suggest a programming task, which when implemented, let me study the features of Java Generics.
    Thanks in advance.

    Here are some same tasks
    - Create a simple static method which returns its only parameter as the same type. Call it "runtime". (Can you suggest a use for it ;)
    - Create a simple ArrayList with an add, size and get(int) method.
    - Create a Comparator which wraps another Comparator which works in the opposite direction. i.e. it return -1 instead of 1 and visa-versa.

  • Whats is difference between Java JRE  and  Java SDK

    Hi,
    what is the difference between Java JRE and Java SDK...
    i think both of them have the same set of files to be installed...
    I am not able to understand where they differ

    The JRE (Java runtime Environment) contains just the stuff necessary to run Java and the SDK (System Development Kit) contains the extra stuff necessary (and also helpful) to develop in Java.

  • What is difference between C# Gzip and Java swing GZIPOutputStream?

    Hi All,
    I have a Java swing tool where i can compress file inputs and we have C# tool.
    I am using GZIPOutputStream to compress the stream .
    I found the difference between C# and Java Gzip compression while a compressing a file (temp.gif ) -
    After Compression of temp.gif file in C# - compressed file size increased
    while in java i found a 2% percentage of compression of data.
    Could you please tell me , can i achieve same output in Java as compared to C# using GZIPOutputStream ?
    Thank a lot in advance.

    797957 wrote:
    Does java provides a better compression than C#?no idea, i don't do c# programming. and, your question is most likely really: "does java default to a higher compression level than c#".
    Btw what is faster compression vs. better compression?meaning, does the code spend more time/effort trying to compress the data (slower but better compression) or less time/effort trying to compress the data (faster but worse compression). most compression algorithms allow you to control this tradeoff depending on whether you care more about cpu time or disk/memory space.

  • What is the diffrence between package javax.sql and java.sql

    Is javax designed for J2EE?
    And when to use package javax?

    Hi,
    What is the diffrence between package javax.sql and java.sql?The JDBC 2.0 & above API is comprised of two packages:
    1.The java.sql package and
    2.The javax.sql package.
    java.sql provides features mostly related to client
    side database functionalities where as the javax.sql
    package, which adds server-side capabilities.
    You automatically get both packages when you download the JavaTM 2 Platform, Standard Edition, Version 1.4 (J2SETM) or the JavaTM 2, Platform Enterprise Edition, Version 1.3 (J2EETM).
    For further information on this please visit our website at http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Systems
    http://www.sun.com/developers/support/

  • What is the diffrence between My Runnable Interface and Java Runnable

    Hi folks
    all we know that interfaces in java just a decleration for methods and variables.
    so my Question is why when i create an interface its name is "Runnable" and i declared a method called "run" inside it.then when i implements this interface with any class don't do the thread operation but when i implement the java.lang.Runnable the thread is going fine.
    so what is the diffrence between My Runnable Interface and Java Runnable?
    thnx

    Hi folks
    all we know that interfaces in java just a decleration
    for methods and variables.
    so my Question is why when i create an interface its
    name is "Runnable" and i declared a method called
    "run" inside it.then when i implements this interface
    with any class don't do the thread operation but when
    i implement the java.lang.Runnable the thread is going
    fine.
    so what is the diffrence between My Runnable Interface
    and Java Runnable?
    thnxClasses and interfaces are not identified by just their "name", like Runnable. The actual "name" the compiler uses is java.lang.Runnable. So even if you duplicate the Runnable interface in your own package, it's not the same as far as the compiler is concerned, because it's in a different package.
    Try importing both java.util.* and java.awt.* (which both have a class or interface named List), and then try to compile List myList = new ArrayList();

  • Java SE and Java EE

    I am a IT graduate and I still need some clarification on the relationship between Java SE and Java EE API. Does EE include SE?
    For application development, I know I can use only SE without the EE, but can I use EE alone without SE?
    Any good articles addressing my questions?
    Thank you very much
    R

    Java EE in fact extends java SE, its primarily aim is to simplify developing multitier enterprise applications (Java SE provides all the necessary basic libraries etc.)
    Because Java EE is an extension of Java SE, you cant use EE without SE - without SE there is no EE.

  • SSO between Portal and Java WD application

    Hi Experts,
    I am using CE 7.2 on localhost and I am very new to SAP.
    I need to know how can I get SSO between Portal and Java WD.  I have a WD application that displays the logged in user using "IUser currentUser = WDClientUser.getCurrentUser().getSAPUser()", as well I can use "IUser user = UMFactory.getAuthenticator().getLoggedInUser()".  Both work.
    Q1. What is the difference in the 2 above?
    Q2. My WD application is set to authenticate user.  The WD application is in URL iView.  I need SSO between Portal and WD application.   Is there a way to get this SSO without SAP Backend (ECC), for now I just need SSO between Portal and Java WD appl.
    Everything is in localhost.
    Please advice. Thanks.

    > need to know how can I get SSO between Portal and Java WD.
    Then I suggest you ask your question in the Web Dynpro Java forum instead of the Web Dynpro ABAP one.

  • J2me and java card, need help to communicate

    we are trying to put together a reader to read smartcards using j2me and we figure that it would be easiest if we could develop it to work with java cards rather than standard smart cards, the problem is we get garbage when we communicate to it, the chip sends us crap, any suggestions what might be wrong, any calls we might be missing, has anyone worked with j2me and java cards or smart cards, any help would be appreciated.
    einar

    .... reader app and the ME behind it .... smells like mobile ....
    First of all - if you want to have one mobile application running on this just make sure that whatever is written in ME can use drivers from the reader chip ....
    Workin on the PC is something completely different. There was one good example how to develop one host application in Java provided with the JCOP tools long ago ... I don't know if this is now in the new Eclipse tools.
    But - there was a small API provided that can give you good hints what to do - and - once you have it on the reader side - you can easily integrate ME methods with this ...

  • Eclipse 3.4 and Java 6 compatibility

    Hi All,
    I have a tomcat plugin inside Eclipse 3.4.2. Recently I upgraded from Java 5 to Java 6. When I try to start Tomcat from Eclipse,I get the following error:
    Error occurred during initialization of VM
    java.lang.UnsatisfiedLinkError: java.lang.Float.floatToIntBits(F)I
         at java.lang.Float.floatToIntBits(Native Method)
         at java.lang.Math.<clinit>(Math.java:801)
         at sun.net.www.ParseUtil.lowMask(ParseUtil.java:512)
         at sun.net.www.ParseUtil.<clinit>(ParseUtil.java:559)
         at sun.misc.Launcher.getFileURL(Launcher.java:388)
         at sun.misc.Launcher$ExtClassLoader.getExtURLs(Launcher.java:165)
         at sun.misc.Launcher$ExtClassLoader.<init>(Launcher.java:137)
         at sun.misc.Launcher$ExtClassLoader$1.run(Launcher.java:121)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.Launcher$ExtClassLoader.getExtClassLoader(Launcher.java:118)
         at sun.misc.Launcher.<init>(Launcher.java:51)
         at sun.misc.Launcher.<clinit>(Launcher.java:39)
         at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1304)
         at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1286)
    Kindly suggest what needs to be done? If I am posting it in a wrong forum please suggest me the right one too.
    I would like to know if Eclipse 3.4 and Java 6 are compatible or not.
    Thanks in advance.

    ShubhaPradeep wrote:
    I have a tomcat plugin inside Eclipse 3.4.2. Recently I upgraded from Java 5 to Java 6. When I try to start Tomcat from Eclipse,I get
    Error occurred during initialization of VM
    java.lang.UnsatisfiedLinkError: java.lang.Float.floatToIntBits(F)IAre we talking 64-bit Linux?
    I had issues launching eclipse on CentOS 5 64-bit and Sun JDK 1.6,
    resolved by launching eclipse with the -vm option specifying Sun JDK 1.5 java.
    [https://www.centos.org/modules/newbb/viewtopic.php?post_id=95784&topic_id=11661]

  • Problem with win2000sp3 and Java web start

    I have JRE and Java web start (1.2.0_01, build b01) which come downloading file j2re-1_4_1_01-windows-i586-i.exe from sun.
    I have win2000pro running on my PC.
    I had updated win2000 to service pack 2 and everything was fine.
    Now i decided to update to service pack 3 (in the process I also updated other components) from Microsoft and:
    1) Java applets seem to be running fine within i.e.
    2) If i try to run an application from java web start my PC freezes and I have to restart it.
    3) Staroffice 6.0, which runs on Java, seems to be fine.
    I reinstalled both sp3 and jre etc, with no result.
    Is this a known problem?
    Thanks to all.
    Maurizio

    I suspect that you have hit a known problem with Swing on Java 1.4.1 with buggy video drivers. Do you have an ATI card? They are the worst offenders. ATI released new drivers for its Radeon line today. They fix the problem.

Maybe you are looking for