I start my play multi module application as a SBT Task using something like:
";project testProject;~run"
It starts without a problem but after a couple of code reloads I would get something like
java.lang.IllegalArgumentException: requirement failed: Source file '/Users/testUser/git/test/modules/commons/target/scala-2.11/classes.bak/sbt3506893140703367490.class' does not exist.
at scala.Predef$.require(Predef.scala:233)
at sbt.IO$.copyFile(IO.scala:636)
at sbt.IO$.move(IO.scala:839)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2$$anonfun$complete$5.apply(ClassfileManager.scala:66)
After googling I found this Problems with Compiling Play Application
If I manually stop the scala compile server in Intellij then the problem goes away. Thing is the compile server starts automatically everytime I run the SBT Task. Is there a way to disable this?
Related
I work on a Kotlin-based cloud microservice. From time to time I need to run it in the IntelliJ debugger, but we often accidentally break the "local debug flow". There is no pipeline that checks if the IntelliJ run-configuration and the somewhat complex set of cloud-simulating proxies and mock-servers are in sync with the code base.
I would like to write a script that helps me check if the local debug flow works. The script should do the following:
build the project
start up the "mock cloud"
start the service locally using an IntelliJ run-configuration
run a Postman-collection against the locally running service
I need help with step 3 (and possibly step 1): How can I start the IntelliJ run-configuration via command line? I am using IntelliJ IDEA 2021.2 and MacOS 12.3.1.
There is no built-in way to start a Run Configuration from the command line. Instead, you should execute java/kotlin binary with classpath etc.
For example, for "Application" configuration it is needed to run the command like that:
After years of working fine, for the last few months I've not had the ability to Run As Groovy Script.
I can select it from the menu, but nothing happens.
Today I installed the latest Eclipse and plugin in an attempt to fix, but no luck.
What went wrong? Is there a log file to check?
https://dist.springsource.org/release/GRECLIPSE/3.8.0/e4.16
The output of the launch is written to the Console view. If there was a problem launching you can check the Error Log view for an entry. The launch configuration under Run > Run Configurations... > Groovy Script may also reveal classpath or other issues.
I am using the latest (2014-01-03) Golang plugin for IntelliJ - for the first time.
Usually, my terminal workflow is to do go build && ./executable -args=1
So I am attempting to create a launch configuration to do the same thing, I took these actions:
Create a "Go Application" configuration
Fill in GOPATH/GOROOT environment variable
Fill in CLI arguments
Because there has to be a file to run, so I chose the one with func main()
Then there is a problem. When I run the configuration, the Golang plugin does not build the project, but instead builds the single script file with main method, then attempt to run it - obviously it does not work.
How to create a configuration equivelent of go build && ./executable -args=1?
Try to use the latest version from the official plugin manager.
If that doesn't work, please help us identify the issue by submitting a report here
Also, we are working hard to update the plugin with better type checks, debugging, go appengine support, improved formatter and much more but any help in improving the plugin is greatly appreciated.
Hope it helps.
However, I prefer to use goclipse which support auto-build, auto code completion and debug.
I'm developing a JLine based application, which I'd obviously like to test as I develop.
JLine is a handy library which provides interactive console functionality to JVM applications.
JLine doesn't work in the Intellij console, probably because they've appropriated the tab key for their own nefarious needs, and what I want to test is tab-completion, because I'm implementing some tab-completed commands.
I drop to the SBT console, and try run-main Example simple, but I throws an Exception because there are now two jline libraries in the classloader - my one, and the one that SBT uses so the application explodes while loading JLine library (Singletons are evil)....
Sigh... Twiddle about at the SBT console for a bit, and discover I can run:
> show runtime:managed-classpath
[info] List(Attributed(/home/bryan/.sbt/boot/scala-2.10.0/lib/scala-library.jar), Attributed(/home/bryan/.ivy2/cache/org.parboiled/parboiled-scala_2.10/bundles/parboiled-scala_2.10-1.1.5.jar), Attributed(/home/bryan/.ivy2/cache/org.parboiled/parboiled-core/bundles/parboiled-core-1.1.5.jar), Attributed(/home/bryan/.ivy2/cache/jline/jline/jars/jline-2.10.jar))
I know I can parse that list, obviously spaces or commas would be a perfectly viable separator but Scala developers don't seem to be wired that way...
But SBT only seems to parse that command when I'm in it's console, if I execute that command from the actual, UNIX, console, like so:
% sbt show runtime:managed-classpath
[info] Loading project definition from /common/moon_excel/project
[info] Set current project to moon_excel (in build file:/common/moon_excel/)
[error] Not a valid command: show (similar: shell)
[error] Expected whitespace character
[error] Expected '/'
[error] Expected ':'
[error] Not a valid key: show (similar: show-timing)
[error] show
I'm trying to automate the process for when I've got 100 jars on the classpath (slight exaggeration), any suggestions?
sbt 0.13 (currently at RC3) moves JLine classes so that they aren't visible to user code. This should avoid conflicts with your code. Note that JLine currently leaks class loaders, so you may get PermGen errors after several runs.
You can use export runtime:fullClasspath in 0.13 to export a standard classpath string. In earlier versions, you can write a custom task. See also plugins like sbt-start-script, which generate a run script for you.
Finally, if possible, consider writing tests that don't need an interactive prompt. For example, sbt itself has some ScalaCheck properties for its completion library.
I have some idea with error handling in PHP - way to immediately get to place in code where error occurred.
I have written error handler to catch PHP errors, which loads file, that caused an error and displays +/- few lines of code from that file. It also mark line where error occurred and print stack trace, like this:
http://img834.imageshack.us/img834/3754/errh.png
Now, I have an idea, to provide some link (a href=) like other than http protocols (torrent:// or sth), like "netbeans://C:/some/file.php#110" which will put me back into NetBeans editor, open file where error occurred and put cursor in line, which caused a error.
Any ideas how to achieve that goal ?
What you need to do is register a custom url protocol. The techniques depend on the underlying operating system. here's is an example for windows. By opening NetBeans with a system call and the --open [filename] argument, you can open the file in question. However, that way you won't be able to go to a specific line.
In order to do so, you need to use the NetBeans API. If needed, you can use JNBridge to access Java functionality from .NET languages (which you'd need for windows).
All in all, it won't be easy and not cross-platform. A much easier way to go is to use xDebug on the server side and implement the library in the NetBeans editor, which will allow a lot more functionality than what you currently try to accomplish (stack traces, Jumping in Code, Stepping, variable views, ... - just to name a few). There seems to be a started proposal on this for the NetBeans editor.
If you do not care to switch the editor, you can check out Eclipse PHP Development Tools (Eclipse PDT), which has the debugger already implemented. Check out this article on the setup instructions.
I'd use xDebug with Netbean's xdebug integration which already jumps to the errors.
NetBeans IDE already has this option
Please open your project in NetBeans IDE.
main menu -> options -> editor -> hints -> select language php & select all check-boxes.
then refresh project show highlighting errors or undefined variables warnings.
if more with NetBeans IDE
http://netbeans.org/kb/docs/php/editorguide.html