Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Today's Messages (on)  | Unanswered Messages (off)

Forum: Java Development Tools (JDT)
 Topic: JRE library unapears
Re: JRE library unapears [message #1754702 is a reply to message #1754500] Tue, 21 February 2017 16:32
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1449
Registered: July 2009
Senior Member
When you say "library" does this always refer to your own library or to the JRE library?
What did you try to make "the library ... appear in src file"?
How exactly did you try to run a program (which?) ?
Forum: 4DIAC - Framework for Distributed Industrial Automation and Control
 Topic: FORTE: Bugs in CLocalComLayer
Re: FORTE: Bugs in CLocalComLayer [message #1754615 is a reply to message #1754606] Tue, 21 February 2017 05:39
Lik Lik is currently offline Lik LikFriend
Messages: 13
Registered: February 2017
Location: Russia
Junior Member
Thank you for fix.

[Updated on: Tue, 21 February 2017 06:01]

Report message to a moderator

Re: FORTE: Bugs in CLocalComLayer [message #1754634 is a reply to message #1754615] Tue, 21 February 2017 08:46
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 231
Registered: January 2014
Senior Member
I just did a second check and both fixes should be in the repository.
 Topic: FORTE: Bug in CIPComLayer
Re: FORTE: Bug in CIPComLayer [message #1754616 is a reply to message #1754607] Tue, 21 February 2017 05:58
Lik Lik is currently offline Lik LikFriend
Messages: 13
Registered: February 2017
Location: Russia
Junior Member
>Shouldn't we allow to receive more messages?
If we allow to receive more messages then CFDSelectHandler::run() will generate "startNewEventChain(comLayer->getCommFB())" because "comLayer->recvData(&sockDes,0)" return "not forte::com_infra::e_Nothing". And will be a semafores leak.
        if((0 != FD_ISSET(sockDes, &anFDSet)) && (0 != comLayer)){
          m_oSync.unlock();
          if(forte::com_infra::e_Nothing != comLayer->recvData(&sockDes,0)){
            startNewEventChain(comLayer->getCommFB());
          }
          m_oSync.lock();
        }

Why do you not add log message DEVLOG_INFO("ProcessDataRecvFaild\n")?
Thank you for fix.
Re: FORTE: Bug in CIPComLayer [message #1754636 is a reply to message #1754616] Tue, 21 February 2017 08:50
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 231
Registered: January 2014
Senior Member
But this is exeactly what I wanted to point out. That "startNewEventChain(comLayer->getCommFB())" is needed so that the comm FB can send output events to inform the application that something bad has happend. Typically we even want to close the whole communication stack in the commFB and allow the application to reconnect and reinitialize. With your proposed fix only the lowest layer will close its resources but the comm FB can then be in an invalid state. The more I think about it the more I think that the close here is maybe not enough. But more is needed also in the comm FB. Can you expand why a semaphore should leak?

Sorry for forgetting the log info. In this case I think even a log error would be more apropriate. This is another reason why it would be great that you can submit improvements directly to our gerrit as described in the contributing to FORTE documentation.
Re: FORTE: Bug in CIPComLayer [message #1754648 is a reply to message #1754636] Tue, 21 February 2017 10:02
Lik Lik is currently offline Lik LikFriend
Messages: 13
Registered: February 2017
Location: Russia
Junior Member
>Can you expand why a semaphore should leak?
For example we enable "Monitoring" in 4DIAC and after that we break FORTE. 4DIAC close connection and after that it will send SYN message to FORTE many times.
Then we continue FORTE.
In "CFDSelectHandler::run()" retval = select(..) > 0.
FORTE will do "startNewEventChain(comLayer->getCommFB())" with creating semaphore many times.
Re: FORTE: Bug in CIPComLayer [message #1754704 is a reply to message #1754648] Tue, 21 February 2017 16:43
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 231
Registered: January 2014
Senior Member
Ah thanks for the clarification. I think what you called semaphores is called events in IEC 61499. But events are the only way that the application can be informed that something bad happened in the communication. The only difference is that that QO is set to false and the status should have some additional value. But I less and less think that the socket should be closed in that case. This is something the application has to decide. For example by using an E_SWITCH FB and decide on the value of QO if the normal execution flow should be take or that an error handling flow should be taken. By just closing the application would starve and not knowing why. Therefore if there are no further arguments in favour of leaving the close I would remove it again.
Forum: SWTBot
 Topic: How to enable checkbox?
Re: How to enable checkbox? [message #1754655 is a reply to message #1754325] Tue, 21 February 2017 10:39
Horst Weigelt is currently offline Horst WeigeltFriend
Messages: 3
Registered: February 2017
Location: Tübingen
Junior Member
solved!

actually I found the solution here in the forum
https://www.eclipse.org/forums/index.php/t/1067419/


Hello Patrick,
thank you for the quick reply!

We probably found out the reason why the click() fails.
The AUT is an E4 application and the containing MPart of the toolButtonWithTooltip("new person") does not have focus and the handler call fails.
This will lead to a chain of Exceptions. I did not see these exceptions last week.

So you are right the application is not in the correct state to handle the click-event.
But we have no solution yet.

Now we are looking for a connection beetween SWT, SWTBot and E4-Parts - without leading to Invalid thread access violations which occur when climbing up the widget tree ....

Do you have an ideas or heard of a similar problem?

Horst

[Updated on: Tue, 21 February 2017 11:20]

Report message to a moderator

Re: How to enable checkbox? [message #1754706 is a reply to message #1754655] Tue, 21 February 2017 17:01
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Horst,

Great that you have solved your problem.

However, without spending too much time, I would have thought that there would be a SWTBot way to give focus to the E4 MPart?

One thing I notice is that SWTBotToolbarButton in particular, does not send a SWT.FocusIn event when click() is called, unlike I mentioned in my last message. Would that have been enough? Then maybe you could call SWTBotToolBarButton.setFocus() before the click(). Or maybe calling active() or setFocus() on the Shell that contains the tool bar?

Otherwise, if I could debug this, I would try to find the point where the E4 MPart gets focus, add a breakpoint there, then manually click the tool bar button, identify in the call stack which SWT event leads to the activation of the MPart, and then see how SWTBot can also trigger that same event... Wink

Patrick
Forum: UML2
 Topic: Get classes from a model with the API
Re: Get classes from a model with the API [message #1754715 is a reply to message #1754556] Tue, 21 February 2017 18:22
German Vega is currently offline German VegaFriend
Messages: 36
Registered: December 2015
Member
Hello

Just test if the element is an instance of org.eclipse.uml2.uml.Class and cast it

for (Type element : model.getOwnedTypes()) { 
    if (element instanceof org.eclipse.uml2.uml.Class ) {
       org.eclipse.uml2.uml.Class  theClass = (org.eclipse.uml2.uml.Class ) element;
    }
}

Forum: Kura
 Topic: Eclipse compilation problem for another directory besides workspace
Re: Eclipse compilation problem for another directory besides workspace [message #1754679 is a reply to message #1754449] Tue, 21 February 2017 13:59
Said Ucar is currently offline Said UcarFriend
Messages: 54
Registered: June 2015
Member
Hi David,

Compiling means exporting an OSGi Bundle. When the bundle source code in Eclipse Workspace, project successfully exported as an OSGi Bundle and works in Raspberry Pi. However, if the project source imported Eclipse without "Copying the source code to workspace", project couldn't exported as an OSGi bundle and the error is attached in first message. Is this known behavior?

Regards,
Said.
 Topic: Using Serial Example for reading messages from Lora Radio Module connected by USB
Using Serial Example for reading messages from Lora Radio Module connected by USB [message #1754716] Tue, 21 February 2017 18:25
Katarina Mandarić is currently offline Katarina MandarićFriend
Messages: 6
Registered: December 2016
Junior Member
Hello,

could the Serial Example (http://eclipse.github.io/kura/doc/serial-example.html) be used to read messages from LoRa Radio module connected by USB?

If not, is there any library with which reading messages is easier? Maybe something already implemented with Kura?


Thank you in advance Smile
Forum: TMF (Xtext)
 Topic: Problems with AbstractFormatter2 when building with gradle
Re: Problems with AbstractFormatter2 when building with gradle [message #1754611 is a reply to message #1754603] Tue, 21 February 2017 04:29
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 28
Registered: December 2014
Junior Member
I carefully compared my project with https://github.com/itemis/itemis-blog/tree/xcore_gradle
Even simplified mine to be as close as possible to the itemis example.

Ultimately, I found that there is a difference in the *.xcore source that causes a difference in the beheavior of the gradle generateXtext task.

In the itemis example, the xcore is simple and the generated source impl folder does *NOT* have an *.ecore file.

In my case, the xcore is more complicated and when building with the Eclipse IDE, the generated source impl folder contains an *.ecore file.
The problem is that, currently, the xtext gradle builder does not have a way to specify some kind of EMF ResourceSet Pathmap so that it could properly save the generated *.ecore file -- when it has created one.

As far as why the Xcore builder generates an *.ecore file in some complex cases but not in simple ones; I haven't figured out exactly why.
I made some tests by commenting/uncommenting some sections; re-running the gradle generateXtext task to see if it produces errors or not.
It is unclear what really causes this difference in behavior.

It's worth asking on the EMF forum about the Xcore generator specifically.
If it is necessary for the XcoreGenerator to produce an *.ecore file for my metamodel; then the problem remains that there seems to be something missing w.r.t. being able to specify some kind of EMF ResourceSet pathmap in gradle.
Re: Problems with AbstractFormatter2 when building with gradle [message #1754612 is a reply to message #1754611] Tue, 21 February 2017 04:33
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
It would be nice to have a possibility to specify the path maps in gradle and maybe the xtext maven plugin
I am not sure where to address this issue

- at emf (where xcore resides)
- at xtext-gradle-plugin
Re: Problems with AbstractFormatter2 when building with gradle [message #1754614 is a reply to message #1754611] Tue, 21 February 2017 04:57
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 28
Registered: December 2014
Junior Member
Follow-up with questions on the EMF forum: https://www.eclipse.org/forums/index.php/m/1754613/#msg_1754613
 Topic: Producing multiple objects from one rule
Producing multiple objects from one rule [message #1754675] Tue, 21 February 2017 13:10
Eric Lépicier is currently offline Eric LépicierFriend
Messages: 22
Registered: October 2013
Junior Member
Hi,

I'm trying to parse things like :
int i, j;
double d,e;

and get a model containing Var objects with type and name, one for each of i, j, d, e.

I'd like to naively write a rule like this:
Model:
   vars+=VarDecl*
;
VarDecl:
   type=TypeSpec {Var} name=ID (',' {Var} name=ID)*
;
TypeSpec:
   {Int} 'int'
   | {Double} 'double'
;

But this is incorrect as one can't put two {Var} clauses in the same rule ?
Validation complains about "unassigned action not allowed when the current was already created".

I thought about rewriting my grammar in this way:
Model:
   vars+=VarDecl*
;
VarDecl:
   type=TypeSpec vars+=Var (',' vars+=Var)*
;
Var:
   name=ID
;
TypeSpec:
   {Int} 'int'
   | {Double} 'double'
;

But now, how to get a type property on Var object ?
How to remove the unwanted VarDecl grouping classifier ?

Is there a solution with XText ?

Cheers,
--Eric
Re: Producing multiple objects from one rule [message #1754676 is a reply to message #1754675] Tue, 21 February 2017 13:29
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
getting rid? hard to do.
get it working: http://xtextcasts.org/episodes/18-model-optimization
Re: Producing multiple objects from one rule [message #1754703 is a reply to message #1754676] Tue, 21 February 2017 16:35
Eric Lépicier is currently offline Eric LépicierFriend
Messages: 22
Registered: October 2013
Junior Member
Thanks Christian, exactly the topic ...
I didn't got the right keywords in my previous web searches ;-(

I'm gonna watch and read carefully the contents you mention.

Cheers,
--Eric
Re: Producing multiple objects from one rule [message #1754709 is a reply to message #1754703] Tue, 21 February 2017 17:28
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
Depending on your usecase and Xtext version you will stumble over https://bugs.eclipse.org/bugs/show_bug.cgi?id=483209

Other possible workaround in to add uncalled rules to the grammar to manipulate the metamodel

Var:name=ID;
//uncalled
VarWithType returns Var:
type=TypeSpec name=ID;
 Topic: How use Xtext grammar DSL writing in editor for translating to another language ?
How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754668] Tue, 21 February 2017 12:20
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
Hi , I want to convert a specific words in my grammar DSl in my editor to another words for new language and put the converting in another file i hope you can help me i'm beginner in Xtext.
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754680 is a reply to message #1754668] Tue, 21 February 2017 14:25
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
hi can you please be a bit more specific and provide a example scenario e.g. based on the hello world dsl
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754691 is a reply to message #1754680] Tue, 21 February 2017 15:31
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
for example i have this Xtext Model :

Model :
elements+=Expression* ;

Expression :
" req " name=ID " : " (p=pattern s=scope )

pattern :
( ( ( " always " | " never " | " eventua l l y ") ( exp=ID ) ) )
;
scope :
( ( ( " g l o b a l l y ") | ( " be f o r e " | " a f t e r ") exp2=ID ) | ( ( ' between ' exp3=ID ' and ' exp4=ID ) | ( ' a f t e r ' exp4=ID ' u n t i l ' exp5=ID ) )
)

I want to write this Grammar DSL in Xtext Editor and when save it a new file is generate have this translation :

always p(expression) globally ---> (convert to) AG(P)
never p globally ---> AG( !P)
eventually p globally ----> AF(P)
always p after q ----> AG(Q -> AG(P))

I want to convert like this in a file when i save my Grammar in Xtext Edior.

[Updated on: Tue, 21 February 2017 15:35]

Report message to a moderator

Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754694 is a reply to message #1754691] Tue, 21 February 2017 15:53
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
sounds like a generator to me. the tutorials cover how to write one
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754705 is a reply to message #1754694] Tue, 21 February 2017 16:49
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
I don't Understand , can you give me any recources(URLs) for that please i need it Thanks.

[Updated on: Tue, 21 February 2017 16:51]

Report message to a moderator

Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754708 is a reply to message #1754705] Tue, 21 February 2017 17:19
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
http://www.eclipse.org/Xtext/documentation/103_domainmodelnextsteps.html
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754711 is a reply to message #1754708] Tue, 21 February 2017 17:29
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
Thanks for your answering i hope this help me.
 Topic: Implicitly add method call to generated interface.
Implicitly add method call to generated interface. [message #1754650] Tue, 21 February 2017 10:15
Markus Wutzler is currently offline Markus WutzlerFriend
Messages: 7
Registered: October 2015
Junior Member
Hi,

I'am developing a DSL which relies on Xbase and allows some simple implementations for methods. In my JVMModelInferrer I created a player attribute of type I<RoleName>Player. Thus, I can refer to it without explicit declaration.

However, whenever I invoke a method on this player Attribute I would like to add it to the generated Interface implicitly. Unfortunately, I've no idea how to hook into Xbase inside the JvmModelInferrer in order to retrieve method names and attributes.

CollSpec:
    importSection=XImportSection?
    module = Module;


Module:
    'module' name=QualifiedName
    collaboration = Collaboration;


Collaboration:
    'collaboration' name=ValidID '{'
    (
            (roles+=CoordinatorRole) &
            (roles+=NonCoordinatorRole+)
    )
    '}'
;

CoordinatorRole:
    'coordinator' 'role' Role
;

NonCoordinatorRole:
    'role' Role
;

fragment Role:
    name=ValidID '{'
    features+=Feature*
    '}'
;

...

Feature:
    Property | Operation;

Property:
    name=ValidID ':' type=JvmTypeReference;

Operation:
    (isPlayerQualifierSet?='playable') 'op' name=ValidID
    '('(params+=FullJvmFormalParameter
    (',' params+=FullJvmFormalParameter)*)?')'
    ':' type=JvmTypeReference
    body=XBlockExpression?;


In the following example I'd like to add the doSomething Method of role B to IBPlayer interface.

collaboration Test {
    coordinator role A {
    }
    role B {
        test:String
        playable op bar() :String {
            player.doSomething(String test)
        }
    }
}
Re: Implicitly add method call to generated interface. [message #1754651 is a reply to message #1754650] Tue, 21 February 2017 10:20
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
can you please post the expected java code as well. is the interface inferred or is it a existing class? you want to be ablte to call a method that does not exist? so let it drop from the sky?

[Updated on: Tue, 21 February 2017 10:25]

Report message to a moderator

Re: Implicitly add method call to generated interface. [message #1754656 is a reply to message #1754651] Tue, 21 February 2017 11:21
Markus Wutzler is currently offline Markus WutzlerFriend
Messages: 7
Registered: October 2015
Junior Member
Thanks for your reply!
Christian Dietrich wrote on Tue, 21 February 2017 10:20
can you please post the expected java code as well.

For each Role a class and an interface is generated.
The class gets the following method:
public String bar() {
    player.performBRoleDoSomething() // something like getPlayer().doSomething() would be preferred actually.
    return null;
}

and the interface gets the performBRoleDoSomething() method.

Christian Dietrich wrote on Tue, 21 February 2017 10:20
is the interface inferred or is it a existing class?

both, here an excerpt of my Inferer:
def dispatch void infer(NonCoordinatorRole role, IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase, CollSpec collSpec){
        acceptor.accept(role.toClass('''«collSpec.module.fullyQualifiedName».«role.name»Role''')) [
            documentation = role.documentation
            if(!isPreIndexingPhase) {
                superTypes += AbstractRole.typeRef
                var playerRef = typesFactory.createJvmField()
                playerRef.type = typeRef('''«collSpec.module.fullyQualifiedName».I«role.name»RolePlayer''')
                playerRef.simpleName = 'player'
                playerRef.visibility = JvmVisibility.PRIVATE
                playerRef.type
                members += playerRef
            }
            for(feature : role.features) {
                switch feature {

                    Property : {
                        members += feature.toField(feature.name, feature.type)
                        members += feature.toGetter(feature.name, feature.type)
                        members += feature.toSetter(feature.name, feature.type)
                    }

                    Operation : {
                        members += feature.toMethod(feature.name, feature.type) [
                            documentation = feature.documentation
                            for(p : feature.params) {
                                parameters += p.toParameter(p.name, p.parameterType)
                            }
                            body = feature.body
                        ]
                    }
                }
            }
        ]
    }

    def void inferPlayerInterface(Role role, IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase, CollSpec collSpec) {
        acceptor.accept(role.toClass('''«collSpec.module.fullyQualifiedName».I«role.name»RolePlayer''')) [
            setInterface = true
            for (feature : role.features) {
                if (feature instanceof Operation) {
                    if (feature.isPlayerQualifierSet) {
                        members += feature.toMethod('''perform«role.name»Role«feature.name.toFirstUpper»''', feature.type) [
                            documentation = feature.documentation
                            for(p : feature.params) {
                                parameters += p.toParameter(p.name, p.parameterType)
                            }

//                            body = feature.body
                        ]
                    }
                }
            }
        ]
    }


Christian Dietrich wrote on Tue, 21 February 2017 10:20
you want to be ablte to call a method that does not exist? so let it drop from the sky?

Actually yes, it shall be dispatched at run time. So it does not drop from the sky but the complementing implementation is provided somewhere else. In the end there should be no fixed player attribute but for the moment this would be ok.

[Updated on: Tue, 21 February 2017 11:24]

Report message to a moderator

Re: Implicitly add method call to generated interface. [message #1754661 is a reply to message #1754656] Tue, 21 February 2017 11:37
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
yes but where is defined that there is a doSomething and its not doSomethingElse?
Re: Implicitly add method call to generated interface. [message #1754663 is a reply to message #1754661] Tue, 21 February 2017 11:44
Markus Wutzler is currently offline Markus WutzlerFriend
Messages: 7
Registered: October 2015
Junior Member
This is what I mean with implicit definition. This is also the reason for generating the interface. The DSL is the first step of a 2-step development strategy. In the second phase the interface needs to be implemented by a class.
By writing player.doSomething() i want to require that a corresponding player really provides this method.
Return types for such methods are not of interest so far. Thus I currently don't care about them.
Re: Implicitly add method call to generated interface. [message #1754666 is a reply to message #1754663] Tue, 21 February 2017 12:09
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
well the only thing i see is that you can traverse the node model to find out which method names are wanted and then add them in the inferrer
Re: Implicitly add method call to generated interface. [message #1754667 is a reply to message #1754666] Tue, 21 February 2017 12:13
Markus Wutzler is currently offline Markus WutzlerFriend
Messages: 7
Registered: October 2015
Junior Member
Okay, this is basically what I expected, but where can i hook into that?
Traversing the feature.body seems a little bit tricky because almost everything is an XExpression and I assume that not everything allows such a method call. Which model elements of XExpression are the ones to take care of?

Thanks in advance.
Re: Implicitly add method call to generated interface. [message #1754670 is a reply to message #1754667] Tue, 21 February 2017 12:36
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
this is the only thing you can do.

you shoud have a look at XMemberFeatureCalls
Re: Implicitly add method call to generated interface. [message #1754686 is a reply to message #1754670] Tue, 21 February 2017 14:42
Markus Wutzler is currently offline Markus WutzlerFriend
Messages: 7
Registered: October 2015
Junior Member
While having a look at XMemberFeatureCall in Xbase Definition I thought about a special rule, which could simplify parsing. Something like
PlayerFeatureCall returns xBase::XExpression:
    {PlayerFeatureCall}
    'player'
    ((".")
    feature=[types::JvmIdentifiableElement|IdOrSuper] (
            =>explicitOperationCall?='('
            (
                    memberCallArguments+=XExpression (',' memberCallArguments+=XExpression)*
            )?
            ')')?
    );

Unfortunately, this code snippet seems to be wrong - when typing player.doSomething( ) it is not recognized as a special rule.
Re: Implicitly add method call to generated interface. [message #1754692 is a reply to message #1754686] Tue, 21 February 2017 15:32
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
id simply use nodemodel and have a look at the text for the stuff at the beginning of the rule and see if it is player
Re: Implicitly add method call to generated interface. [message #1754717 is a reply to message #1754692] Tue, 21 February 2017 18:39
Markus Wutzler is currently offline Markus WutzlerFriend
Messages: 7
Registered: October 2015
Junior Member
Christian Dietrich wrote on Tue, 21 February 2017 15:32
id simply use nodemodel and have a look at the text for the stuff at the beginning of the rule and see if it is player

So still traversing XExpressions? Or did I get something wrong? What do you mean with "beginning of the rule and see if it is player".
Re: Implicitly add method call to generated interface. [message #1754718 is a reply to message #1754717] Tue, 21 February 2017 18:57
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
yes traversing the expressions and find the one that look like player.xxxx
 Topic: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ?
how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754722] Tue, 21 February 2017 19:21
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
I hope you can help me i'm new user in xtext, i have xtext project , i want to call my java class ( with method main) to run it in Xtend file when generating the Xtext editor . also another case is when generating the editor Xtext in runtime eclipce , i need to run my java class when save my Xtext model is there any solution for that .
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754723 is a reply to message #1754722] Tue, 21 February 2017 19:24
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
Hi,

can you please be a bit more specific on what your main does and which which parmeters/contexts it should be invoked?
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754724 is a reply to message #1754723] Tue, 21 February 2017 19:32
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
I want to run java class after finishing writing my grammar in xtext ediitor ie: use Xtend Generator file to call my java class .
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754726 is a reply to message #1754724] Tue, 21 February 2017 19:35
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
i still dont get this.

you have opened your test.mydsl file and edit it.
then you hit save.
and then the main should be called with no params?
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754728 is a reply to message #1754726] Tue, 21 February 2017 19:47
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
The class main has diffrent parameters independent for Xtext grammar
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754730 is a reply to message #1754728] Tue, 21 February 2017 20:04
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10193
Registered: July 2009
Senior Member
If it is on save only have a look at IXtextEditorCallback

(Implement it in yourdsl.ui and add a binding to yourdsluimodule)


def void configureMySpecialCallback(com.google.inject.Binder
binder) {
binder.bind(IXtextEditorCallback).annotatedWith(Names. named( "MySpecialCallback")).to(
MySpecialCallback);
}

If it should be called during build as well call it from your generator is the easiest one

Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754732 is a reply to message #1754730] Tue, 21 February 2017 20:30
abdf mncr is currently offline abdf mncrFriend
Messages: 8
Registered: February 2017
Junior Member
Thanks i will try it now .
Forum: Virgo
 Topic: websocket and web application support in latest virgo milestone
Re: websocket and web application support in latest virgo milestone [message #1754623 is a reply to message #1754513] Tue, 21 February 2017 07:01
Chandre Gowda is currently offline Chandre GowdaFriend
Messages: 54
Registered: April 2013
Member
Thanks for the information. We were using Virgo Nano Full because of its light weight and quick startup time. Could you please tell me why Virgo Nano Full has been discontinued.
 Topic: Eclipse Virgo 3.7.0 on the home stretch...RC01 arrived.
Re: Eclipse Virgo 3.7.0 on the home stretch...RC01 arrived. [message #1754733 is a reply to message #1753955] Tue, 21 February 2017 20:32
Jay Hamilton is currently offline Jay HamiltonFriend
Messages: 24
Registered: October 2011
Junior Member
Razz
Forum: Sirius
 Topic: Edge Creation Tool Problem
Edge Creation Tool Problem [message #1754659] Tue, 21 February 2017 11:26
Francesco Gallo is currently offline Francesco GalloFriend
Messages: 7
Registered: December 2015
Junior Member
Hello,

I am developing a editor for my metamodel....Please File gidlMModel.png...

I have created an Element Based Edge for the hasDataTypeGallo, they work when I define them within the example model. But the palette to create a hasDataTypeGallo does not work.

I included my .odesign file plus properties of my edge creation tool.

Thanks in advance

[Updated on: Tue, 21 February 2017 11:29]

Report message to a moderator

Re: Edge Creation Tool Problem [message #1754677 is a reply to message #1754659] Tue, 21 February 2017 13:44
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 345
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Francesco,

From its name, I understand that "hasDataTypeGallo" might return a boolean, but Sirius expects that your return the target semantic element of the edge.

Then you use a CreateEdgeView model operation, but if your modeler will be used in auto-refresh and if the edge mapping is synchronized, you just need to modify your semantic model with the modification your tool has to do and then Sirius will automatically update the diagram from your semantic changes (from your mappings definitions).

Regards

Re: Edge Creation Tool Problem [message #1754678 is a reply to message #1754677] Tue, 21 February 2017 13:58
Francesco Gallo is currently offline Francesco GalloFriend
Messages: 7
Registered: December 2015
Junior Member
Hi Maxime,
thank you for your answer...but it is not clear for me....sorry... Sad

hasTypeDataGallo is a reference...I thing...Please see Figure 1...

I would like the result as in Figure 2...

BR
  • Attachment: Figure1.png
    (Size: 113.09KB, Downloaded 3 times)
  • Attachment: Figure2.png
    (Size: 112.75KB, Downloaded 3 times)

[Updated on: Tue, 21 February 2017 13:59]

Report message to a moderator

 Topic: Sirius vs Graphiti
Re: Sirius vs Graphiti [message #1754693 is a reply to message #1754565] Tue, 21 February 2017 15:44
Alex Kravets is currently offline Alex KravetsFriend
Messages: 476
Registered: November 2009
Senior Member
Thank you
 Topic: Sirius Epsilon integration
Sirius Epsilon integration [message #1754690] Tue, 21 February 2017 15:26
Michaël Melchiore is currently offline Michaël MelchioreFriend
Messages: 45
Registered: April 2012
Member
Hello folks,

This a cross-post from the Eclipse Epsilon forum.

I am writing a simple code generation tool based on the EMF ecosystem.

I have chosen Sirius to develop the diagram editor but would like to use Epsilon for M2M and model validation activities.

I have written sample validation rules and successfully tested them in EMF tree-based editor (validation, quickfixes, ...). In the Sirius-based editor, the rules are correctly invoked but the following features don't work :

  • the offending items are not flagged in the diagram view
  • the quick fix suggestions are not taken into account


I have declared an org.eclipse.ui.ide.markerResolution extension with the org.eclipse.sirius.diagram.ui.diagnostic markerType but I think I am missing something.

I have attached a small example to demonstrate the issue. I am using :


  • Eclipse Mars.2 Release (4.5.2)
  • Sirius 3.1.3
  • Epsilon 1.4.0.2


I used nested Eclipse to set up my tests : first workspace is the content of the eclipse folder, and the runtime folder holds the content of the nested workspace. To reproduce the problem, compare model validation from the tree-based editor and Sirius editor.

In the tree-based editor, everything works fine (validation, Problem display, quick fixes). In the Sirius diagram, the model validation is successfully triggered , but errors are not flagged in the diagram. Quick fix suggestions are also ignored.

Thanks for your help,

Michaël
Re: Sirius Epsilon integration [message #1754695 is a reply to message #1754690] Tue, 21 February 2017 16:01
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 345
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Michaël,

Did you launch the validation from the diagram using the "Validate diagram" contextual menu ?
I think not, so the markers are linked to your model resource, and currently Sirius looks for validation markers targeting the aird files (the validate diagram action will looks for markers concerning the aird files and then the uri of the flagged semantic elements.

Retrieving and displaying the validation markers targeting the semantic model might be an interesting feature. I think you might report a enhancement request in the bugzilla.

Regards,

Maxime
Re: Sirius Epsilon integration [message #1754700 is a reply to message #1754695] Tue, 21 February 2017 16:17
Michaël Melchiore is currently offline Michaël MelchioreFriend
Messages: 45
Registered: April 2012
Member
Hi Maxime,

Yes, I launched the validation from the diagram using the "Validate diagram" contextual menu.

Regards,

Michaël
 Topic: Modifying semantic element starting from an IMarker
Modifying semantic element starting from an IMarker [message #1754734] Tue, 21 February 2017 20:33
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1336
Registered: July 2009
Location: York, UK
Senior Member

Hi,

I am trying to bridge Epsilon's EVL with Sirius so that the former can be used to define constraints and quick fixes for diagrams constructed with the latter (similarly to [1]). I'm almost there but I'm having trouble implementing quick fixes, hence this post.

Assuming that I've got hold of a Sirius (org.eclipse.sirius.diagram.ui.diagnostic) problem marker (org.eclipse.core.resources.IMarker) with the following attributes, how can I run code that modifies features of its underlying semantic element (e.g. if the semantic element is a Person, change its name from X to Y)?

elementId -> _shUpEPd-EeadXOjn8SEqIQ
severity -> 2
DIAGRAM_URI -> platform:/resource/basicfamily.sample/representations.aird#_sg7ngfd-EeadXOjn8SEqIQ
org.eclipse.ui.editorID -> org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorID
location -> lola::<Man>
SEMANTIC_URI -> platform:/resource/basicfamily.sample/example.basicfamily#//@members.10
message -> Invariant Grumpy failed for Man [name=, ]


Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/evl-gmf-integration/
Forum: Epsilon
 Topic: EVL Sirius integration
Re: EVL Sirius integration [message #1754638 is a reply to message #1754435] Tue, 21 February 2017 08:56
Michaël Melchiore is currently offline Michaël MelchioreFriend
Messages: 45
Registered: April 2012
Member
Hello Dimitris,

Please find attached in this post a minimal example. The eclipse folder contains the tool plugins and the runtime folder a sample model.

I am using :

  • Eclipse Mars.2 Release (4.5.2)
  • Sirius 3.1.3
  • Epsilon 1.4.0.2


I used nested Eclipse to set up my tests : first workspace is the content of the eclipse folder, and the runtime folder holds the content of the nested workspace. To reproduce the problem, compare model validation from the tree-based editor and Sirius editor.

In the tree-based editor, everything works fine (validation, Problem display, quick fixes).
In the Sirius diagram, the model validation is successfully triggered , but errors are not flagged in the diagram. Quick fix suggestions are also ignored.

Thanks for your help,

Michaël


[Updated on: Tue, 21 February 2017 08:57]

Report message to a moderator

Re: EVL Sirius integration [message #1754687 is a reply to message #1754638] Tue, 21 February 2017 14:45
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1336
Registered: July 2009
Location: York, UK
Senior Member

Hi Michaël,

Could it be the case that Sirius doesn't support error flags at the diagram level? Flags at the model element level appear to be working fine. To reproduce this, you can add the following constraint to your EVL file:

context Person {
    constraint Grumpy {
         check : false
    }
}


Quick fixes are not currently supported but we're working on this.

Cheers,
Dimitris

[Updated on: Tue, 21 February 2017 14:46]

Report message to a moderator

Re: EVL Sirius integration [message #1754689 is a reply to message #1754687] Tue, 21 February 2017 15:15
Michaël Melchiore is currently offline Michaël MelchioreFriend
Messages: 45
Registered: April 2012
Member
I have been browsing their tutorials and it seems they do support error flags.

See this paragraph for example. Maybe Sirius uses an other validation framework ? I will try posting in their forum...

That is good to hear ! When do you expect to finish ?

Michaël
Re: EVL Sirius integration [message #1754701 is a reply to message #1754689] Tue, 21 February 2017 16:26
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1336
Registered: July 2009
Location: York, UK
Senior Member

Hi Michaël,

> I have been browsing their tutorials and it seems they do support error flags.

What I was trying to say is that error flags can be attached to nodes (e.g. Persons) but not to the entire diagram (e.g. Family). Adding the constraint I recommended to your EVL file should produce lots of error flags in your diagram.

> That is good to hear ! When do you expect to finish ?

Not sure. I'll try to post an update by the end of the week though.

Cheers,
Dimitris
 Topic: Can not instantiate EmfModel
Re: Can not instantiate EmfModel [message #1754681 is a reply to message #1754519] Tue, 21 February 2017 14:26
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1336
Registered: July 2009
Location: York, UK
Senior Member

Hi,

You need to add EMF to your classpath. The easiest way to add both Epsilon and EMF is through the kitchensink jar [1, 2].

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/download/ (JARs tab)
[2] http://www.eclipse.org/downloads/download.php?file=/epsilon/jars/epsilon-1.4-kitchensink.jar
Re: Can not instantiate EmfModel [message #1754712 is a reply to message #1754519] Tue, 21 February 2017 17:34
Vale Roemer is currently offline Vale RoemerFriend
Messages: 2
Registered: February 2017
Junior Member
Okay, now I can instantiate my EmfModel Smile

But no output is generated. Here is my Code:

EglFileGeneratingTemplateFactory eglTemplateFactory = new EglFileGeneratingTemplateFactory();
		    IEolExecutableModule module = new EglTemplateFactoryModuleAdapter(eglTemplateFactory);
		    eglTemplateFactory.setOutputRoot("model/calender.html");
		    	module.parse(new File("model/Calender2HTML.egl").getAbsoluteFile());
		    	
		    	EmfModel model = new EmfModel();
		    	StringProperties properties = new StringProperties();
		    properties.put(EmfModel.PROPERTY_NAME, "Mein Kalender");
		    properties.put(EmfModel.PROPERTY_FILE_BASED_METAMODEL_URI, "model/Calender.ecore");//"file:/" + new File(metamodel).getAbsolutePath());
		    	properties.put(EmfModel.PROPERTY_MODEL_URI, "file:/" + new File("model/My.Calender").getAbsolutePath());
		    properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");
		    properties.put(EmfModel.PROPERTY_READONLOAD, true + "");
		    	properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, true + "");
		    model.load(properties, (IRelativePathResolver) null);
		    eglTemplateFactory.getContext().getModelRepository().addModel(model) ;
		    	
		    	module.execute();
		    	module.getContext().getModelRepository().dispose();




Regards,
Roemer
Re: Can not instantiate EmfModel [message #1754737 is a reply to message #1754712] Tue, 21 February 2017 20:43
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1336
Registered: July 2009
Location: York, UK
Senior Member

Hi,

module.execute() will return the generated content as a String. You can put this content in the target file using e.g. a FileOutputStream. You may also want to have a look at EGX [1] which provides built-in support for saving content generated using EGL templates (in which case you'll need to instantiate/parse/execute an EgxModule).

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/code-generation-tutorial-egl/
 Topic: EMF metmodel
EMF metmodel [message #1754727] Tue, 21 February 2017 19:37
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 116
Registered: October 2014
Senior Member
Hi,
This my first time using EMF language can you please help me .
@namespace(uri="mapping", prefix="mapping")
package mapping;

class mapping {
val sourceType[+]#hasSource contents;

}
class sourceType{
attr String Sname;
ref targetType[+] hasTargets;
ref mapping[1]#contents hasSource;


}
class targetType{
attr String Tname;

i have started creating the metamodel step by step not all at once but i am facing problem between the class sourceType and class targetType when i tried to create an instance from that metamodel ,what i mean by the relation between them that source has many targets .
Can you please help me.

Taghreed.
Re: EMF metmodel [message #1754736 is a reply to message #1754727] Tue, 21 February 2017 20:38
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1336
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

I'm not sure I fully understand the problem you're reporting. Could you please elaborate a bit more?

Cheers,
Dimitris

Re: EMF metmodel [message #1754738 is a reply to message #1754736] Tue, 21 February 2017 21:08
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 116
Registered: October 2014
Senior Member
Hi Dimitris,
i created the metamodel then i tried to create an instance from that metamodel i have chosen mapping as a root element then added sourceType as child ,i think i have something wrong with the relations .I attached screenshot for what i have.

Thanks
Taghreed,
  • Attachment: mapping.png
    (Size: 118.69KB, Downloaded 4 times)

[Updated on: Tue, 21 February 2017 21:08]

Report message to a moderator

Forum: Remote Application Platform (RAP)
 Topic: How to align text in a TreeViewer cell
How to align text in a TreeViewer cell [message #1754710] Tue, 21 February 2017 17:28
Frank Gruendel is currently offline Frank GruendelFriend
Messages: 9
Registered: January 2014
Junior Member
Hi experts,

by now I have spent the better part of two hours in the world wide WEB in vain. All I want to do is to change the vertical alignment of the text in a Treeviewer. As you can see in the image, the text is top-aligned whereas it should be center-aligned.

I am using Eclipse Mars.1 Release (4.5.1) with RAP 3.0.2 as the target platform.

As can be seen in the image, I have tinkered with the CSS properties of TreeItem, but this doesn't seem the proper strategy since the alignment seems to not be part of what can be controlled via CSS.

My TreeViewer is created like this:



private Control getTabControl_Tab1(final CTabFolder tabFolder)
{
final Composite composite = new Composite(tabFolder, SWT.NONE);
composite.setLayout(new FillLayout());

m_treeViewer_Plain = new TreeViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
m_treeViewer_Plain.getTree().setBackground(PMCColors.DEFAULT_BACKGROUND);
m_treeViewer_Plain.setContentProvider(new MyViewContentProvider(false));
m_treeViewer_Plain.setLabelProvider(new MyViewLabelProvider());
m_treeViewer_Plain.setUseHashlookup(true);
m_treeViewer_Plain.setSorter(new ViewerSorter());
m_treeViewer_Plain.setInput(getController());
composite.pack();
return composite;
}

The LabelProvider, in case this is of any importance, extends LabelProvider.

I appear to be unable to find the place where this text is actually painted. If anybody could shed some light on this problem, I will be thankful forever
Smile


Re: How to align text in a TreeViewer cell [message #1754740 is a reply to message #1754710] Tue, 21 February 2017 21:21
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 155
Registered: February 2011
Senior Member
If I had to take a wild guess, it would be the padding property of the Tree-Cell theme
The default theme has it set to 6px. You should be able to set each left, right, top and bottom padding value.

My theme has the following:
Tree-Cell {
spacing: 2px;
padding: 1px 0px 1px 0px;
}

The default theme is:
Tree-Cell {
spacing: 0;
padding: 6px;
}
Forum: EMF
 Topic: CDO: Standalone Setup for programming with the API
Re: CDO: Standalone Setup for programming with the API [message #1754631 is a reply to message #1754527] Tue, 21 February 2017 08:16
Eike Stepper is currently offline Eike StepperFriend
Messages: 6299
Registered: July 2009
Senior Member
I tried it now, but am running into various problems. First I had to figure out how to use Java 8 compliance:

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>


Then these come up:

Running org.example.cdotest.GrabatsCdoTest
Loaded GRABATS set0.xmi into a String in 50ms.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.429 sec <<< FAILURE!
runTest(org.example.cdotest.GrabatsCdoTest)  Time elapsed: 1.388 sec  <<< ERROR!
java.io.IOException: Unable to delete file: C:\Users\Stepper\AppData\Local\Temp\1487662920962-0\repo.mv.db
	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2381)
	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1679)
	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1575)
	at org.example.cdotest.GrabatsCdoTest.runTest(GrabatsCdoTest.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)


Looking at your models it strikes me that the PrimitiveTypes packages are at least not very optimal. I think you should use EString, EBoolean(Object), and EInteger(Object) instead.

Given that I can't run your Maven-based test project and that, even if I could run it, I'm not sure what exactly is in these Maven artifacts for CDO, could you try to install a regular CDO workspace? It's rather easy if you follow https://wiki.eclipse.org/CDO_Source_Installation . In that workspace you should create a Plug-in Project for your code, so that it' trivial to add the required dependencies from the target platform and execute it.
Re: CDO: Standalone Setup for programming with the API [message #1754633 is a reply to message #1754631] Tue, 21 February 2017 08:38
Alan DW is currently offline Alan DWFriend
Messages: 118
Registered: March 2012
Senior Member
Hello,

first of all, thanks for your efforts!

Eike Stepper wrote on Tue, 21 February 2017 03:16
I tried it now, but am running into various problems. First I had to figure out how to use Java 8 compliance:

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>




I'm sorry about that, I missed that. My bad.

Eike Stepper wrote on Tue, 21 February 2017 03:16

Then these come up:

Running org.example.cdotest.GrabatsCdoTest
Loaded GRABATS set0.xmi into a String in 50ms.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.429 sec <<< FAILURE!
runTest(org.example.cdotest.GrabatsCdoTest)  Time elapsed: 1.388 sec  <<< ERROR!
java.io.IOException: Unable to delete file: C:\Users\Stepper\AppData\Local\Temp\1487662920962-0\repo.mv.db
	at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2381)
	at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1679)
	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1575)
	at org.example.cdotest.GrabatsCdoTest.runTest(GrabatsCdoTest.java:61)



It looks like Maven tried to execute the JUnit tests upon installation. We already know that the GrabatsCdoTest won't execute successfully, but this exception is indeed new to me. Basically the test just tries to clean up the H2 database files in the temp directory here.


Eike Stepper wrote on Tue, 21 February 2017 03:16
Looking at your models it strikes me that the PrimitiveTypes packages are at least not very optimal. I think you should use EString, EBoolean(Object), and EInteger(Object) instead.


I fully agree with you, these models are not optimal (which is a very polite way to put it). However, I did not create them - they are the standard GRABATS Benchmark Models (please see this page for details). So they are unfortunately outside of my control.


Eike Stepper wrote on Tue, 21 February 2017 03:16
Given that I can't run your Maven-based test project and that, even if I could run it, I'm not sure what exactly is in these Maven artifacts for CDO, could you try to install a regular CDO workspace? It's rather easy if you follow https://wiki.eclipse.org/CDO_Source_Installation . In that workspace you should create a Plug-in Project for your code, so that it' trivial to add the required dependencies from the target platform and execute it.


Alright, I wanted to avoid fiddling with Eclipse Plug-Ins (lots and lots of bad experience in the past), but if it will help me to get it working, then I'll try that next.

I'll report back after experimenting with the source installation. Until then, thanks a lot for all your help!
Re: CDO: Standalone Setup for programming with the API [message #1754658 is a reply to message #1754633] Tue, 21 February 2017 11:24
Eike Stepper is currently offline Eike StepperFriend
Messages: 6299
Registered: July 2009
Senior Member
With the Oomph setup it should not be a big hazzle. Good luck! Wink
 Topic: [Xcore][gradle] Two mysterious problems.
[Xcore][gradle] Two mysterious problems. [message #1754613] Tue, 21 February 2017 04:55
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 28
Registered: December 2014
Junior Member
I am using gradle to build a DSL from an Xcore metamodel here:
https://github.com/jpl-imce/oml.core

This project is organized in a similar way than the itemis example here:
https://github.com/itemis/itemis-blog/tree/xcore_gradle

There are two differences though:

1) The behavior of the XcoreGenerator is different

In the itemis example, the XcoreGenerator does not produce any *.ecore metamodel per se. You can see this in the generated code for the metamodel package initialization:

/org.xtext.example.mydsl.model/build/xcore/main/org/xtext/example/mydsl/impl/MydslPackageImpl.java

public class MydslPackageImpl extends EPackageImpl implements MydslPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass modelEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass greetingEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see org.xtext.example.mydsl.MydslPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private MydslPackageImpl() {
		super(eNS_URI, MydslFactory.eINSTANCE);
	}
...
public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes, features, and operations; add parameters
		initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getModel_Greetings(), this.getGreeting(), null, "greetings", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(greetingEClass, Greeting.class, "Greeting", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getGreeting_Name(), theEcorePackage.getEString(), "name", null, 0, 1, Greeting.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}
...


In my case, the XcoreGenerator produces an *.ecore file;
however, it fails to save it because it is running outside of Eclipse
(i.e., there is no EMF ResourceSet pathmap nor any workspaceRoot
to map the generated resource to an external file location).

It's clear from the generated package impl code that there *should*
be an *.ecore file saved though:

public class OmlPackageImpl extends EPackageImpl implements OmlPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected String packageFilename = "oml.ecore";

...
public static OmlPackage init() {
		if (isInited) return (OmlPackage)EPackage.Registry.INSTANCE.getEPackage(OmlPackage.eNS_URI);

		// Obtain or create and register package
		OmlPackageImpl theOmlPackage = (OmlPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof OmlPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new OmlPackageImpl());

		isInited = true;

		// Initialize simple dependencies
		EcorePackage.eINSTANCE.eClass();

		// Load packages
		theOmlPackage.loadPackage();

		// Fix loaded packages
		theOmlPackage.fixPackageContents();

		// Mark meta-data to indicate it can't be changed
		theOmlPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(OmlPackage.eNS_URI, theOmlPackage);
		return theOmlPackage;
	}
...


Questions:

1) What determines whether the XcoreGenerator produces code that requires an *.ecore metamodel for initializing the metamodel package or not?

I'm not sure if this difference is attributable to the XcoreGenerator per se or to behavior it inherits from the EMF code generator.

I tried to comment out some parts of my DSL hoping to get a smaller reproducible example; well, it's not obvious.

2) Assuming that I won't be so lucky to define a DSL without needing an *.ecore file,
how could I configure the gradle script such that the EMF ResourceSet used by the XcoreGenerator would have a pathmap like:

"oml.model" = file("${rootDir}/oml.model")

Is there some configuration that could be set in the xtext section?


xtext {
	version = "${xtextVersion}"
	languages {
		ecore {
			setup = 'org.eclipse.xtext.ecore.EcoreSupport'
		}
		codegen {
			setup = 'org.eclipse.emf.codegen.ecore.xtext.GenModelSupport'
		}
		xcore {
			setup = 'org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup'
			generator {
                javaSourceLevel = '1.8'
                outlet {
                    producesJava = true
                }
            }
		}
	}
}


If not, I wonder if it would be possible to define locally in the project a custom
XcoreStandaloneSetup to configure the ResourceSet's pathmap.

I'm not an expert in gradle so I would appreciate very much some guidance on this.
Re: [Xcore][gradle] Two mysterious problems. [message #1754620 is a reply to message #1754613] Tue, 21 February 2017 06:47
Ed Merks is currently offline Ed MerksFriend
Messages: 28195
Registered: July 2009
Senior Member
If the package class is "too large" the generated package initialization code will exceed Java's 64k byte code limit. So the GenModel initialization code tries to estimate what too large might be in terms of the size of the Ecore model and initializes the GenPackage's loadInitialization feature accordingly. But you can add @GenModel(loadInitialization="false") before the package declaration in your *.xcore and see if in fact the generated code is too large or not. If that's okay, I suppose that solves your problem. If it is too large, you could modify the itemis example to add @GenModel(loadInitialization="true") to see if that example works or not. If not, you could ask for their help (perhaps better on the Xtext forum) for how to make that work for their example.

That being said, I suspect that the general issue is perhaps the way that org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageSerialization(GenPackage, Monitor) is implemented. It creates its own resource set in which to create the Ecore resource and then it calls save on the resource. So it does not call org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.createOutputStream(URI) and hence bypasses org.eclipse.emf.ecore.xcore.generator.XcoreGenModelGeneratorAdapterFactory.createOutputStream(URI) and maybe that's important for this case.

But note that if my help is required, I need a way to reproduce the problem that does not involve manually setting up a complex test case (i.e., that does not involve spending more time to reproduce the problem than to solve it).
Re: [Xcore][gradle] Two mysterious problems. [message #1754688 is a reply to message #1754620] Tue, 21 February 2017 14:49
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 28
Registered: December 2014
Junior Member
Thanks Ed for your explanation!

Your suspicion seems right to me: I was wondering why the XcoreGenerator can save the generated *.java but not *.ecore.

I followed your suggestion to add @GenModel(loadInitialization="true") to the itemis example and indeed it fails with the same error/stack trace.

git clone git@github.com:itemis/itemis-blog.git
cd itemis-blog
git checkout xcore_gradle
cd org.xtext.example.mydsl.parent/
./gradlew :org.xtext.example.mydsl.model:generateXtext


This works.

Edit the mydsl.xcore like this:

@Ecore(nsPrefix="mydsl",nsURI="http://www.xtext.org/example/mydsl/MyDsl")
@GenModel(
    bundleManifest="false",
    modelDirectory="org.xtext.example.mydsl.model/build/xcore/main", 
    complianceLevel="8.0"
)
@GenModel(loadInitialization="true") 
 
package org.xtext.example.mydsl

class Model {
	contains Greeting[] greetings
}

class Greeting {
	String name
}


Now, I get the same error/stacktrace than my larger example:

./gradlew :org.xtext.example.mydsl.model:generateXtext
:org.xtext.example.mydsl.model:generateXtext
java.io.IOException: The path '/org.xtext.example.mydsl.model/build/xcore/main/org/xtext/example/mydsl/impl/mydsl.ecore' is unmapped
        at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createOutputStream(PlatformResourceURIHandlerImpl.java:501)
        at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:349)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1234)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:985)
        at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageSerialization(GenPackageGeneratorAdapter.java:544)
        at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generateModel(GenPackageGeneratorAdapter.java:213)
        at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:215)
        at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:317)
        at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:708)
        at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:619)
        at org.eclipse.emf.ecore.xcore.generator.XcoreGenerator.generateGenModel(XcoreGenerator.java:280)
        at org.eclipse.emf.ecore.xcore.generator.XcoreGenerator.doGenerate(XcoreGenerator.java:228)
        at org.eclipse.xtext.generator.GeneratorDelegate.doGenerate(GeneratorDelegate.java:45)
        at org.eclipse.xtext.generator.GeneratorDelegate.generate(GeneratorDelegate.java:34)
        at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder.generate(IncrementalBuilder.java:350)
        at org.eclipse.xtext.build.IncrementalBuilder$InternalStatefulIncrementalBuilder$5.apply(IncrementalBuilder.java:259)
...


Regarding org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageSerialization(GenPackage, Monitor), I wonder if it would be sufficient in this case
to copy the adapters from the original resource set; something like this:

 final ResourceSet originalSet = genModel.eResource().getResourceSet();
        EPackage originalPackage = genPackage.getEcorePackage();

        ResourceSet outputSet = new ResourceSetImpl();
        outputSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new EcoreResourceFactoryImpl());
        outputSet.eAdapters().addAll(originalSet.eAdapters());
 


If only it were that easy to try this on this example...
Re: [Xcore][gradle] Two mysterious problems. [message #1754697 is a reply to message #1754688] Tue, 21 February 2017 16:08
Ed Merks is currently offline Ed MerksFriend
Messages: 28195
Registered: July 2009
Senior Member
Setting @GenModel(loadInitialization="false") doesn't work for your example?

And no, adding adapters to the output resource set won't change how it creates the output stream for saving the Ecore resource.
Re: [Xcore][gradle] Two mysterious problems. [message #1754714 is a reply to message #1754697] Tue, 21 February 2017 18:19
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 28
Registered: December 2014
Junior Member
@GenModel(loadInitialization="false") works for my example -- i.e., I can generate & compile the generated code without errors.
For now, that's a good enough workaround. Thanks for looking into this!
 Topic: MagicDraw reading UML Profiles
Re: MagicDraw reading UML Profiles [message #1754685 is a reply to message #1754490] Tue, 21 February 2017 14:40
Ed Willink is currently offline Ed WillinkFriend
Messages: 5056
Registered: July 2009
Senior Member
Hi

I think that you will find that setting XMLResource.OPTION_DEFER_IDREF_RESOLUTION in your load options is the secret. Arguably this is an uncostly option that solves real problems so it should always be set. Acceleo should probably set it automatically.

Regards

Ed Willink
Re: MagicDraw reading UML Profiles [message #1754696 is a reply to message #1754685] Tue, 21 February 2017 16:04
Ed Merks is currently offline Ed MerksFriend
Messages: 28195
Registered: July 2009
Senior Member
The problem might well be the opposite. Given there isn't much of a stack trace shown, I can only guess that it might well be the case that something (in the same resource) is using the the profile to create instances before the profile fully loaded and resolved, i.e., before the cross references have been set. Deferring when cross reference are set to be even later might be even more of a problem... But I can only guess...
Re: MagicDraw reading UML Profiles [message #1754741 is a reply to message #1754696] Tue, 21 February 2017 21:27
Michael Sausmikat is currently offline Michael SausmikatFriend
Messages: 2
Registered: February 2017
Junior Member
I get 2 kind of exceptions
First one:
Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:845)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSettingDelegate(BasicEObjectImpl.java:1565)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicIsSet(BasicEObjectImpl.java:1275)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eIsSet(BasicEObjectImpl.java:1257)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eIsSet(BasicEObjectImpl.java:1241)
	at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:437)
	at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.next(EContentsEList.java:595)
	at org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer.handleCrossReference(EcoreUtil.java:1794)
	at org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer.add(ECrossReferenceAdapter.java:216)
	at org.eclipse.emf.ecore.util.ECrossReferenceAdapter.setTarget(ECrossReferenceAdapter.java:770)
	at org.eclipse.emf.ecore.util.ECrossReferenceAdapter.setTarget(ECrossReferenceAdapter.java:752)
	at org.eclipse.uml2.common.util.CacheAdapter.setTarget(CacheAdapter.java:360)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.didAdd(BasicNotifierImpl.java:121)
	at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:443)
	at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:341)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.add(BasicNotifierImpl.java:200)
	at org.eclipse.uml2.common.util.CacheAdapter.addAdapter(CacheAdapter.java:278)
	at org.eclipse.uml2.common.util.CacheAdapter.addAdapter(CacheAdapter.java:302)
	at org.eclipse.emf.ecore.util.ECrossReferenceAdapter.handleContainment(ECrossReferenceAdapter.java:660)
	at org.eclipse.emf.ecore.util.ECrossReferenceAdapter.selfAdapt(ECrossReferenceAdapter.java:568)
	at org.eclipse.uml2.common.util.CacheAdapter.selfAdapt(CacheAdapter.java:582)
	at org.eclipse.emf.ecore.util.ECrossReferenceAdapter.notifyChanged(ECrossReferenceAdapter.java:502)
	at org.eclipse.uml2.common.util.CacheAdapter.notifyChanged(CacheAdapter.java:386)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.dispatchNotification(NotifyingListImpl.java:261)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:294)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processTopObject(XMLHandler.java:1520)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1372)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2579)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1335)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2579)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1335)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:391)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:356)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:488)
	at de.msw.model.gen.main.Generate.<init>(Generate.java:90)
	at de.msw.model.gen.main.Generate.main(Generate.java:144)

For the following model part
        <eClassifiers xmi:type="ecore:EClass" xmi:id="_r0GtLfX4EeaOTqhRM7JmKw" name="Customization">
          <eAnnotations xmi:id="_r0GtLvX4EeaOTqhRM7JmKw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_11_5EAPbeta_be00301_1148632817486_155219_3"/>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtL_X4EeaOTqhRM7JmKw" name="typesForTarget" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtMfX4EeaOTqhRM7JmKw" name="typesForSource" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtM_X4EeaOTqhRM7JmKw" name="representationText" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtNfX4EeaOTqhRM7JmKw" name="keyword" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtN_X4EeaOTqhRM7JmKw" name="allowedRelationships" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtOfX4EeaOTqhRM7JmKw" name="disallowedRelationships" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtO_X4EeaOTqhRM7JmKw" name="hideMetatype" ordered="false" lowerBound="1" defaultValueLiteral="true">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Boolean"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtPfX4EeaOTqhRM7JmKw" name="customizationTarget" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtP_X4EeaOTqhRM7JmKw" name="applyToSource" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Stereotype"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtQfX4EeaOTqhRM7JmKw" name="applyToTarget" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Stereotype"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtQ_X4EeaOTqhRM7JmKw" name="superTypes" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Element"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtRfX4EeaOTqhRM7JmKw" name="base_Class" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtR_X4EeaOTqhRM7JmKw" name="standardExpertConfiguration" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtSfX4EeaOTqhRM7JmKw" name="suggestedOwnedTypes" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtS_X4EeaOTqhRM7JmKw" name="hiddenOwnedTypes" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtTfX4EeaOTqhRM7JmKw" name="suggestedOwnedDiagrams" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtT_X4EeaOTqhRM7JmKw" name="hiddenOwnedDiagrams" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtUfX4EeaOTqhRM7JmKw" name="inShortcutMenu" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Property"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtU_X4EeaOTqhRM7JmKw" name="showPropertiesWhenNotApplied" ordered="false" lowerBound="1" defaultValueLiteral="true">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Boolean"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtVfX4EeaOTqhRM7JmKw" name="quickApplyingFor" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtV_X4EeaOTqhRM7JmKw" name="usedUMLProperties" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtWfX4EeaOTqhRM7JmKw" name="possibleOwners" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtW_X4EeaOTqhRM7JmKw" name="multiLineTextProperties" ordered="false" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Property"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtXfX4EeaOTqhRM7JmKw" name="category" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtX_X4EeaOTqhRM7JmKw" name="checkSpelling" ordered="false" unique="false" upperBound="-1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtYfX4EeaOTqhRM7JmKw" name="defaultShapeSize" lowerBound="2" upperBound="2">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtY_X4EeaOTqhRM7JmKw" name="doNotSuggestAsType" ordered="false" lowerBound="1" defaultValueLiteral="false">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Boolean"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtZfX4EeaOTqhRM7JmKw" name="helpID" ordered="false">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtZ_X4EeaOTqhRM7JmKw" name="preferredMetatype" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtafX4EeaOTqhRM7JmKw" name="showPropertiesWhenNotAppliedLimitedByProfileApplication" ordered="false" defaultValueLiteral="true">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Boolean"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0Gta_X4EeaOTqhRM7JmKw" name="showPropertiesWhenNotAppliedLimitedByElementType" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtbfX4EeaOTqhRM7JmKw" name="allowedDragAndDrops" ordered="false" lowerBound="1" upperBound="-1" eType="_r0GtefX4EeaOTqhRM7JmKw"/>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0Gtb_X4EeaOTqhRM7JmKw" name="abbreviation" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtcfX4EeaOTqhRM7JmKw" name="additionalContent" ordered="false" eType="_r0Gth_X4EeaOTqhRM7JmKw"/>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0Gtc_X4EeaOTqhRM7JmKw" name="subElementContentsIncluded" ordered="false" eType="_r0GtnfX4EeaOTqhRM7JmKw" defaultValueLiteral="All"/>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtdfX4EeaOTqhRM7JmKw" name="doNotSuggestNameAutoCompletion" ordered="false" lowerBound="1" defaultValueLiteral="true">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Boolean"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0Gtd_X4EeaOTqhRM7JmKw" name="symbolStandardExpertConfiguration" ordered="false" lowerBound="1" upperBound="-1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
        </eClassifiers>
        <eClassifiers xmi:type="ecore:EClass" xmi:id="_r0GtefX4EeaOTqhRM7JmKw" name="DragAndDropSpecification">
          <eAnnotations xmi:id="_r0GtevX4EeaOTqhRM7JmKw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_17_0_2_903028d_1341238576589_798230_2132"/>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0Gte_X4EeaOTqhRM7JmKw" name="sourceElement" ordered="false">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GtffX4EeaOTqhRM7JmKw" name="propertyActionResult" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0Gtf_X4EeaOTqhRM7JmKw" name="base_Class" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtgfX4EeaOTqhRM7JmKw" name="relationActionResult" ordered="false">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0Gtg_X4EeaOTqhRM7JmKw" name="representationText" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0GthfX4EeaOTqhRM7JmKw" name="appendMode" ordered="false" unique="false" lowerBound="1" defaultValueLiteral="true">
            <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Boolean"/>
          </eStructuralFeatures>
        </eClassifiers>

Second one:
Exception in thread "main" java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EAttributeImpl cannot be cast to org.eclipse.emf.ecore.EReference
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2755)
	at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2229)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1366)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2579)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1335)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2579)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1335)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:391)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:356)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:488)
	at de.msw.model.gen.main.Generate.<init>(Generate.java:90)
	at de.msw.model.gen.main.Generate.main(Generate.java:144)

For the following model part
        <eClassifiers xmi:type="ecore:EClass" xmi:id="_r0Gtr_X4EeaOTqhRM7JmKw" name="grouped">
          <eAnnotations xmi:id="_r0GtsPX4EeaOTqhRM7JmKw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_11_5EAPbeta_be00301_1148642764910_998510_268"/>
          <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_r0GtsfX4EeaOTqhRM7JmKw" name="base_Property" ordered="false" lowerBound="1">
            <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Property"/>
          </eStructuralFeatures>
          <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_r0Gts_X4EeaOTqhRM7JmKw" name="group" ordered="false" lowerBound="1" eType="_r0GttfX4EeaOTqhRM7JmKw" defaultValueLiteral="General"/>
        </eClassifiers>
        <eClassifiers xmi:type="ecore:EEnum" xmi:id="_r0GttfX4EeaOTqhRM7JmKw" name="CustomizationGroupNames">
          <eAnnotations xmi:id="_r0GttvX4EeaOTqhRM7JmKw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_11_5_be00301_1151668147214_220172_349"/>
          <eLiterals xmi:id="_r0Gtt_X4EeaOTqhRM7JmKw" name="Connection Rules"/>
          <eLiterals xmi:id="_r0GtuPX4EeaOTqhRM7JmKw" name="Model Initialization" value="1"/>
          <eLiterals xmi:id="_r0GtufX4EeaOTqhRM7JmKw" name="Properties" value="2"/>
          <eLiterals xmi:id="_r0GtuvX4EeaOTqhRM7JmKw" name="OwnedElements" value="3"/>
          <eLiterals xmi:id="_r0Gtu_X4EeaOTqhRM7JmKw" name="General" value="4"/>
          <eLiterals xmi:id="_r0GtvPX4EeaOTqhRM7JmKw" name="Naming" value="5"/>
          <eLiterals xmi:id="_r0GtvfX4EeaOTqhRM7JmKw" name="Symbol" value="6"/>
          <eLiterals xmi:id="_r0GtvvX4EeaOTqhRM7JmKw" name="Content" value="7"/>
        </eClassifiers>


It is always the same, I change the order and it is OK
Forum: Newcomers
 Topic: Does jetty not support DSA public key certificate?
Re: Does jetty not support DSA public key certificate? [message #1754683 is a reply to message #1754375] Tue, 21 February 2017 14:29
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3017
Registered: July 2009
Senior Member
The Jetty project uses a mailing list to support its community. See https://dev.eclipse.org/mailman/listinfo/jetty-users
 Topic: Linking
Linking [message #1754684] Tue, 21 February 2017 14:40
Arwel Hughes is currently offline Arwel HughesFriend
Messages: 1
Registered: February 2017
Junior Member
Hi,
I'm trying to make a simple C project, but when I try to compile, I get 'undefined reference to `powf'', even though I have #include <math.h> at the start of my code.

I've googled around this, and am told that that for previous versions of eclipse, I should..... "project -> properties -> C/C++ Build -> Settings -> GCC Linker -> Libraries -> add "m" -> Apply -> build". But, in Oxygen everything has changed and there is no longer a 'C/C++ build' under this menu as far as I can see.

How do I do this in the latest version please? This is *really* annoying me! Confused
 Topic: Eclipse not saving all windows
Re: Eclipse not saving all windows [message #1754619 is a reply to message #1754609] Tue, 21 February 2017 06:19
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2806
Registered: July 2009
Senior Member

Not to discount your experience, but this works correctly on my 4.6.2 installation.
Re: Eclipse not saving all windows [message #1754713 is a reply to message #1754619] Tue, 21 February 2017 18:13
Jon Leighton is currently offline Jon LeightonFriend
Messages: 4
Registered: February 2017
Junior Member
Um... that suggests that my experience is not the norm, which is good news for everyone else.

[Updated on: Tue, 21 February 2017 18:31]

Report message to a moderator

Re: Eclipse not saving all windows [message #1754719 is a reply to message #1754713] Tue, 21 February 2017 19:04
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2806
Registered: July 2009
Senior Member

Is anything showing up in the Error Log view when you've restarted and encountered this problem? Is there anything additionally installed into your download? Does it still happen with an update to the latest/current version?
Re: Eclipse not saving all windows [message #1754729 is a reply to message #1754719] Tue, 21 February 2017 19:48
Jon Leighton is currently offline Jon LeightonFriend
Messages: 4
Registered: February 2017
Junior Member
The only available update was an Oomph update. I applied it and it did not fix the problem. I haven't installed any additional plugins that I'm aware of. How do I check the Error Log view? I'm not familiar with that.

I haven't tested this enough to be certain, but it appears that selecting Exit from the File menu results in the window configuration being saved, while right-clicking on the Eclipse icon in the Launcher and selecting Quit does not.

[Updated on: Tue, 21 February 2017 20:01]

Report message to a moderator

Re: Eclipse not saving all windows [message #1754742 is a reply to message #1754729] Tue, 21 February 2017 21:28
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2806
Registered: July 2009
Senior Member

Ah, the view's only present if the Plug-in Development Environment is installed. The information would also be present in your workspace's (hidden by the leading '.') .metadata/.log file.
Forum: C / C++ IDE (CDT)
 Topic: How to find all ifs, switch cases, etc.
Re: How to find all ifs, switch cases, etc. [message #1754720 is a reply to message #1754567] Tue, 21 February 2017 19:14
Marc-André Laperle is currently offline Marc-André LaperleFriend
Messages: 219
Registered: July 2009
Senior Member
There's no way that I know of that is index-based, the index primarily stores names and type information, not control flow (well, except for callers of functions which it does store). But if by time consuming you mean that it takes long for you to type Wink maybe you could be interested in the Control Flow Graph code available in org.eclipse.cdt.codan.core.cxx.internal.model.cfg. It parses the AST for you and offers a higher level interface. But it will still be as slow, CPU-wise as it does traverse the AST as well.
 Topic: How to debug binaries with cdtdebug.sh from command line?
Re: How to debug binaries with cdtdebug.sh from command line? [message #1754721 is a reply to message #1754588] Tue, 21 February 2017 19:20
Marc-André Laperle is currently offline Marc-André LaperleFriend
Messages: 219
Registered: July 2009
Senior Member
It looks like there might be a bug in CDT's Dwarf parsing. Can you try with another executable with debug info, like a simple hello world? Also, is this using the new Dwarf 5 by any chance? I'm asking in case because the spec just came out Wink
 Topic: Import and build a Makefile project
Re: Import and build a Makefile project [message #1754731 is a reply to message #1754474] Tue, 21 February 2017 20:10
David Vavra is currently online David VavraFriend
Messages: 509
Registered: October 2012
Senior Member
You imported your code as an existing Makefile project.
That means that everything in the Makefile is your responsibility.
And further means it is irrelevant that Eclipse is unaware of mpicxx or what compiler is being used.

Almost, anyway. You still have to inform the Indexer of the locations of the header files (yours and the system's) somehow.
You do this by enabling the appropriate Discovery providers or providing the include paths as User Entries.
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc.
One of the providers can be the GCC Built-in Compiler Settings. You can modify the command for this as needed.
Another of the providers is the GCC Build Output Parser which will "discover" the paths after a build. Its default configuration will scan the output from GCC, g++ and clang. You can modify this.

I usually build my own Makefiles.
To get Eclipse to use them you need to set the make command and build directory in
Project --> Properties --> C/C++ Build

Eclipse has two builtin targets: all and clean.
It will append these to the make command as appropriate.
You cam use other make targets which you can create, select and execute using the Build Targets view.

 Topic: Makefile problems
Re: Makefile problems [message #1754739 is a reply to message #1754497] Tue, 21 February 2017 21:20
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 210
Registered: June 2014
Senior Member
What extensions do you get.

If you are on Windows, I would expect a .exe to be created, on Linux there would be no extension by default.

The elf/hex/etc... are normally created by specific extensions to CDT, e.g. the GNU ARM plugins creates some of these IIRC.

Those third-parties set up the projects for you. You can do it manually by running objcopy as post build steps in your build configuration.
 Topic: Problems with Eclipse Kepler
Problems with Eclipse Kepler [message #1754617] Tue, 21 February 2017 06:04
Travis Dodge is currently offline Travis DodgeFriend
Messages: 1
Registered: February 2017
Junior Member
I'm currently enrolled in a class where I am just beginning to learn how to code C/C++ so I downloaded Eclipse Kepler to use as my IDE. I have lots of trouble just trying to get it to run, but after several days of trying many solutions and getting it to accept my code without giving me an error on every line, now it simply won't run the code.

I am using the examples from my textbook and I've run the code in Visual Studio so I know the problem isn't with the code. I can get a puts() function to work and the output works fine. But if I add a scanf() funtion to accept user input, the console just goes blank but keeps running like it's trying to load something but nothing ever happens. I go into the Problems window and it doesn't show anything. Then if I comment out the scanf() function it continues to not load until after I close Eclipse and open it again.

I've looked this up and I can't seem to find anyone else with a similar problem. I'm very new to this IDE and this programming language so I have no clue what is going wrong or how to proceed.
Re: Problems with Eclipse Kepler [message #1754725 is a reply to message #1754617] Tue, 21 February 2017 19:33
Marc-André Laperle is currently offline Marc-André LaperleFriend
Messages: 219
Registered: July 2009
Senior Member
Why compiler are you using? If it's MinGW on Windows, make sure you have your MinGW bin path. Also, there might be buffering going on, for some workarounds see https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732#c38 and later comments.
Re: Problems with Eclipse Kepler [message #1754743 is a reply to message #1754725] Tue, 21 February 2017 21:37
David Vavra is currently online David VavraFriend
Messages: 509
Registered: October 2012
Senior Member
The following works with NEON under Windows 7 using MinGW.
I tried setvbuf with no buffering (_IONBF) but there is still some buffering occurring.
According to the bug report this is likely the buffer in the pipe between eclipse and the executable.
I normally use _IOLBF myself but it had a strange effect.
You should flush after every prompt.

int main(void) {
//	setvbuf(stdout, NULL, 0, _IOLBF);
	puts("!!!Hello World!!!\n");
	int integer1;
	int integer2;
	int sum;
	printf("Starting program\n");     fflush(stdout);
	printf("Enter first  integer: "); fflush(stdout);
	scanf("%d", &integer1);

	printf("Enter second integer: "); fflush(stdout);
	scanf("%d", &integer2);

	sum = integer1 + integer2;

	printf("Sum is:               %d\n", sum);
	printf("Done\n");

	return EXIT_SUCCESS;
}


Did you pick Kepler for a reason.? The latest is NEON.2. Why not use it?

[Updated on: Tue, 21 February 2017 21:40]

Report message to a moderator

 Topic: Fatal error files: misc.h: No such file or directory
Re: Fatal error files: misc.h: No such file or directory [message #1754735 is a reply to message #1754496] Tue, 21 February 2017 20:34
David Vavra is currently online David VavraFriend
Messages: 509
Registered: October 2012
Senior Member
The error is misc.h: No such file or directory.
You will need to know where misc.h is.
Apparently it is not in C: \ cygwin64 nor in any of the compiler builtin directories.

You likely will need to add the directory containing misc.h to the compiler includes path pane (the top pane with the capital -I) at
Project --> Properties --> C/C++ Build --> Settings on the Tool Settings tab.


Re: Fatal error files: misc.h: No such file or directory [message #1754744 is a reply to message #1754496] Tue, 21 February 2017 21:39
Tauno Voipio is currently online Tauno VoipioFriend
Messages: 294
Registered: August 2014
Senior Member
There is little sense to compile a module for a STM32 processor on the native compiler for a PC. It seems to me that the missing header is a part of the ARM processor libraries, probably in the STM32 specific librarues.



Current Time: Tue Feb 21 21:43:58 GMT 2017

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

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