Submit a problem

In order to provide you the best help possible to analyze and debug your problems please provide us some information about your environment.
When you submit a problem, please indicate:
- The Version, Build Id, Core Id, System and Architecture (You can get these information in the Help/About menu entry)
- The Modelio Edition (Modelio Open Source or Modelio by Modeliosoft)
- Your Operating System

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

7 months 2 weeks ago - 7 months 2 weeks 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 ABC.java.
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"/>
</JavaType>
</ModelType>
<ModelType name="string">
<JavaType name="String">
<import name="java.lang.String"/>
<wrapper name="String"/>
</JavaType>
</ModelType>

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.

Attachments:

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

7 months 1 week ago #4261 by ebr
Hi,

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,

EBR
Attachments:
The following user(s) said Thank You: jxc328400

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

4 months 3 weeks 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 ABC.java if I have an attribute java.io.Serializable 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.266 seconds
^ Back to Top