【问题标题】:Debug doesn't start on Eclipse调试未在 Eclipse 上启动
【发布时间】:2021-09-21 15:30:24
【问题描述】:

当我尝试在 Eclipse 上启动调试时,它没有启动。 我没有断点,日志是:

2021-07-12 12:19:41 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path resource [spring-conf.xml]
2021-07-12 12:19:41 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path resource [hibernate-conf.xml]
2021-07-12 12:19:42 INFO  GenericApplicationContext:513 - Refreshing org.springframework.context.support.GenericApplicationContext@4c163e3: startup date [Mon Jul 12 12:19:42 CEST 2021]; root of context hierarchy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$2 (file:xxx/.m2/repository/org/springframework/spring-core/4.0.0.RELEASE/spring-core-4.0.0.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-07-12 12:19:43 INFO  PropertyPlaceholderConfigurer:172 - Loading properties file from class path resource [data-source.properties]
2021-07-12 12:19:43 INFO  PropertyPlaceholderConfigurer:172 - Loading properties file from class path resource [service-config.properties]
2021-07-12 12:19:43 INFO  AutowiredAnnotationBeanPostProcessor:141 - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2021-07-12 12:19:43 INFO  MLog:92 - MLog clients using log4j logging.
2021-07-12 12:19:43 INFO  C3P0Registry:216 - Initializing c3p0-0.9.2.1 [built 20-March-2013 10:47:27 +0000; debug? true; trace: 10]
2021-07-12 12:19:44 INFO  Version:66 - HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
2021-07-12 12:19:44 INFO  Version:54 - HHH000412: Hibernate Core {4.3.6.Final}
2021-07-12 12:19:44 INFO  Environment:239 - HHH000206: hibernate.properties not found
2021-07-12 12:19:44 INFO  Environment:346 - HHH000021: Bytecode provider name : javassist
2021-07-12 12:19:44 INFO  AbstractPoolBackedDataSource:522 - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeks3ai16sk2vzyz2gu8|3d6300e8, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeks3ai16sk2vzyz2gu8|3d6300e8, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://xxx:3306/db?autoReconnect=true&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&serverTimezone=Europe/Rome, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, numHelperThreads -> 3, preferredTestQuery -> SELECT 1, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> true, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
INFO  Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect

然后什么都没有发生,没有错误

如果我运行而不是调试,则在“INFO Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect”之后我看到:

2021-07-12 14:50:10 INFO  LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2021-07-12 14:50:11 INFO  TransactionFactoryInitiator:62 - HHH000399: Using default transaction strategy (direct JDBC transactions)
2021-07-12 14:50:11 INFO  ASTQueryTranslatorFactory:47 - HHH000397: Using ASTQueryTranslatorFactory
2021-07-12 14:50:11 INFO  Version:27 - HV000001: Hibernate Validator 5.1.3.Final
2021-07-12 14:50:13 INFO  SpringResourceLoader:91 - SpringResourceLoader for Velocity: using resource loader [org.springframework.context.support.GenericApplicationContext@649bec2e: startup date [Mon Jul 12 14:50:08 CEST 2021]; root of context hierarchy] and resource loader paths [classpath:email/, classpath:html/, classpath:zpl/]
2021-07-12 14:50:13 INFO  ThreadPoolTaskExecutor:165 - Initializing ExecutorService  'taskExecutor'
log4j:ERROR No output stream or file set for the appender named [marketplace-orders].
2021-07-12 14:50:18 INFO  HibernateTransactionManager:341 - Using DataSource [com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeks3ai16xxjo05x98f8|64337702, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeks3ai16xxjo05x98f8|64337702, idleConnectionTestPeriod -> 60, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://xxx:3306/db?autoReconnect=true&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&serverTimezone=Europe/Rome, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, numHelperThreads -> 3, preferredTestQuery -> SELECT 1, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> true, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]] of Hibernate SessionFactory for HibernateTransactionManager
2021-07-12 14:50:18 INFO  TransactionalTestExecutionListener:276 - Began transaction (1): transaction manager [org.springframework.orm.hibernate4.HibernateTransactionManager@7603cfc2]; rollback [false]
Hibernate: select ...
2021-07-12 14:50:19 INFO  GenericApplicationContext:873 - Closing org.springframework.context.support.GenericApplicationContext@649bec2e: startup date [Mon Jul 12 14:50:08 CEST 2021]; root of context hierarchy
2021-07-12 14:50:19 INFO  ThreadPoolTaskExecutor:203 - Shutting down ExecutorService 'taskExecutor'

我已经尝试取消eclipse项目文件并再次导入项目但没有成功。

感谢您的帮助

我使用 java 11 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>11</jdk.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.googlecode.htmlcompressor</groupId>
            <artifactId>htmlcompressor</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-support</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-c3p0</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency> 
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>apache-log4j-extras</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>com.braintreepayments.gateway</groupId>
            <artifactId>braintree-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-email</artifactId>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
        </dependency>

        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>nimbus-jose-jwt</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.amazonaws.mws</groupId>
            <artifactId>amazon-mws-orders</artifactId>
            <scope>system</scope>
            <systemPath>${project.basedir}/../../lib/MWSOrders_2013-09-01_v2020-10-20.jar</systemPath>
        </dependency>
        
        <dependency>
            <groupId>com.amazonaws.mws</groupId>
            <artifactId>amazon-mws-client</artifactId>
            <scope>system</scope>
            <systemPath>${project.basedir}/../../lib/MWSClientJavaRuntime-1.0.jar</systemPath>
        </dependency>
 
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-cache</artifactId>
        </dependency>
                    
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
                    
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-osgi</artifactId>
        </dependency>
            
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
        </dependency>
                                        
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore-nio</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore-osgi</artifactId>
        </dependency>
            
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
        </dependency>
         
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
        </dependency>
         
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>io</artifactId>
        </dependency>
        
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>layout</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
        </dependency>
        
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.coderplus.maven.plugins</groupId>
                <artifactId>copy-rename-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <sourceFile>${project.build.directory}/classes/environment/service-config.${build.env}.properties</sourceFile>
                                    <destinationFile>${project.build.directory}/classes/service-config.properties</destinationFile>
                                </fileSet>
                                <fileSet>
                                    <sourceFile>${project.build.directory}/classes/environment/log4j.${build.env}.xml</sourceFile>
                                    <destinationFile>${project.build.directory}/classes/log4j.xml</destinationFile>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>/environment/</exclude>
                    </excludes>
                </configuration>
            </plugin>
            
        </plugins>
    </build>

</project>

在运行而不是调试时也会出现“发生非法反射访问操作”错误,而“运行”我没有问题

howlger 你在哪里找到了对 java 16 的引用?

【问题讨论】:

  • 您的依赖项似乎有问题。你能给我们你的依赖 pom.xml 或 gradle 吗? stackoverflow.com/questions/4588755/…
  • An illegal reflective access operation has occurred 听起来您使用 Java 16 运行它,并且您的代码或/和某些依赖项还没有为 Java 16 准备好。添加 VM 参数 --illegal-access=permit 是否有效?请改进您的问题。目前没有代码(Java?、pom.xml?等),没有说明如何重现问题,...
  • 我添加了 pom.谢谢
  • 在 Maven 运行/启动配置中,您选择了哪个 Java JRE(在 JRE 选项卡中)来运行构建? Console 视图的标题行中显示什么?
  • 我不确定在哪里可以查看嚎叫。哪个是确切的菜单?如果我单击项目首选项,我会看到 Maven 菜单,但我没有 jre 选项卡。当我在调试模式下启动tomcat时出现问题

标签: eclipse debugging


【解决方案1】:

我解决了Eclipsetomcat启动配置中更改jdk版本的问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-08
    • 2012-12-11
    • 2020-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多