Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Type Mismatch

dadams07Jul 11 2014 — edited Jul 22 2014

I have a class defined as follows:

public class MultiFacilitySearchDataProvider <T extends Facility & MilepostValue & Copyable<T>>

The class has this method:

protected T getFacility(final FacilityInstance instance) {

    final MultiFacilitySearchDAO dao = new MultiFacilitySearchDAO(instance);

    ENM.execute(dao);

   return dao.getResultModel();  // Compile error here

}

The DAO method called above looks like this:

public MultiFacilitySearchModel getResultModel() {

    return resultModel;

}

And MultiFacilitySearchModel is defined as follows:

public class MultiFacilitySearchModel implements Copyable<MultiFacilitySearchModel>, Facility,

     Serializable, MilepostValue, MenuDisplayValues

The problem is that the line return dao.getResultModel() generates a compile error "Type mismatch: cannot convert from MultiFacilitySearchModel to T". I don't understand why I'm getting this error, since MultiFacilitySearchModel implements the three interfaces specified for the generic type T. What am I missing?

Comments

W McNeil

We've encountered the same error.

Answer

please use JDK 11

Marked as Answer by User_3WNMA · Jan 14 2022
W McNeil

OK - The software is bundle with Java 8. I'll try 11 and report back.
thanks.

User_3WNMA

Thanks! This fixed the problem for me, I just had to set the path for Java JDK home to JDK 11.

C. L.

Hi there
We are having the same issue and I wanted to ask: Is open JDK 11 supported?
Thanks in advance!

Peter Schnieder

We observe the same issue with the latest version of DataModeler.
I am wondering why SQLDeveloper and DataModeler are shipped with JDK8 although it is known that there is an issue with that version of Java.
To be honest we are unsure to use Java 11. What about the licences if we use Java 11? So my question is like C.L.s one: Is it possible to use DataModeler with Open JDK11?
Thanks and with best regards

There is no problem to use Oracle product with Oracle JDK 11. We don't support Open JDK 11. You can use it but if you try to log service request we'll ask the problem to be reproduced with Oracle JDK
Philip

C. L.

Thanks for your feedback.

Regarding JDK 11, JDK8 is free with the use of SQL Developer, is that also the case with JDK11 or are there separate licenses required?
Regards

Senkum

I installed the latest JDK version of 11.0.13. However, SDDM is now throwing a warning as my current version (Version 21.4.1.349, Build 349.1605) supports JDK less than 11.0.10!
The transformation scripts worked though.
Thanks!

W McNeil

To switch to an installed JDK 11 update sqldeveloper.conf - add the following line.

SetJavaHome C:\Program Files\Java\jdk-11.0.14

robgauf

Confirming as well that this fixes the missing script engine problem:
Install a JDK 11 as pulled from the Oracle Java SE 11 Archive Downloads area (in my case 11.0.13). NOTE: the latest JDK 17 does NOT have the Oracle Nashua script engine (so even the Tools - Custom Transformations panel throws error messages).
Update the <user>\AppData\Roaming\datamodeler\<product version>\product.conf file to add the SetJavaHome statement (as noted above).
Accept the SD-DM startup warning about running too new a JDK (as noted above).
And yes lo and behold the Custom Transformation scripts do run again.

1 - 11
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 19 2014
Added on Jul 11 2014
1 comment
1,384 views