XX Can not be resolved to a type 解决办法

本文介绍了解决因项目环境冲突导致的问题的方法。具体步骤包括:通过properties-projectFacets调整运行时环境,移除所有Library,重新添加,并确保仅保留必要的JREClassPath。此外,建议重新配置服务器并移除不必要的Modulepath。

原因:项目环境冲突,一般是两个电脑环境不同导致的

针对我自己的比较熟悉的项目,解决办法如下

0.properties->projectFacets->找到那个Runtimes->选择本地的

1.把所有的Libray删除

2.重新添加

注意:

最好把servcer也重新导入一下

new server的时候在 configure runtime environment中remove不需要的

Libraries中的Modulepath,只保留一个JRE

ClassPath里面放依赖包和Apache

有时候把Apache包放入Modulepath会报错

[root@localhost snort-2.9.20]# /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/snort.conf Using bundled JDK: /usr/share/logstash/jdk OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console [INFO ] 2025-05-15 16:30:36.964 [main] runner - Starting Logstash {"logstash.version"=>"7.17.28", "jruby.version"=>"jruby 9.2.20.1 (2.5.8) 2021-11-30 2a2962fbd1 OpenJDK 64-Bit Server VM 11.0.26+4 on 11.0.26+4 +indy +jit [linux-x86_64]"} [INFO ] 2025-05-15 16:30:36.970 [main] runner - JVM bootstrap flags: [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djdk.io.File.enableADS=true, -Djruby.compile.invokedynamic=true, -Djruby.jit.threshold=0, -Djruby.regexp.interruptible=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true] [INFO ] 2025-05-15 16:30:36.991 [main] settings - Creating directory {:setting=>"path.queue", :path=>"/usr/share/logstash/data/queue"} [INFO ] 2025-05-15 16:30:36.999 [main] settings - Creating directory {:setting=>"path.dead_letter_queue", :path=>"/usr/share/logstash/data/dead_letter_queue"} [WARN ] 2025-05-15 16:30:37.218 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified [INFO ] 2025-05-15 16:30:37.235 [LogStash::Runner] agent - No persistent UUID file found. Generating new UUID {:uuid=>"7704db49-85d8-46bd-8e94-beeaf06a487d", :path=>"/usr/share/logstash/data/uuid"} [INFO ] 2025-05-15 16:30:37.983 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9601, :ssl_enabled=>false} [INFO ] 2025-05-15 16:30:38.724 [Converge PipelineAction::Create<main>] Reflections - Reflections took 60 ms to scan 1 urls, producing 119 keys and 419 values [WARN ] 2025-05-15 16:30:39.248 [Converge PipelineAction::Create<main>] plain - Relying on default value of `pipeline.ecs_compatibility`, which may change in a future major release of Logstash. To avoid unexpected changes when upgrading Logstash, please explicitly declare your desired ECS Compatibility mode. [WARN ] 2025-05-15 16:30:39.278 [Converge PipelineAction::Create<main>] file - Relying on default value of `pipeline.ecs_compatibility`, which may change in a future major release of Logstash. To avoid unexpected changes when upgrading Logstash, please explicitly declare your desired ECS Compatibility mode. [WARN ] 2025-05-15 16:30:39.321 [Converge PipelineAction::Create<main>] csv - Relying on default value of `pipeline.ecs_compatibility`, which may change in a future major release of Logstash. To avoid unexpected changes when upgrading Logstash, please explicitly declare your desired ECS Compatibility mode. [WARN ] 2025-05-15 16:30:39.338 [Converge PipelineAction::Create<main>] plain - Relying on default value of `pipeline.ecs_compatibility`, which may change in a future major release of Logstash. To avoid unexpected changes when upgrading Logstash, please explicitly declare your desired ECS Compatibility mode. [WARN ] 2025-05-15 16:30:39.367 [Converge PipelineAction::Create<main>] elasticsearch - Relying on default value of `pipeline.ecs_compatibility`, which may change in a future major release of Logstash. To avoid unexpected changes when upgrading Logstash, please explicitly declare your desired ECS Compatibility mode. [INFO ] 2025-05-15 16:30:39.412 [[main]-pipeline-manager] elasticsearch - New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["http://localhost:9200"]} [INFO ] 2025-05-15 16:30:39.640 [[main]-pipeline-manager] elasticsearch - Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://localhost:9200/]}} [WARN ] 2025-05-15 16:30:39.804 [[main]-pipeline-manager] elasticsearch - Restored connection to ES instance {:url=>"http://localhost:9200/"} [INFO ] 2025-05-15 16:30:39.814 [[main]-pipeline-manager] elasticsearch - Elasticsearch version determined (7.17.28) {:es_version=>7} [WARN ] 2025-05-15 16:30:39.815 [[main]-pipeline-manager] elasticsearch - Detected a 6.x and above cluster: the `type` event field won't be used to determine the document _type {:es_version=>7} [INFO ] 2025-05-15 16:30:39.865 [Ruby-0-Thread-10: :1] elasticsearch - Config is not compliant with data streams. `data_stream => auto` resolved to `false` [INFO ] 2025-05-15 16:30:39.865 [[main]-pipeline-manager] elasticsearch - Config is not compliant with data streams. `data_stream => auto` resolved to `false` [INFO ] 2025-05-15 16:30:39.900 [Ruby-0-Thread-10: :1] elasticsearch - Using a default mapping template {:es_version=>7, :ecs_compatibility=>:disabled} [INFO ] 2025-05-15 16:30:39.930 [[main]-pipeline-manager] javapipeline - Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>500, "pipeline.sources"=>["/etc/logstash/conf.d/snort.conf"], :thread=>"#<Thread:0x36746cc1 run>"} [INFO ] 2025-05-15 16:30:40.467 [[main]-pipeline-manager] javapipeline - Pipeline Java execution initialization time {"seconds"=>0.54} [INFO ] 2025-05-15 16:30:40.520 [[main]-pipeline-manager] javapipeline - Pipeline started {"pipeline.id"=>"main"} [INFO ] 2025-05-15 16:30:40.542 [[main]<file] observingtail - START, creating Discoverer, Watch with file and sincedb collections [INFO ] 2025-05-15 16:30:40.572 [Agent thread] agent - Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]} 检查命令是否运行成功
最新发布
05-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值