file The type "Date" was not found: How to resolve this issue?

5 years 9 months ago - 5 years 9 months ago #4258 by jxc328400
I am a java developer but new to Modelio.
I installed Modelio 3.5 on Windows 7 with modules "Java Designer", "Modeler Modules", "Persistent Profile", etc.
I am primarily interested in the "RoundTrip" code generation mode, as I am attaching a screenshot here.

My case is, if I create a java class diagram, and do a code generation, I get
Then I manually insert an attribute and a method in this java file, say,

public testMethod(String tableName, String columnName) {

public Date thisDate = null;

and click "Update Model from source if necessary", I want to see the model to show this method and attribute (that is "RoundTrip", right?), but Modelio does not understand the the java type "Date" and "String", for example, I got this warning:

The type "Date" was not found.
A "JavaTypeExpr" tagged value was generated for this type.

and the class model displays: thisDate: <no type>

I read some posts online and I was told I need to do some model-type and java-type mapping in the "javaCustomizationFile.xml". Here is my addins:

<ModelType name="date">
<JavaType name="Date">
<import name="java.util.Date"/>
<wrapper name="Date"/>
<ModelType name="string">
<JavaType name="String">
<import name="java.lang.String"/>
<wrapper name="String"/>

I found 3 javaCustomizationFile.xml in my machine, I am not sure which one is effective, so I added the above block to all of them, and restart the modelio. However, I am still having the same problem. The above xml-file block seems not effective.

Did I miss anything? Please help.


Please Log in or Create an account to join the conversation.

5 years 9 months ago #4261 by ebr

The mapping between Java types (String for example) and Modelio primitive types (string) is done by default.
You should check two things.
1) The JDK Path in the JavaDesigner module parameters

2) The accessible classes

Hoping it helps,

The following user(s) said Thank You: jxc328400

Please Log in or Create an account to join the conversation.

5 years 6 months ago #4358 by jxc328400
Thank you ebr for my late reply...
I was using Modelio 3.5, I can not follow your steps because I do not have "Java Designer by Modeliosoft". I guess it requires a paid license. Of course I believe I have the right JDK and rt.jar, etc, configured, but I always have the problem for "Round Trip".

However recently I installed Modelio 3.6. I exported by project from Modelio 3.5 and import it to the new version.and this problem seems gone! For example, in the modeled class if I have an attribute mySer, I generate the code and do some code modification via eclipse, then I tried "Update model from sources if neccessary", I got no errors and no warnings!

Thank you for your detailed explanation anyway,
best wishes

Please Log in or Create an account to join the conversation.

Moderators: tmachmaab
Time to create page: 0.514 seconds
^ Back to Top