Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Problem running uml2 api program
Problem running uml2 api program [message #475210] Thu, 23 August 2007 16:44 Go to next message
Manu is currently offline ManuFriend
Messages: 16
Registered: July 2009
Junior Member
Hi to all!
I've the following problems.
The first is this: I've tried to run like Java Application the
gettingStartedWithUML2 program, but I've the following messages like
output:

Could not find the main class. Program will exit.

java.lang.NoClassDefFoundError:
org/eclipse/emf/common/util/WrappedException
Exception in thread "main"

I've followed all the steps indicated in the gettingStartedWithUML2
article. The file that i've run is the .class not the .java .

The second problem is about a simple program that I've written but when I
try to run it I get te follow error message in the console:

Create Model...
Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/uml2/common/util/CacheAdapter
at
org.eclipse.uml2.uml.internal.impl.ElementImpl.getCacheAdapt er(ElementImpl.java:714)
at
org.eclipse.uml2.uml.internal.impl.ElementImpl.eNotification Required(ElementImpl.java:852)
at
org.eclipse.uml2.uml.internal.impl.NamedElementImpl.setName( NamedElementImpl.java:232)
at model.ModelUml.createModel(ModelUml.java:28)
at model.ModelUml.main(ModelUml.java:49)

This is the code:

package model;

import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.UMLFactory;

public class ModelUml {
public static boolean DEBUG = true;

protected static void out(String output)
{
if(DEBUG)
{
System.out.println(output);
}
}

protected static void err(String error)
{
System.err.println(error);
}

protected static Model createModel(String name)
{
Model model = UMLFactory.eINSTANCE.createModel();
model.setName(name);

out("Model '" + model.getQualifiedName() + "' created.");

return model;

}



public static void main(String[] args) {

System.out.println("Create Model...");
Model epoModel = createModel("Modello");
System.out.println("Model created");

}
}

I'm using the Eclipse 3.3 and the last version of UML2 plug-in.
Anyone can help me, please?

Thank you

Manu
Re: Problem running uml2 api program [message #475212 is a reply to message #475210] Thu, 23 August 2007 22:04 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Manu,

The getting started article is a little out of date but should still work
fine. I just gave it a try and it everything seemed ok.
I find it strange that you are having issues like "Could not find the main
class". There probably is an issue with how you configured your
environment.
I also looked at the code that creates the CacheAdapter and it also seemes
ok.

Can you try to update your environment once more.
Any other details would be helpful.

Perhaps someone else has also experienced this?

- James.

"Manu" <zappasan@gmail.com> wrote in message
news:e6102edd3bba213dd2eaec66060d9570$1@www.eclipse.org...
> Hi to all!
> I've the following problems.
> The first is this: I've tried to run like Java Application the
> gettingStartedWithUML2 program, but I've the following messages like
> output:
>
> Could not find the main class. Program will exit.
>
> java.lang.NoClassDefFoundError:
> org/eclipse/emf/common/util/WrappedException
> Exception in thread "main"
>
> I've followed all the steps indicated in the gettingStartedWithUML2
> article. The file that i've run is the .class not the .java .
>
> The second problem is about a simple program that I've written but when I
> try to run it I get te follow error message in the console:
>
> Create Model...
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/uml2/common/util/CacheAdapter
> at
>
org.eclipse.uml2.uml.internal.impl.ElementImpl.getCacheAdapt er(ElementImpl.j
ava:714)
> at
>
org.eclipse.uml2.uml.internal.impl.ElementImpl.eNotification Required(Element
Impl.java:852)
> at
>
org.eclipse.uml2.uml.internal.impl.NamedElementImpl.setName( NamedElementImpl
..java:232)
> at model.ModelUml.createModel(ModelUml.java:28)
> at model.ModelUml.main(ModelUml.java:49)
>
> This is the code:
>
> package model;
>
> import org.eclipse.uml2.uml.Model;
> import org.eclipse.uml2.uml.UMLFactory;
>
> public class ModelUml {
> public static boolean DEBUG = true;
>
> protected static void out(String output)
> {
> if(DEBUG)
> {
> System.out.println(output);
> }
> }
>
> protected static void err(String error)
> {
> System.err.println(error);
> }
>
> protected static Model createModel(String name)
> {
> Model model = UMLFactory.eINSTANCE.createModel();
> model.setName(name);
>
> out("Model '" + model.getQualifiedName() + "' created.");
>
> return model;
>
> }
>
>
>
> public static void main(String[] args) {
>
> System.out.println("Create Model...");
> Model epoModel = createModel("Modello");
> System.out.println("Model created");
>
> }
> }
>
> I'm using the Eclipse 3.3 and the last version of UML2 plug-in.
> Anyone can help me, please?
>
> Thank you
>
> Manu
>
>
Re: Problem running uml2 api program [message #475213 is a reply to message #475212] Fri, 24 August 2007 09:38 Go to previous messageGo to next message
Manu is currently offline ManuFriend
Messages: 16
Registered: July 2009
Junior Member
Hi James!
The way that I've used for configure my environement is very simple:

_ I've downloaded eclipse 3.3 and than I've installed it.
_ With the help of the Eclipse's software update I've download and
installed emf, gmf, gef and uml2.

That's all. Are correct the steps that I've followed? If no, is there
another way to configure uml2? If yes where I can find a step by step
guide to configure it?


Thank you

Manu
Re: Problem running uml2 api program [message #475218 is a reply to message #475213] Fri, 24 August 2007 14:05 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
1. Download eclipse
2. Go to help > Software updates > Find and install...
3. Use the Europa discovery site to download UML2
4. Select "All required plugins".
5. Get the .zip as mentioned at the end of the article
"uml2.articles.2006XXXX.zip", ( the link in the article is good )
6. Unzip that into a directory called c:\uml2.articles.2006XXX.zip.
7. From your workspace do File > Import > Plug-in Development > Plugins and
Fragments.
8. for the plugin location use c\uml2.articles.2006XXX.zip.
9. Select the "Binary projects with linked content" option.
10. Select Next then select the found plugin. Click "Add->".
11. You should now see a java project called "com.ibm.uml2.articles".
12. Right click and select Debug As > Java Application.
13. ( It should complain that you have to pass an argument ).
14. go to Open Debug Dialog ...
15 Select entry under "Java Application" and in the "Arguments" tab type
file:/c:/blah
16. now select Debug.
.... voila ...

That works fine for me.

You can alternatively unzip all the source and create a project and import
the source code directly, but these are the steps that the
article recommends ( more or less ).

- James.



"Manu" <zappasan@gmail.com> wrote in message
news:053fcf75e4077ac15b7d03ce3ad58da5$1@www.eclipse.org...
> Hi James!
> The way that I've used for configure my environement is very simple:
>
> _ I've downloaded eclipse 3.3 and than I've installed it.
> _ With the help of the Eclipse's software update I've download and
> installed emf, gmf, gef and uml2.
>
> That's all. Are correct the steps that I've followed? If no, is there
> another way to configure uml2? If yes where I can find a step by step
> guide to configure it?
>
>
> Thank you
>
> Manu
>
Re: Problem running uml2 api program [message #475222 is a reply to message #475218] Fri, 24 August 2007 15:46 Go to previous messageGo to next message
Manu is currently offline ManuFriend
Messages: 16
Registered: July 2009
Junior Member
Hi!
I've followed all the steps that you've indicated but it doesn't work.

This is the output of the debug:

GettingStartedWithUML2 [Java Application]
com.ibm.uml2.articles.GettingStartedWithUML2 at localhost:3537
Thread [main] (Suspended (exception ClassNotFoundException))
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>,
AccessControlContext) line: not available [native method]
Launcher$AppClassLoader(URLClassLoader).findClass(String) line: not
available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line:
not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not
available
Launcher$AppClassLoader(ClassLoader).loadClassInternal(Strin g) line:
not available
G:\Programmi\Java\jre1.6.0_01\bin\javaw.exe (24/ago/07 17:43:52)

I can understand.

Anyway thank You.
Re: Problem running uml2 api program [message #475224 is a reply to message #475222] Fri, 24 August 2007 17:42 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Can you create a simple java project with a main() that executes?
If so, just get the source code for the articles ( from the .zip) and cut /
paste.

- James.


"Manu" <zappasan@gmail.com> wrote in message
news:684ad5e0389a409f4637d362796e0e49$1@www.eclipse.org...
> Hi!
> I've followed all the steps that you've indicated but it doesn't work.
>
> This is the output of the debug:
>
> GettingStartedWithUML2 [Java Application]
> com.ibm.uml2.articles.GettingStartedWithUML2 at localhost:3537
> Thread [main] (Suspended (exception ClassNotFoundException))
> URLClassLoader$1.run() line: not available
> AccessController.doPrivileged(PrivilegedExceptionAction<T>,
> AccessControlContext) line: not available [native method]
> Launcher$AppClassLoader(URLClassLoader).findClass(String) line: not
> available
> Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line:
> not available
> Launcher$AppClassLoader.loadClass(String, boolean) line: not available
> Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not
> available
> Launcher$AppClassLoader(ClassLoader).loadClassInternal(Strin g) line:
> not available
> G:\Programmi\Java\jre1.6.0_01\bin\javaw.exe (24/ago/07 17:43:52)
>
> I can understand.
>
> Anyway thank You.
>
Re: Problem running uml2 api program [message #475243 is a reply to message #475218] Mon, 27 August 2007 10:21 Go to previous message
Manu is currently offline ManuFriend
Messages: 16
Registered: July 2009
Junior Member
Hi!
Now it works. The problem was the build path and the libraries putted in
it. I haven't feeded all the necessary emf libraries.
Thank you anyway.

Manu
Re: Problem running uml2 api program [message #624518 is a reply to message #475210] Thu, 23 August 2007 22:04 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Manu,

The getting started article is a little out of date but should still work
fine. I just gave it a try and it everything seemed ok.
I find it strange that you are having issues like "Could not find the main
class". There probably is an issue with how you configured your
environment.
I also looked at the code that creates the CacheAdapter and it also seemes
ok.

Can you try to update your environment once more.
Any other details would be helpful.

Perhaps someone else has also experienced this?

- James.

"Manu" <zappasan@gmail.com> wrote in message
news:e6102edd3bba213dd2eaec66060d9570$1@www.eclipse.org...
> Hi to all!
> I've the following problems.
> The first is this: I've tried to run like Java Application the
> gettingStartedWithUML2 program, but I've the following messages like
> output:
>
> Could not find the main class. Program will exit.
>
> java.lang.NoClassDefFoundError:
> org/eclipse/emf/common/util/WrappedException
> Exception in thread "main"
>
> I've followed all the steps indicated in the gettingStartedWithUML2
> article. The file that i've run is the .class not the .java .
>
> The second problem is about a simple program that I've written but when I
> try to run it I get te follow error message in the console:
>
> Create Model...
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/uml2/common/util/CacheAdapter
> at
>
org.eclipse.uml2.uml.internal.impl.ElementImpl.getCacheAdapt er(ElementImpl.j
ava:714)
> at
>
org.eclipse.uml2.uml.internal.impl.ElementImpl.eNotification Required(Element
Impl.java:852)
> at
>
org.eclipse.uml2.uml.internal.impl.NamedElementImpl.setName( NamedElementImpl
..java:232)
> at model.ModelUml.createModel(ModelUml.java:28)
> at model.ModelUml.main(ModelUml.java:49)
>
> This is the code:
>
> package model;
>
> import org.eclipse.uml2.uml.Model;
> import org.eclipse.uml2.uml.UMLFactory;
>
> public class ModelUml {
> public static boolean DEBUG = true;
>
> protected static void out(String output)
> {
> if(DEBUG)
> {
> System.out.println(output);
> }
> }
>
> protected static void err(String error)
> {
> System.err.println(error);
> }
>
> protected static Model createModel(String name)
> {
> Model model = UMLFactory.eINSTANCE.createModel();
> model.setName(name);
>
> out("Model '" + model.getQualifiedName() + "' created.");
>
> return model;
>
> }
>
>
>
> public static void main(String[] args) {
>
> System.out.println("Create Model...");
> Model epoModel = createModel("Modello");
> System.out.println("Model created");
>
> }
> }
>
> I'm using the Eclipse 3.3 and the last version of UML2 plug-in.
> Anyone can help me, please?
>
> Thank you
>
> Manu
>
>
Re: Problem running uml2 api program [message #624519 is a reply to message #475212] Fri, 24 August 2007 09:38 Go to previous message
Manu is currently offline ManuFriend
Messages: 16
Registered: July 2009
Junior Member
Hi James!
The way that I've used for configure my environement is very simple:

_ I've downloaded eclipse 3.3 and than I've installed it.
_ With the help of the Eclipse's software update I've download and
installed emf, gmf, gef and uml2.

That's all. Are correct the steps that I've followed? If no, is there
another way to configure uml2? If yes where I can find a step by step
guide to configure it?


Thank you

Manu
Re: Problem running uml2 api program [message #624524 is a reply to message #475213] Fri, 24 August 2007 14:05 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
1. Download eclipse
2. Go to help > Software updates > Find and install...
3. Use the Europa discovery site to download UML2
4. Select "All required plugins".
5. Get the .zip as mentioned at the end of the article
"uml2.articles.2006XXXX.zip", ( the link in the article is good )
6. Unzip that into a directory called c:\uml2.articles.2006XXX.zip.
7. From your workspace do File > Import > Plug-in Development > Plugins and
Fragments.
8. for the plugin location use c\uml2.articles.2006XXX.zip.
9. Select the "Binary projects with linked content" option.
10. Select Next then select the found plugin. Click "Add->".
11. You should now see a java project called "com.ibm.uml2.articles".
12. Right click and select Debug As > Java Application.
13. ( It should complain that you have to pass an argument ).
14. go to Open Debug Dialog ...
15 Select entry under "Java Application" and in the "Arguments" tab type
file:/c:/blah
16. now select Debug.
.... voila ...

That works fine for me.

You can alternatively unzip all the source and create a project and import
the source code directly, but these are the steps that the
article recommends ( more or less ).

- James.



"Manu" <zappasan@gmail.com> wrote in message
news:053fcf75e4077ac15b7d03ce3ad58da5$1@www.eclipse.org...
> Hi James!
> The way that I've used for configure my environement is very simple:
>
> _ I've downloaded eclipse 3.3 and than I've installed it.
> _ With the help of the Eclipse's software update I've download and
> installed emf, gmf, gef and uml2.
>
> That's all. Are correct the steps that I've followed? If no, is there
> another way to configure uml2? If yes where I can find a step by step
> guide to configure it?
>
>
> Thank you
>
> Manu
>
Re: Problem running uml2 api program [message #624528 is a reply to message #475218] Fri, 24 August 2007 15:46 Go to previous message
Manu is currently offline ManuFriend
Messages: 16
Registered: July 2009
Junior Member
Hi!
I've followed all the steps that you've indicated but it doesn't work.

This is the output of the debug:

GettingStartedWithUML2 [Java Application]
com.ibm.uml2.articles.GettingStartedWithUML2 at localhost:3537
Thread [main] (Suspended (exception ClassNotFoundException))
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>,
AccessControlContext) line: not available [native method]
Launcher$AppClassLoader(URLClassLoader).findClass(String) line: not
available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line:
not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not
available
Launcher$AppClassLoader(ClassLoader).loadClassInternal(Strin g) line:
not available
G:\Programmi\Java\jre1.6.0_01\bin\javaw.exe (24/ago/07 17:43:52)

I can understand.

Anyway thank You.
Re: Problem running uml2 api program [message #624530 is a reply to message #475222] Fri, 24 August 2007 17:42 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Can you create a simple java project with a main() that executes?
If so, just get the source code for the articles ( from the .zip) and cut /
paste.

- James.


"Manu" <zappasan@gmail.com> wrote in message
news:684ad5e0389a409f4637d362796e0e49$1@www.eclipse.org...
> Hi!
> I've followed all the steps that you've indicated but it doesn't work.
>
> This is the output of the debug:
>
> GettingStartedWithUML2 [Java Application]
> com.ibm.uml2.articles.GettingStartedWithUML2 at localhost:3537
> Thread [main] (Suspended (exception ClassNotFoundException))
> URLClassLoader$1.run() line: not available
> AccessController.doPrivileged(PrivilegedExceptionAction<T>,
> AccessControlContext) line: not available [native method]
> Launcher$AppClassLoader(URLClassLoader).findClass(String) line: not
> available
> Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line:
> not available
> Launcher$AppClassLoader.loadClass(String, boolean) line: not available
> Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not
> available
> Launcher$AppClassLoader(ClassLoader).loadClassInternal(Strin g) line:
> not available
> G:\Programmi\Java\jre1.6.0_01\bin\javaw.exe (24/ago/07 17:43:52)
>
> I can understand.
>
> Anyway thank You.
>
Re: Problem running uml2 api program [message #624543 is a reply to message #475218] Mon, 27 August 2007 10:21 Go to previous message
Manu is currently offline ManuFriend
Messages: 16
Registered: July 2009
Junior Member
Hi!
Now it works. The problem was the build path and the libraries putted in
it. I haven't feeded all the necessary emf libraries.
Thank you anyway.

Manu
Previous Topic:inStructuredNode reference
Next Topic:Re: errors while metamodeling
Goto Forum:
  


Current Time: Fri Mar 29 09:28:34 GMT 2024

Powered by FUDForum. Page generated in 0.04554 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top