|
|
|
|
|
|
Re: runtime error when creating a simple class in a java program [message #696877 is a reply to message #696865] |
Fri, 15 July 2011 02:50 |
Ed Merks Messages: 33147 Registered: July 2009 |
Senior Member |
|
|
Ctrl-Shift-T can be very helpful for finding a class. You can use the
"Link with Editor" button in the project explorer to find out where that
file is located. I'll bet you can guess which jar it's in just from the
package name and looking at the bundle names...
On 14/07/2011 6:44 PM, Wuwei wrote:
> Ed,
> Sorry, how do I know which jar has CacheAdapter? I tried to read the
> FAQ but not quite understand it. I think Q. 6 might be relevant to my
> problem but have no idea how to solve it. Thanks.
>
>
> Ed Merks wrote on Thu, 14 July 2011 18:41
>> In which jar is the CacheAdapter class and have you put it on your
>> classpath? I assume you've looked it
>> http://wiki.eclipse.org/MDT/UML2/FAQ too...
>>
>>
>> On 14/07/2011 2:50 PM, Wuwei wrote:
>> > Hi, Ed,
>> > I don't get your idea. Can you tell me what I should do in
>> details. > What I did
>> > is to just create a Java Project and then add those jar files to
>> the > library since
>> > I only want to play with the UML2's implemenation. Thanks.
>> >
>> >
>> > Edward Willink wrote on Thu, 14 July 2011 17:12
>> >> HI
>> >>
>> >> Looks familiar. I suspect that you haven't replicated the Eclipse
>> >> plugin registrations for standalone usage.
>> >>
>> >> You may find org.eclipse.ocl.uml.OCL.initialize(ResourceSet) helpful.
>> >>
>> >> Regards
>> >>
>> >> Ed Willink
>> >>
>> >> On 14/07/2011 21:00, Wuwei wrote:
>> >> > I try to use java to create a simple class diagram. But I get
>> some >> > runtime error.
>> >> > Here is the code:
>> >> >
>> >> > Model myModel = UMLFactory.eINSTANCE.createModel();
>> >> > //myModel.setName("MyFirstModel");
>> >> > Class department = UMLFactory.eINSTANCE.createClass();
>> >> > Property dept_name = UMLFactory.eINSTANCE.createProperty();
>> >> >
>> >> > dept_name.setName("address");
>> >> > dept_name.setType(department);
>> >> >
>> >> > department.getOwnedAttributes().add(dept_name);
>> >> >
>> >> > It seems the above setter methods dont work and neither does
>> add. >> The > error I got
>> >> > is:
>> >> >
>> >> > Exception in thread "main" java.lang.NoClassDefFoundError: > >>
>> org/eclipse/uml2/common/util/CacheAdapter
>> >> > at > >>
>> org.eclipse.uml2.uml.internal.impl.ElementImpl.getCacheAdapter(ElementImpl.java:714)
>> >> > at > >>
>> org.eclipse.uml2.uml.internal.impl.ElementImpl.eNotificationRequired(ElementImpl.java:852)
>> >> > at > >>
>> org.eclipse.uml2.uml.internal.impl.NamedElementImpl.setName(NamedElementImpl.java:263)
>> >> > at MyUML.main(MyUML.java:17)
>> >> >
>> >> >
>> >> > Thanks.
>> >> >
>> >
>> >
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03182 seconds