Я застрял на этом. Мой MacBookPro сломался, и я переустанавливаю проект в Windows. Я установил Java & Maven. С mvn -version:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Software\apache-maven-3.6.3\bin\..
Java version: 13.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-13.0.2
Default locale: es_ES, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Он работал на моем MacBookPro и работает на ноутбуках коллег linux & windows. По окончании компиляции эта ошибка отображается в большинстве классов с перечислениями:
2020-03-17 00:20:45,248 INFO [CommonsLogger.java:46] : Setting autowire strategy to name
2020-03-17 00:20:45,250 INFO [CommonsLogger.java:46] : ... initialized Struts-Spring integration successfully
2020-03-17 00:20:45,709 ERROR [CommonsLogger.java:42] : Unable to read class [es.ubiqua.compareme.actions.CmprmInitGetScreenCodeAction$EnumCondition]
java.lang.ArrayIndexOutOfBoundsException: Index 2560 out of bounds for length 188
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.opensymphony.xwork2.util.finder.DefaultClassFinder.readClassDef(DefaultClassFinder.java:473)
at com.opensymphony.xwork2.util.finder.DefaultClassFinder.access$200(DefaultClassFinder.java:54)
at com.opensymphony.xwork2.util.finder.DefaultClassFinder$InfoBuildingVisitor.extractSuperInterfaces(DefaultClassFinder.java:526)
at com.opensymphony.xwork2.util.finder.DefaultClassFinder$InfoBuildingVisitor.visit(DefaultClassFinder.java:513)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.opensymphony.xwork2.util.finder.DefaultClassFinder.readClassDef(DefaultClassFinder.java:473)
at com.opensymphony.xwork2.util.finder.DefaultClassFinder.<init>(DefaultClassFinder.java:96)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildClassFinder(PackageBasedActionConfigBuilder.java:416)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:397)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:354)
at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:274)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:56)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
2020-03-17 00:20:45,784 ERROR [CommonsLogger.java:42] : Unable to read class [es.ubiqua.compareme.actions.CmprmInitGetScreenCodeAction$EnumType]
java.lang.ArrayIndexOutOfBoundsException: Index 2560 out of bounds for length 188
Ошибка java "java .lang.ArrayIndexOutOfBoundsException: индекс 2560 вне границ для длины 188" равен сбивает с толку при компиляции. Он показывает те же цифры для всех ошибок других классов.
Я пытался явно импортировать, установить как stati c, изменить ссылки на перечисления со всеми путями пакета, удалить все ссылки на массивы внутри enum, поместите перечисления в указанные c файлы ...
Мой код:
package es.ubiqua.compareme.actions;
import es.ubiqua.compareme.application.ScreenSetup.ListScreenSetup;
import es.ubiqua.compareme.domain.Entity.Customer.CustomerEntity;
import es.ubiqua.compareme.domain.Entity.ScreenSetup.ScreenSetupEntity;
import es.ubiqua.compareme.domain.Exception.RepositoryException;
import es.ubiqua.compareme.infrastructure.MariaDbEntity.Customer.CustomerMariaDb;
import es.ubiqua.compareme.infrastructure.MariaDbEntity.ScreenSetup.ScreenSetupMariaDb;
import org.apache.struts2.ServletActionContext;
import javax.servlet.http.HttpServletRequest;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
public class CmprmInitGetScreenCodeAction extends CmprmAction
{
//Request Parameters
private int idCustomer;
private String url;
private int idScreen;
//Response
private ScreenSetupEntity screen;
//Enums
public enum EnumCondition
{
None(0),
Equals(1),
StartWith(2),
Contains(3),
MatchesRegEx(4);
private int value;
private EnumCondition(int value) {
this.value = value;
}
private static EnumCondition[] allValues = values();
public static EnumCondition fromOrdinal(int n) {return allValues[n];}
public int getValue() {
return value;
}
//Get the String Name of an EnumState
public String toString()
{
return this.name();
}
public static String[] names() {
return Arrays.toString(EnumCondition.values()).replaceAll("^.|.$", "").split(", ");
}
}
public String execute()
{
HttpServletRequest request = ServletActionContext.getRequest();
try
{
...