java: error: incompatible types: java.lang.String cannot be converted to myfirstmodule.proxies.String

2
\javasource\myfirstmodule\proxies\Enumeration_2.java:9: error: incompatible types: java.lang.String cannot be converted to myfirstmodule.proxies.String This error appears when I create a new Enumeration at step 6 below… I have previously: Created a new Project Created an Enumeration (to demonstrate all is well) Created a Consumed web service Created an XML to domain mapping for the web service Used Map automatically to create Domain objects At this point all is well, the project will compile and were I to call the web service (using custom XML) it would return the expected results Create a new Enumeration and no matter what the Captions or Names, I get the java compile error below: compile: [javac] Compiling 3 source files to C:\Users\User\Documents\Mendix\Play Time-main\deployment\run\bin [javac] C:\Users\User\Documents\Mendix\Play Time-main\javasource\myfirstmodule\proxies\Enumeration2.java:9: error: incompatible types: java.lang.String cannot be converted to myfirstmodule.proxies.String [javac] mcq(new String[][] { new String[] { "enUS", "mcq" } }), For good measure I have exported to Eclipse and the following is the build message I get: build: build: [bnd] # addAll 'deployment/run/bnd.bnd' with , [bnd] Warnings [bnd] Split package, multiple jars provide the same package:com/mendix/core [bnd] Use Import/Export Package directive -split-package:=(merge-first|merge-last|error|first) to get rid of this warning [bnd] Package found in [Jar:mxruntime, Jar:run] [bnd] Class path [Jar:biz.aQute.bnd.annotation, Jar:org.scala-lang.scala-library, Jar:datastorage-api, Jar:json, Jar:logging, Jar:m2ee-api, Jar:mxruntime, Jar:integration, Jar:osgi.cmpn, Jar:webui, Jar:javax.servlet, Jar:axiom-api-1.2.12, Jar:commons-lang-2.5, Jar:commons-logging-1.1, Jar:guice-2.0, Jar:openid4java-0.9.8, Jar:run] [bnd] # project (project.jar) 131 BUILD SUCCESSFUL Bright ideas much appreciated. Thanks Stuart
asked
2 answers
3

Stuart, have you reviewed my suggestion above of looking for a domain model entity or an enumeration called "String" in your module? This portion of the error:

myfirstmodule.proxies.String

leads me to believe that there is a Mendix auto-generated proxy class called String in your module. Since Mendix creates these classes for each entity and enumeration in your domain model (to make it easier to access data via Java), this probably is interfering with the standard:

java.lang.String

or just "String" as we so commonly refer to it in code. If some portion of the auto-generated code is trying to instantiate a "String", it may instead be accidentally creating a myfirstmodule.proxies.String instead.

This is all conjecture since I can't see your model, but I'd be very interested to see if this is the solution.

answered
0

My first guess would be that this is the result of an incorrect library / interface binding. It might be worth trying to remove all non-essential and/or duplicate user-libraries from your project's Userlib folder and see if it has any effect.

answered