Cannot compile royale app using Crux: Could not find file for class: mx.rpc.AsyncToken - dependency-injection

I'm creating a hello world type of application using Royale 0.9.6 and Crux. It's my first time trying out Crux and I've been using the examples provided within the Royale sdk to move forward. Unfortunately after setting up everything the compilation fails with the following error:
java.lang.RuntimeException: Unable to find JavaScript filePath for class: mx.rpc.AsyncToken org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:643)org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:672)org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:672)org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:672)org.apache.royale.compiler.internal.graph.GoogDepsWriter.addDeps(GoogDepsWriter.java:672)org.apache.royale.compiler.internal.graph.GoogDepsWriter.buildDB(GoogDepsWriter.java:325)org.apache.royale.compiler.internal.graph.GoogDepsWriter.getListOfFiles(GoogDepsWriter.java:113)org.apache.royale.compiler.internal.codegen.mxml.royale.MXMLRoyalePublisher.publish(MXMLRoyalePublisher.java:446)org.apache.royale.compiler.clients.MXMLJSCRoyale.compile(MXMLJSCRoyale.java:441)org.apache.royale.compiler.clients.MXMLJSCRoyale._mainNoExit(MXMLJSCRoyale.java:265)org.apache.royale.compiler.clients.MXMLJSCRoyale.mainNoExit(MXMLJSCRoyale.java:222)org.apache.royale.compiler.clients.MXMLJSC._mainNoExit(MXMLJSC.java:369)org.apache.royale.compiler.clients.MXMLJSC.mainNoExit(MXMLJSC.java:304)org.apache.royale.compiler.clients.MXMLJSC.staticMainNoExit(MXMLJSC.java:262)org.apache.royale.compiler.clients.MXMLJSC.main(MXMLJSC.java:244)
Then there are multiple error lines saying that multiple "mx.rpc" classes on which Crux depend cannot be found.
I'm wondering if I'm missing an import or something but I can't figure it out.
Thank you,
EDIT: Here are some simple steps to reproduce:
Open Moonshine
File > New > Royale Browser Project
Type any project name and create the project
Compile (CTRL + J): compilation successful
Open the main mxml file src/[appname].mxml
Add xmlns:crux="library://ns.apache.org/royale/crux" to the <js:Application> opening tag.
Add the following: <j:beads>
<crux:Crux>
</crux:Crux>
</j:beads>
Compile (CTRL + J): compilation fails as described above.

I just looked into Moonshine IDE project files in examples available in Royale repository. They were broken - I have fixed them so you can wait for Nightly build and download new SDK along with examples or just use checkout source code.
When you open any of those examples, right click in Moonshine choosing Settings and you should check Build Options - There will be many additional compiler parameters, but in your case probably it is enough if you put in "Additional Compiler Options" +configname=flex

Looking at the screenshot it looks like you're using <j:beads> but haven't declared the <j:> namespace. Try using <js:beads> instead.

Related

Link against a **custom** asan library

What is the right way of using a custom (built by me from llvm sources) asan library?
During compilation I am using -fsanitize=address.
But what should I use for linking? It is recommended everywhere to use -static-libasan or -shared-libasan, but as far as I understand, linker will use the library that comes with compiler (not mine).
Shall I drop -static-libasan / -shared-libasan and just link against the clang_rt.asan-dynamic-x86_64 built by me? Or something else?
if you use -shared-asan at build time it will link to the shared lib which is what you want, and it will default to that standard path, but you should be able to easily override it when you go to run your app to use your own build using LD_PRELOAD.
for example:
LD_PRELOAD=/home/yourname/llvm/lib/clang_rt.asan...so myapp
so...the linker won't load the standard one because yours will be loaded into memory already and myapp will link up to it.
you still might need to make sure the version you are building from source is the same or close enough to the one that it linked to myapp at build time.

Build failed - Check imports - Dart Angular Tutorial - angular_tour_of_heroes - part 2

While following tutorail - Angular-dart tutorial - Tour of Heroes - part 2
with using IntelliJ IDEA in Windows 10 while using chrome, I got following error(s) -
[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached):
Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
Please check the following imports:
import 'package:angular_app/app_component.css.shim.dart' as import0; from angular_app|lib/app_component.template.dart at 12:1
[SEVERE] Failed after 1.3s
Serving web on http://localhost:53323
I have checked multiple times & I have replaced all - 5 files - namely
lib/app_component.css, lib/app_component.dart, lib/app_component.html, lib/src/hero.dart & lib/src/mock_heroes.dart from Review the app structure but I am still getting the above mentioned error & -
I could not find any app_component.template.dart
Nor could found any instance of imported package:angular_app/app_component.css.shim.dart or shim using IntelliJ Find in Path (Ctrl+Shift+F)
I have tried to delete build and rebuild.
I have also re-installed dart 2.1.0 using windows package manager & changed the location of dart-sdk accordingly in IntelliJ IDEA Settings/Dart, as for brief period I was getting dart-sdk error, but that is fixed.
This my first time asking question on stacksoverflow, but I have checked similar questions, could not resolve that issue.
the most likely reason for that build failure is due to the stylesUrls files not being found. This could be because the name in that array doesn't match the name in the file system or is not the expected place in the file system.
To confirm, I started from scratch, downloaded the quickstart-master.zip to get the project structure.
And followed the steps all the way through the step you were stuck on.
The only time I was able to generate that error while following the steps is when I added thestyleUrls: ['app_component.css'], to app_component.dart prior to creating the file.
I got the same:
[SEVERE] build_web_compilers|entrypoint on test/app_test.dart.browser_test.dart:
Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
Please check the following imports:
import 'package:angular_app/app_components.css.shim.dart' as import0; from angular_app|lib/app_component.template.dart at 12:1
Once i created the css file, the error went away and everything worked fine.
I completed the entire step you were up to and my app was working fine.
I then did as you did and copied each file from the step and replaced my work with it, still worked.
So confirm my hunch, i changed the name of the css file, and received the same error.
regarding app_component.template.dart that file is auto generated by dart and can be found in your project under .dart_tool/build/generated/angular_app/lib
I had a very similar problem. I ran webdev build and then webdev serve and it fixed it right up.

creating createM3FromEclipseProject in Rascal creates no data

I'm new to Rascal and have a very very basic question.
I'm using in a little test project the follwing command :
createM3FromEclipseProject(|project://example-project|);
and uses the code to extract data from a project
It only gives my {}... I assume that means that my M3 model is empty.
What am I doing wrong? It has to be something really basic..
Greets
Doerak
Have you followed the recipe in http://tutor.rascal-mpl.org/Recipes/Recipes.html#/Recipes/Metrics/MeasuringJava/MeasuringJava.html ?
If no: then please do because that example code is tested.
If yes, then it means there is no data in your project. This can be caused by:
there really is no code in your project. This can be remedied :-)
or the source path of the example project (with the Java code) is not configured to point to the place where you have your Java code. This can be fixed in the properties pane (right-click on the project and its the bottom option). From there on, find help on managing Eclipse projects on stackoverflow.com.

"Groovy:unable to resolve class ..." (import error in LoginController.groovy)

I am trying to use the ":spring-security-core:2.0-RC2" (using Grails version 2.3.1), but have my own LoginController.groovy. Following Burt's notes (here and here), I copied the LoginController.groovy from the original location at "myapp\target\work\plugins\spring-security-core-2.0-RC2\grails-app\controllers\grails\plugin\springsecurity" to my project location at "myapp\grails-app\controllers\com\company". Now I get a bunch of import error messages like "Groovy:unable to resolve class ..." (I have attached am image below showing all the imports giving errors). How do I take care of these errors?
Sorry if this is a trivial question (still getting used to Grails), and thank you for the help!
It looks like GGTS/STS isn't entirely aware that the plugin is installed, since those classes are from the two jars that the plugin depends on. Try right-clicking the project node in the tree and running Grails Tools > Refresh Dependencies. If that's not enough, run Project | Clean to force a full recompile.

How to resolve "Main module of program is empty: nothing will happen when it is run"

I have two projects in an F# solution.
1. main project with [EntryPoint] and set as the StarUp project.
2. support, the second project, holds a group of support modules. I.e. they are only called and never initiate anything nor serve as the entry point nor are the StartUp project.
For the last module in the support project, compiling in Visual Studio gives
warning FS0988: Main module of program is empty; nothing will happen
when it is run
While using compiler option nowarn inline as #nowarn "988" in the module causing the warning does suppress the message I would rather add something like a dummy function with comments that resolves the issue.
How does one make such a dummy function to resolve the warning?
EDIT
Jack is correct in that my support project was setup as a Console Application instead of a Class Library. Changing to Class Library resolved the warning. It is also nice to know about do () for the other case.
EDIT
While it seemed odd that I would have set a support project as a Console Application, I recently found that for some reason when I made a change to the code in the project, something changed the Output type from Class Library to Console Application. I suspect it has to do with the F# PowerPack and it's build rules, but it's only a guess.
Are you building the support project as a Library or as a Console Application? (This is set via the project properties page.)
If you're building it as a library, then you may need to add a do() at the end of the last file in the project. This is necessary to make the F# compiler happy in a few specific scenarios, like when you create a module which contains only assembly-level attributes (because they're applied to the assembly, the module appears "empty" to the compiler).
You can see an example in my code here:
https://github.com/jack-pappas/FSharp.Compatibility/blob/master/FSharp.Compatibility.OCaml/AssemblyInfo.fs

Resources