Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script7.groovy: 1: unable to resolve class

I am currently receiving this error when trying to run a soapui file:

org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed: Script7.groovy: 1: unable to resolve class com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate @ line 1, column 1.     
  import com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate
                             ^
org.codehaus.groovy.syntax.SyntaxException: unable to resolve class com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate @ line 1, column 1.
 at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148)  
 at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1206)
 at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148)
 at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:585)
 at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:832)
 at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:519)
 at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:495)
 at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:472)
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:292)
 at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727)
 at groovy.lang.GroovyShell.parse(GroovyShell.java:739)
 at groovy.lang.GroovyShell.parse(GroovyShell.java:766)
 at groovy.lang.GroovyShell.parse(GroovyShell.java:757)
 at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:141)
 at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
 at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
 at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:619)
 1 error

soapUI code:

import com.company.ui.test.SoapUI_T11001_StockConsSecurityCurBusiDate

def env = testRunner.testCase.testSuite.project.getPropertyValue("env")
def baseUrl = testRunner.testCase.testSuite.project.getPropertyValue("baseUrl")

log.info("The baseurl is "+baseUrl)
log.info("The env under test is "+env)

SoapUI_T11001_StockConsSecurityCurBusiDate testStep = new SoapUI_T11001_StockConsSecurityCurBusiDate();
testStep.init(baseUrl);
testStep.execute(null);

eclipse code:

package com.company.ui.test;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import com.eviware.soapui.model.support.AbstractSubmitContext;
import com.eviware.soapui.model.testsuite.TestRunner;

public class SoapUI_T11001_StockConsSecurityCurBusiDate extends BaseSelenium{
   public static void main(final String[] args){
      final SoapUI_T11001_StockConsSecurityCurBusiDate ico = new SoapUI_T11001_StockConsSecurityCurBusiDate();
      try{
         ico.init("https://avncedevn1.nam.nsroot.net:17620/", false);
      }catch(Exception e){
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
      ico.execute(null);
   }
        //...code....
}

how do I solve this error ? I'm not sure what is causing the error.

like image 867
qwer1234 Avatar asked Oct 29 '12 21:10

qwer1234


5 Answers

This work for me:
Press Ctr+Alt+Shift+s
or:
From File menu -> Project Structure -> SDK Location -> JDK location Drop down menu choose:
Embeded JDK c:....\jre
Then ok.

enter image description here

like image 87
مصطفى Avatar answered Nov 20 '22 06:11

مصطفى


If you using android studio and got this error then I solved it changing the Gradle version of the project to the newest version 6.2.1 on the project structure options.

Image Android Studio

like image 36
Arpit Patel Avatar answered Nov 20 '22 05:11

Arpit Patel


One of the possible reasons is that the jdk version is too high. For example, using jdk 16 to build the source code of Apache Kafka throws this error. Using jdk 11 is fine.

like image 11
Wenli Wan Avatar answered Nov 20 '22 07:11

Wenli Wan


bild.gradel file in change clashpath

dependencies {
        classpath "com.android.tools.build:gradle:7.0.1"
       
    }

gradel-wrapper.properties

 distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
like image 3
sarjeet singh Avatar answered Nov 20 '22 05:11

sarjeet singh


If you wanted to make a new project on Android Studio after first install, probably you write your application name including (') sign as called apostrophe.

For Example, I tried to set a name as: "Henry's Game" but apostrophe caused Android Studio to not load because of this mistake:

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

So, just change your application's name, and simply use Latin alphabet languages such as English.

To fix: Go to your Android Project Tree and find Gradle Scripts > settings.gradle > change the name:

rootProject.name='Henry Game'
include ':app'
like image 2
Bay Avatar answered Nov 20 '22 07:11

Bay