Acceleo code-generation doesn't start, Couldn't load main class - acceleo

I created a new very easy Acceleo project, with just one main module generate.mtl that tries to create a new file. The package is exported in the Manifest. When I launch the .mtl file, I get this error
!MESSAGE Couldn't load class org.eclipse.acceleo.module.sample.main.Generate. Check that its containing package is exported.
!MESSAGE Couldn't load class org.eclipse.acceleo.module.sample.main.Generate from project org.eclipse.acceleo.module.sample
I don't really know why and what to do.

I had a similar problem and I solved it by adding the bin directory to the classpath in the Manifest file.
I did this because of Etienne's answer here: Can't generate java from UML using Acceleo in Eclipse1
When you open up the MANIFEST.MF with the "Plugin Manifest Editor", there is a "Runtime" tab at the bottom. On the right side bottom of that screen there is a place to edit the classpath. I added "bin/"
After that, I had no problems with loading the class.

I solved using the version 3.4 of Acceleo, instead of the 3.5. The 3.4 works

Your solution #jpcahoon - Solved my problem with Acceleo 3.5.1

I had the same problem today despite having the Classpath declared in the Manifest file.
The solution for me was to tweak the Execution Environment in the Overview tab of the manifest file (In my case, setting it to JavaSE-1.6 solved the problem).

Related

Xamarin binding library combination of InputJar and ReferenceJar?

I am trying to use https://github.com/Redth/Xamarin.Android.Xposed in Xamarin but the final result is rejected by Xposed, saying: "cannot load module" .. "the xposed api classes are compiled into the module's apk". The xposed-api.jar file is currently a EmbeddedJar, which is what causes that error. The xposed-api.jar file is made available during run-time by Xposed already.
From the xamarin docs.
InputJar – Does not embed the .jar into the resulting Bindings Library .DLL. Your Bindings Library .DLL will have a dependency on this .jar at runtime.
InputJar seems like it will solve my issue with it being compiled into the resulting apk. However, it can't compile into an apk at all. It gives me errors in the generated java file such as.
JAVAC0000: error: package de.robv.android.xposed does not exist
de.robv.android.xposed.IXposedHookLoadPackage 0
Then for ReferenceJar..
ReferenceJar – Specifies a reference .jar: a reference .jar is a .jar that one of your bound .jar or .AAR files depends on. This reference .jar is used only to satisfy compile-time dependencies. When you use this build action, C# bindings are not created for the reference .jar and it is not embedded in the resulting Bindings Library .DLL.
Great, it will provide it during compile-time.. however, no bindings will be generated so I can't use it.
I also tried combining these by creating 2 identical libraries with one having InputJar and the other ReferenceJar, but that did not work at all.
How can I achieve what I am trying to do?
To sum it up, I need to add xposed-api.jar as a library just like how android.jar of the Android framework is added. You can use the classes and compile properly, without the classes being compiled into the apk.
OK, The trick is actually "AndroidExternalJavaLibrary".
Imagine you have a Jar binding project XPosedAPI, and an Android project XposedSample.
The structure would be:
XPosedAPI
|-- Jar
|-- api-82.jar (InputJar)
XposedSample
|-- Jar
|-- api-82.jar (AndroidExternalJavaLibrary)
You see, the trick is you have to put the same jar file for each project.
For the Jar binding project, it has to be "InputJar" - that's used to generate the C# binding dll.
For the project that using the Jar bindng dll, the jar has to be "AndroidExternalJavaLibrary". This ensures the javac compile process.
There was an easier way, the Java.Interop.DoNotPackageAttribute.
You just put the below line on one of these projects (just put it on XPosedAPI project would be enough), and it works:
[assembly: Java.Interop.DoNotPackage("api-82.jar")]
However, this attribute is marked as "deprecated", although it's easier.
I figured out this, because I'm trying to do the same thing - write a xposed module in C#.
The Xamarin.Android.Xposed project looks nice, but in fact it won't work, and there are much more problems to be fixed besides the jar binding issue.
I think I'm getting closer, and I may publish it in a few days if I can fix all the bugs remained.
If you're interested, watch my project: https://github.com/UlyssesWu/XamarinPosed

error Class 'com.example.NodeDriverKt' not found in module 'cordapp-example'

While running a corDapp(corDapp-example) for the first time using Kotlin-source, the IntelliJ throws this error - "error Class 'com.example.NodeDriverKt' not found in module 'cordapp-example".
I looked for this class in my project structure and I can see a file named NodeDriver.kt which contains a function "main" but I could not see any class declaration.
Any solution to remove this error would be much appreciated.IntelliJ
i had this same problem with the example cordapp. I was able to resolve this problem by deleting the build and gradle folders in my project, and then, opening the jet brains IDE back again. This restarted the process of installing the gradle. Then the configurations file were set the right way. Previously all the class paths were not there. Have a look on my new configuration of kotlin that was preset after performing the above step. "Use Classpath of module" now is com.example.workflows-kotlin.test =>
I hope this helps :)
A Kotlin file called FileName.kt with a main method is compiled into a JVM class called FileNameKt. So the NodeDriverKt class is generated when the Kotlin main method in NodeDriver.kt is compiled into a JVM class.
This appears to be an IntelliJ caching issue. Try deleting the Run Example CorDapp - Kotlin run configuration (even if you are not using it directly to run the driver.
Solution 1 : It is a problem centric to 'Caching issue' of IntelliJ IDE. Open menu: File and hit Invalidate Caches / Restart....
Solution 2 : If the problem still persists then remove the gradle folder from the project and close the project and after opening the IDE ,it will setup the gradle again.And it will solve the issue.
While debugging the application,now you will be able to see the class path.

Debugging Acceleo M2T Transformation within MTL file

I'm currently setting up an Acceleo project to generate Java source code from an Eclipse UML2 model. I do have experiences with the Xtend code generator, but not with the Acceleo one. However, I wanted to try Acceleo as an alternative to Xtend.
Unfortunately, I do have problems with debugging the M2T transformation from within the MTL template file. All breakpoints I set in the MTL are just ignored and the debugger runs the transformation without stopping.
I've searched Stackoverflow and other sources for help, but none of the responses helped me to get the debugger to work.
I'm running the transformation as an Acceleo Application and am using the Java Application runner since the Acceleo Plug-in Application is no longer supported with Eclipse Oxygen.
Did anyone of you have similar troubles and/or found any solution?
Thanks for any hint.
Best regards
Timo Rohrberg
I have the same requirement, but apparently there is not way to debug it at runtime, as far as I know.
https://www.eclipse.org/forums/index.php?t=msg&th=1080008&goto=1740153&#msg_1740153
Create a wrapper service for java printing/logging.
This is not the best solution, but, I was able to make do.
You could also use the acceleo interpreter (using the acceleo eclipse perspective) to try and evaluate queries before changing your code.
https://wiki.eclipse.org/Acceleo/Interpreter
I use this with papyrus and it works nicely.
I found a solution (or workaround) to debug .mtl files.
In the manifest editor window of your eclipse plugin
-on the runtime tab add your bin folder (the folder containing the compiled .class and .emtl files) to the classpath.
After this your breakpoints in the .mtl files will work, if you run your Acceleo launcher in "Acceleo Plug-in Application" mode. (Configuration section in the Acceleo launcher window)
(Tested with Eclipse 19-03, Acceleo 3.7)

How to Import Swift Source Code into a XCode Swift Project

I've written a working swift prototype. It contains a parent class and some subclasses. I want to be able to import the parent class into another project where I will create sub classes for it.
I created a new XCode project for a dynamic library, added the parent class to it and ran build. I've seen where you can't use static for Swift code.
I also created a different directory and set up a swift package. The build on it ran successfully.
When I add an import statement to the project where I want to use it, it says it can't find it. The statement is: "import RailsData", the name of the parent class.
I've tried adding the dynamic library project to "Linked Frameworks and Libraries". I also tried adding the swift file directly. XCode flags the import as not found.
The swift package manager example is all command line based so I'm not sure if will work with XCode projects. I would eventually like to make a package out of it.
Xcode 8.2, Swift 3.0. I'm pretty sure I'm missing something fundamental.
Update
I found a related question. It says to
Put your package manifest file into the same directory as the Xcode project, and then invoke swift package generate-xcodeproj
With a search I found this page that says:
Instructions for how to build a package are provided by the Package.swift manifest file.
So I copied the file to the root of my project and ran the command above. It created a new .xcodeproj. When I opened it, I saw my original files, but not anything from the package. That's not surprising as there is no reference to it's location in the file system. Also a mystery is what happens when you want additional packages. Do you keep generating new projects?
It seems like the missing link is the following command
swift package generate-xcodeproj
Actually Adding Swift 3 packages to Xcode 8 using the Swift package manager should answer your question.

Using ActionBar Sherlock with intellij through maven. #style/Theme.Sherlock in AndroidManifest.xml does not match

Just trying the simplest thing to use ActionBar Sherlock in an Android app using IntelliJ 12.
I've read in other post and blogs and people keep dowloading ABS' source and mavenizing it ( complaining ABS on maven is too old). It turns out on maven we can get 4.3.1 now.
Therefore, I am trying to avoid mavenizing ABS again.
So, I created a blank Android app project with a simple Hello, World activity.
Compiled and ran it, just to be sure.
Then, I went to the Project Structure and added the ABS library via Maven (com.actionbarsherlock:actionbarsherlock:4.3.1).
Added it to the Module that represents my app.
Made sure to mark the library as "Provided" in the Module Dependencies.
The whole thing compiles and run.
Of course, as soon as I extend the main activity from SherlockActivity the app crashes. Expected...
So, I open the AndroidManifest.xml and add android:theme="" to the application tag.
To my surprise and pain, #style/Theme.Sherlock... does not auto-complete, and the compiler complains with the dreaded error:
Error: No resource found that matches the given name (at 'theme' with
value '#style/Theme.Sherlock')
So, my question is what did I miss?
Is there a way to ask IntelliJ to load the resources from ABS?
Thanks.
Adding ActionBarShelock as a library (plain jar) will not work, you have to configure it as a Library module in IntelliJ IDEA and then set your main module to depend on it. See this tutorial.

Resources