Unable to load a Suite class - scala

Unable to load a Suite class. This could be due to an error in your runpath.
i am getting this error while trying to run scala test case. kindly suggest.

I have same error message as yours.
What I do is:
In your test run configuration(go "Edit Configuration" > "Use classpath ... of module") select the right module at place the image show.
At least this solve my problem that I target to wrong module. May it help you.

i solved the same problem by checking "Use SBT" option in test run configuration under Edit Configuration>Test Class

Related

Cannot initialize module TreeWalker during the build in Eclipse

I'm performing Project-Clean... in Eclipse Mars and getting the following error
Errors occurred during the build.
Errors running builder 'Checkstyle Builder' on project 'MyProject'.
cannot initialize module TreeWalker - Unable to instantiate
'RedundantThrows' class, it is also not possible to instantiate it as
com.puppycrawl.tools.checkstyle.checks.annotation.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.blocks.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.design.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.header.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.imports.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.indentation.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.javadoc.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.metrics.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.modifier.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.naming.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.regexp.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.sizes.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.whitespace.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.RedundantThrows,
com.puppycrawl.tools.checkstyle.filters.RedundantThrows,
com.puppycrawl.tools.checkstyle.RedundantThrows. Please recheck that class name
is specified as canonical name or read how to configure short name usage
http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that
provided ClassLoader to Checker is configured correctly.
The CheckStyle plugin version is 6.11.
Could you please help me figuring out what may cause this error. Thanks.
The RedundantThrows check has been removed from Checkstyle. Just remove the <module> entry for it from your checkstyle.xml.

sbt scalatest returning '0 test class found in package '<default package>''

I pulled the 'test-patterns-scala' Typesafe Activator template. Once loaded into Intellij 13.1.5 I right-clicked on the test/scala directory and selected 'Run->All Tests' this returned the output :
0 test class found in package '
There is also a popup which says:
Tests were not found in module 'test-patterns-scala', Use module "test-patterns-scala-build" instead
This is my first stackoverflow post, I searched for similar problems and only found the unanswered link below, however I couldn't up-vote it as a first time poster and the circumstances are a little different so I thought a new question was justified. Any help much appreciated!
Link to similar post: 0 test class found in package ‘<default package>’
I had the same problem a while ago. I got a fix by running 'sbt test' from the command line for the first go (in the project directory ofcourse).
After this the IntelliJ didn't have any problem in identifying the package and ran the test.

The ECLIPSE RCP project could not be exported successfully

I met an error when I exported the Eclipse Product using the export wizard on the overview tab of the .product file ,
the error message is as below .
but it worked just fine when I ran it from inside of Eclipse as an Eclipse Application.
can anybody provide some idea about this .
C:\workSpace\0709\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86_64.xml:90: The following error occurred while executing this line:
C:\workSpace\0709\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86_64.xml:1140: The following error occurred while executing this line:
C:\tool\eclipse-standard-kepler-SR2-win32-x86_64\eclipse\plugins\org.eclipse.pde.build_3.8.100.v20130514-1028\scripts\genericTargets.xml:243: A problem occured while invoking the director.
Thanks & Regards,
Jeff
The originating problem is somewhere else.. To find it out add following line to your genericTargets.xml under node <target name="runDirector"> -> <record name="path_to_log_output_file" loglevel="verbose"> . Then you will probably see actual problem.

Failed to resolve class via deferred binding

// ...some imports
public class Menu {
final MenuMaker myClass = GWT.create(MenuMaker.class); // ERROR
My ...gwt.xml:
...
<generate-with class="com.gwt.rebind.MenuGenerator">
<when-type-assignable class="com.gwt.client.MenuMaker" />
</generate-with>
...
All work perfectly when I run compile in DevMode but when I "Build the project with the GWT compiler" I get this error:
[ERROR] Line 15: Failed to resolve 'com.gwt.client.MenuMaker' via deferred binding
Scanning for additional dependencies: jar:file:/C:/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080121-rel-r42/gwt-2.4.0/gwt-user.jar!/com/google/gwt/dom/client/DOMImpl.java
[WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
[WARN] com.gwt.client.MenuMakerGen
[ERROR] Cannot proceed due to previous errors
At the end of com.gwt.rebind.MenuGenerator:
sourceWriter.commit(logger);
Check if all your client classes have default, zero-parameter constructor. I had the same "deferred binding" issue, and it turned out that one of my classes hadn't had default constructor. It was strange, because this class wasn't even mentioned in GWT compiler log.
Check for gwt-compile problems. The message
[ERROR] Line 15: Failed to resolve '...' via deferred binding
can result from compile problems in your gwt code. In my case it was a class, which was only available on the server side of the application, but was referenced in a class belonging to 'shared' part of the application.
In Java it compiled well, so I had no error in eclipse. The above error-message only showed up when building it with maven. Still it remained somewhat difficult to find the real problem, as the message text was not very helpful.
It turned out, that running the app on com.google.gwt.dev.DevMode would produce a more detailed logfile of the gwt-compilation (probably one could configure maven to do the same?).
Right at the beginning of this more detailed log, there were entries, which pointed me to the problem described above. After correcting these problems, the "Failed to resolve ... via deferred binding"-error was gone.
Check your model/ Pojo Class should implements Serializable
interface and also
Class have default constructor(No argument constructor).
In my case, some of the model classes were not implementing com.google.gwt.user.client.rpc.IsSerializable, that's why I got the error mentioned in the question.
In my case, a key in Resource Bundle properties file which corresponds the method name was missing and the problem resolved after adding it.

Log4j email error "Cannot find java.home ??"

I'm using log4j under J2SE. I've configured it to use a mailer for a certain type of log event.. When the logger.error triggers I get the following exception:
java.lang.Error: Can't find java.home ??
at sun.net.NetProperties.loadDefaultProperties(NetProperties.java:45)
...
at org.apache.log4j.net.SMTPAppender.sendBuffer(SMTPAppender.java:416)
Anyone run into this before? I have the required mail.jar library included as well.
Any help is appreciated.
Thanks,
Chris
I looked at the source code of NetProperties and the error basically means what it says. The System property called "java.home" is unset. According to the javadoc for System.getProperties(), that property is set automatically by the JVM to the java installation directory.
The only explanation I can think of is that something in your application or some third-party library you are using has explicitly unset that property. That is obviously a bad thing to do ...