Error While Running spark on Eclipse - scala

enter image description here
Getting this error while running spark with scala can anyone suggest how do i solve this issue.

You have not created this as a maven project. What you need to do is delete this project from eclipse. then :
File -> Import -> Maven -> Existing Maven Project -> Select your folder.
This would load your project and include maven dependencies and you would not face errors.

Related

Eclipse - Wrong project name when importing maven project

I'm using eclipse mars and I'm working on a multi modules maven 2 project.
Since now it was always working fine when importing the project into eclispe.
My project structure is like
myproject
|-common
|-dao
|- ...
In each pom the artifact-id is
<artifactId>myproject-common</artifactId>
<artifactId>myproject-dao</artifactId>
...
What I always did till now
retrieve the project from svn
mvn clean install
mvn eclispe:eclipse
in eclipse import > existing project > browse to myproject and it displays the good project names : myproject-common, myproject-dao, ...
But since today the last step gives me the folder name in place of the artifact name : common, dao, ...
And after import, lot of errors saying eg. that Project 'dao' is missing required Java Project: 'myproject-common'
I don't understand. Same version of eclispe,maven and java than few months ago.
And after mvn eclipse:eclispe, the .project file is containing the good name
<projectDescription>
<name>myproject-common</name>
How can I solve that ?
I solved it by changing:
import > existing project
to:
Import -> Maven -> Existing Maven Projects

Error: Could not find or load main class while trying to run spark from eclipse(scala ide 4.3)

i have build the project using sbt and imported into eclipse . while trying to execute from run configuration i cannot find my main class and on running the application its prompted with the following error : could not find the main class.i have installed spark-hadoop version 1.4 and scala version 2.10.6 in the local machine also changed the scala compiler version to 2.10.6 in scala ide . The same error is produced while trying build spark from eclipse using maven . Please advice..
Check if Your main class in on build path.
Project -> Properties -> Java Build Path -> Source tab
If not add appropriate folder(s).
Add the folder where classes are generated to build path -> configure build path -> java build path -> source -> "Default Output Folder" text box.
Check if you have .scala files included in compilation path.
Even if you have the source folder included, it may be possible that .scala files are not being picked up.
The following might help, I was facing the same issue and it solved the problem for me:
build path -> configure build path -> java build path -> source -> add **/*.scala in the Included section.

Cannot import existing Maven projects - Broadleaf

I'm trying to setup Broadleaf in my local machine, I'm following the getting started guide and I'm having an error on the step when I import existing Maven projects in eclipse Juno, I get the following error
An internal error occurred during: "Importing Maven projects".
org.eclipse.wst.common.componentcore.internal.impl.ReferencedComponentXMIResourceImpl cannot be cast to org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource
I tried to Google it but the only info I could get was this but wasn't helpful
Update Maven project internal error - ReferencedComponentXMIResourceImpl cannot be cast to JptXmlResource
Please help.
I got a work around. I Downloaded Eclipse Luna, then I ran mvn compile on the root pom from terminal, then I went back to eclipse to import existing Maven projects. Worked like a charm.
There is a solution posted to solve this cast exception in Eclipse Juno,
post here: Update Maven project internal error - ReferencedComponentXMIResourceImpl cannot be cast to JptXmlResource
by disabling the JPA Configurator in eclipse preferences,
Preferences -> Maven -> Java EE Integration -> Select active Java EE configurators -> disable 'JPA Configurator'
It worked for me. Hope it works for you.
Inside Maven Parents Folder in Package Explorer, goto DemoSite - > Right Click -> Maven -> Update Project. Then Import the project. Will work fine.

Maven Error While updating Dependencies

I have a maven project in which i am getting the following error. I am using eclipse IDE
An internal error occurred during: "Importing Maven projects".
Unsupported IClasspathEntry kind=4
I have followed below steps for resolving this error. The reason for this error is class path file located in your project folder.
Disable Maven Nature for your project ( If in eclipse, right click on the project --> Maven --> Disable Maven Nature).
Delete the class path file in your project folder.
Re- enable the Maven Nature Again (right click on project --> configure --> Convert to Maven Project).
Try to Maven clean, install and Run the project.
Here's a better answer: stop using eclipse.
Here's the eclipse bug page:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394042
They seem to have no interest in fixing this issue, so if you require|prefer to use the command line for projects, then really there is no fix but to quit eclipse.

Error creating junit in groovy project

I just downloaded groovy plugin for eclipse4.2 from http://dist.springsource.org/release/GRECLIPSE/e4.2/ .I don't have any other installation/ library for groovy on my system. I am able to run groovy programs on my machine in eclipse.
However when I try to import org.junit.Test, I get following error.
Groovy:class org.junit.Test is not an annotation in #org.junit.Test
Groovy:unable to resolve class org.junit.Test
Can anyone tell me what might be the issue?
You must add the JUnit jars to your classpath. Select a Project -> Build Path -> Configure build path... -> Librarires -> Add library -> JUnit -> Next -> JUnit 4 -> OK.