Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Command Line Plugin Headless Server(Any ideas why this exception is happening)
EMF Command Line Plugin Headless Server [message #704343] Thu, 28 July 2011 14:16 Go to next message
Mahdi Yusuf is currently offline Mahdi YusufFriend
Messages: 8
Registered: January 2011
Junior Member
Hi,

I am having an issue with the couple of the EMF plugins. I have a command line tool that depends on emf jars. Now when I call the tool from the command line on my desktop machine it runs fine no problems. I have done this on multiple machines, so I know my tool works on desktops.

Now I also need it to work on servers which are headless, when I run the same jars with the the same arguments, I get the following error.

Caused by: java.lang.UnsupportedOperationException
	at org.eclipse.emf.ecore.impl.MinimalEObjectImpl.eBasicAdapters(MinimalEObjectImpl.java:300)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotificationRequired(BasicNotifierImpl.java:261)
	at org.eclipse.emf.ecore.impl.EFactoryImpl.basicSetEPackage(EFactoryImpl.java:143)
	at org.eclipse.emf.ecore.impl.EFactoryImpl.eInverseAdd(EFactoryImpl.java:700)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseAdd(BasicEObjectImpl.java:1415)
	at org.eclipse.emf.ecore.impl.EPackageImpl.setEFactoryInstance(EPackageImpl.java:383)
	at org.eclipse.emf.ecore.impl.EPackageImpl.<init>(EPackageImpl.java:182)


That being said I would like to know if emf has any system requirements I am unaware of that available with the desktop version of Ubuntu but not the server version.

If not what are possible causes for this issue. Possible work arounds?

Your help is greatly appreciated.
Re: EMF Command Line Plugin Headless Server [message #704363 is a reply to message #704343] Thu, 28 July 2011 14:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26619
Registered: July 2009
Senior Member
Comments below.

On 28/07/2011 7:16 AM, Mahdi Yusuf wrote:
> Hi,
> I am having an issue with the couple of the EMF plugins. I have a
> command line tool that depends on emf jars. Now when I call the tool
> from the command line on my desktop machine it runs fine no problems.
> I have done this on multiple machines, so I know my tool works on
> desktops.
> Now I also need it to work on servers which are headless, when I run
> the same jars with the the same arguments, I get the following error.
> Caused by: java.lang.UnsupportedOperationException
> at
> org.eclipse.emf.ecore.impl.MinimalEObjectImpl.eBasicAdapters(MinimalEObjectImpl.java:300)
> at
> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotificationRequired(BasicNotifierImpl.java:261)
> at
> org.eclipse.emf.ecore.impl.EFactoryImpl.basicSetEPackage(EFactoryImpl.java:143)
> at
> org.eclipse.emf.ecore.impl.EFactoryImpl.eInverseAdd(EFactoryImpl.java:700)
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eInverseAdd(BasicEObjectImpl.java:1415)
> at
> org.eclipse.emf.ecore.impl.EPackageImpl.setEFactoryInstance(EPackageImpl.java:383)
> at
> org.eclipse.emf.ecore.impl.EPackageImpl.<init>(EPackageImpl.java:182)
>
>
> That being said I would like to know if emf has any system
> requirements I am unaware of that available with the desktop version
> of Ubuntu but not the server version.
> If not what are possible causes for this issue. Possible work arounds?
Some servers have their own version of EMF embedded in them and you'll
be picking up that version by default in your application.

If you look at the stack you show above, it doesn't look right. Note
that eNotificationRequired should be calling eBasicHasAdapters which
MinimalEObjectImpl overrides. But you have an older version of
BasicNotifierImpl which doesn't do that.
>
> Your help is greatly appreciated.
Re: EMF Command Line Plugin Headless Server [message #704381 is a reply to message #704363] Thu, 28 July 2011 14:53 Go to previous messageGo to next message
Mahdi Yusuf is currently offline Mahdi YusufFriend
Messages: 8
Registered: January 2011
Junior Member
Hi Ed,

I am have a plugins directory that I am calling in the following way.

java -cp 'plugins/*' 'my.commandline.tool.Main' 'arg1'


One the desktop machine it works fine, but when I am on my deployment server; it does not work. It may be an older version of EMF but it does work, will java add system jars when i specify a class path.

If so where can I look to see if my system has its own version of EMF?
Re: EMF Command Line Plugin Headless Server [message #704396 is a reply to message #704381] Thu, 28 July 2011 15:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26619
Registered: July 2009
Senior Member
Comments below.

On 28/07/2011 7:53 AM, Mahdi Yusuf wrote:
> Hi Ed,
> I am have a plugins directory that I am calling in the following way.
> java -cp 'plugins/*' 'my.commandline.tool.Main' 'arg1'
>
> One the desktop machine it works fine, but when I am on my deployment
> server; it does not work.
Yes, you explained that.
> It may be an older version of EMF but it does work,
No, the one that works is using appropriate versions.
> will java add system jars when i specify a class path.
It will include things in the JRE.
> If so where can I look to see if my system has its own version of EMF?
You explained that the problem was with the server. I'm no expert on
server environments but I do know from my experience at IBM that
WebSphere uses EMF internally and that the version of EMF used by the
server itself will end up being used by your application running in
that server unless you take explicit steps to control that. There's
some flag about "use local classpath first" that forces it to use the
applications classpath before looking at the server's classpath but I
don't recall the specific name of that flag. This is utlimately a
question to be directed to your server provider.
Re: EMF Command Line Plugin Headless Server [message #704481 is a reply to message #704396] Thu, 28 July 2011 17:24 Go to previous messageGo to next message
Mahdi Yusuf is currently offline Mahdi YusufFriend
Messages: 8
Registered: January 2011
Junior Member
My question was simply why it would behave differently on the server. I have confirmed I have only the needed jars in the classpath. I have also confirmed there are no other emf jars being included other than the ones I have specified. What are the requirements/system requirements for using EMF in a project. There is something I am clearly missing which is triggering another code path to be taken.

Thanks.
Re: EMF Command Line Plugin Headless Server [message #704512 is a reply to message #704481] Thu, 28 July 2011 17:40 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26619
Registered: July 2009
Senior Member
Comments below.

On 28/07/2011 10:24 AM, Mahdi Yusuf wrote:
> My question was simply why it would behave differently on the server.
Did I not explain that twice now? I'm wondering now when you talk about
a "server" if you really mean a web server because something isn't
sinking in. You've not said yet "No, I don't mean a web server, I mean
just another machine."
> I have confirmed I have only the needed jars in the classpath.
I'm doubtful you've confirmed what version you're using there because
your stack trace indicates an older version. If you do echo plugins/*
what exactly does that expand to on the server? Please show the results
if you have followup issues.
> I have also confirmed there are no other emf jars being included other
> than the ones I have specified. What are the requirements/system
> requirements for using EMF in a project.
The correct jars.
> There is something I am clearly missing which is triggering another
> code path to be taken.
It's very clear to me that the jar version for org.eclipse.emf.common is
not aligned with that for org.eclipse.emf.ecore. I.e., the common jar
is older than the ecore jar.
> Thanks.
Previous Topic:Is "#" symbol allowed in package NS URI?
Next Topic:Teneo and EclipseLink 2.3.0
Goto Forum:
  


Current Time: Mon Jun 01 04:56:02 GMT 2015

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

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