当前位置: 代码迷 >> Rational >> rational rose生成Java代码的异常
  详细解决方案

rational rose生成Java代码的异常

热度:7565   发布时间:2013-02-26 00:00:00.0
rational rose生成Java代码的错误
在网上找到了这样一段话,是用rose生成代码的。
先在某一个或某几个class diagram中建好你要生成代码的所有class,右键单击Browser区域的Component View,新建一个Component,双击这个component,打开它的Specification对话框,选择Realizes属性页,会看到你刚才所建的所有的class,分别右击每一个class,在菜单里选“Assign”,这样就把这些class分配给了这个component。再选择General属性页,在Language右边的下拉框中选择ANSI C++或者其他合适的选项,点OK退出对话框。  
  这时,在右击这个component,会看到多了一个ANSI C++的菜单项,在它的二级菜单中选择Generate code,按照提示做既可!

照着做了,最后生成的时候提示错误:

15:38:04| ERROR: Component Component View::serverComponet - name of public class and compilation unit must match. To generate code, please rename the class to match the compilation unit or detach it from the compilation unit.
15:38:04| ERROR: Component Component View::serverComponet - a compilation unit can have at most one public class

不知道是什么原因。

------解决方案--------------------------------------------------------
  相关解决方案