Tag Archives: error

[Solved] ERROR org.apache.struts2.dispatcher.Dispatcher – Dispatcher initialization failed

Problem description
the newly created eclipse project cannot run JSP

the console reports an error, as shown in the figure

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
09:04:55.281 [localhost-startStop-1] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed
com.opensymphony.xwork2.config.ConfigurationException: Unable to load configuration.
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) ~[xwork-core-2.3.37.jar:2.3.37]
	at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978) ~[struts2-core-2.3.37.jar:2.3.37]
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446) ~[struts2-core-2.3.37.jar:2.3.37]
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490) [struts2-core-2.3.37.jar:2.3.37]
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74) [struts2-core-2.3.37.jar:2.3.37]
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57) [struts2-core-2.3.37.jar:2.3.37]
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281) [catalina.jar:7.0.107]
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262) [catalina.jar:7.0.107]
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:106) [catalina.jar:7.0.107]
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4973) [catalina.jar:7.0.107]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5672) [catalina.jar:7.0.107]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:7.0.107]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1689) [catalina.jar:7.0.107]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1679) [catalina.jar:7.0.107]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_51]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_51]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_51]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_51]
Caused by: com.opensymphony.xwork2.config.ConfigurationException: Action class [Action.complexAction] not found
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:486) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:429) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:556) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295) ~[xwork-core-2.3.37.jar:2.3.37]
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) ~[struts2-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) ~[xwork-core-2.3.37.jar:2.3.37]
	... 17 more
十月 22, 2021 9:04:55 上午 org.apache.catalina.core.StandardContext filterStart
Severe: Start filter exception
Unable to load configuration. - action - file:/F:/JavaEE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Week7/WEB-INF/classes/struts.xml:14:64
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:504)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:106)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4973)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5672)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1689)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1679)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load configuration. - action - file:/F:/JavaEE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Week7/WEB-INF/classes/struts.xml:14:64
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
	at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
	... 14 more
Caused by: Action class [Action.complexAction] not found - action - file:/F:/JavaEE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Week7/WEB-INF/classes/struts.xml:14:64
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:486)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:429)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:556)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295)
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
	... 17 more

There are many solutions to online search, such as jar package conflict in Tomcat and reinstalling tomcat, but other projects can still run before, so there is no blind operation. Some things still need to see the essence. In fact, where the problem appears has been prompted.

Caused by: com.opensymphony.xwork2.config.ConfigurationException: Action class [Action.complexAction] not found
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:486) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:429) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:556) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295) ~[xwork-core-2.3.37.jar:2.3.37]
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) ~[struts2-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264) ~[xwork-core-2.3.37.jar:2.3.37]
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) ~[xwork-core-2.3.37.jar:2.3.37]

Yes, complexaction was not found in the action configuration
there is a problem with the action configuration in the struts.xml file. If you also encounter this problem, first see if there is a problem with the configuration file

Successfully resolved error c3861: ‘printf’: identifier not found

Problem Description:

The error is as follows: error c3861: ‘printf’: identifier not found.

resolvent

The prompt indicates that the identifier “printf” cannot be found. I guess this may be caused by the compiler’s failure to include the header file stdio. H. then I wrote a new line #include & lt; stdio.h>, After that, the program will not report an error.

Error reported when debugging Hadoop cluster under windows failed to find winutils.exe

Modify
set Java in/etc/Hadoop/Hadoop env.cmd file_ HOME=%JAVA_ Home%
is (modified to the JDK location configured by your own machine)
set Java_ HOME=C:\Program Files\Java\jdk1.8.0_ 144 check fs.default.name
check whether the attribute value of fs.default.name in/etc/Hadoop/core-site.xml is consistent with that in the server. Inconsistency needs to be changed to consistency. Configure environment variables
Hadoop_ Home and % Hadoop in path_ Home% \ bin configure local hosts
192.168.19.185 Server1
192.168.19.184 server2
192.168.19.199 server3winutils.exe and hadoop.dll in Hadoop/bin directory, hadoop.dll in C: \ window \ system32 directory, and restart the IDE. If an error is still reported, restart the computer

RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at /opt/conda/conda-bld/

problem

RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at /opt/conda/conda-bld/

solve

This problem is likely to be your CUDA number is wrong
for example, the variables you set use GPUs 2 and 3, but in fact you only have two GPUs 0 and 1, which will lead to this error.

Solution to the flash back, error report and unexpected exit of idea MAC windows

First of all, let’s talk about the reason why I have this problem
when I use idea, because I am shy in my pocket, I use improper means to crack idea indefinitely, and then because I am stupid and improper operation, idea exits unexpectedly and can’t enter the flash screen
finally, through repeated search on the Internet, the strength of nine cattle and two tigers was wasted, and finally a solution was found. I share it with you here.

The problem is that it appears in the idea. Vmoptions file. For some cracking, you need to add a path to crack the JRE package in this file. The problem appears here.

So the first solution I think of is to find this file, modify it back, or delete it directly
so I found the idea.vmoptions file in the bin directory of the idea installation directory. Then delete it, and the result still doesn’t work.

Then I tried to uninstall the software and reinstall it with another version, which still didn’t work.

This shows that the idea.vmoptions file under the installation package is not the root of the problem

Because every time we start, the file idea.vmoptions in the installation directory is not loaded
instead, the file under C: \ users \ user name \. Intellijidea2018.1 \ config \ plugins
. Mac is located in users/computer user name/library/preferences/intellijidea2019.3
if not, go to if not, go to: application support/JetBrains/intellijidea2020.1 under library /. After finding it, delete it and start the idea again.

[Solved] Request.url is not modifiable, use Request.replace() instead

Encountered in a scene_ In the redis project, the URL needs to be filtered and de duplicated, so a de duplication class is customized

Simply copy the source code directly, and then rewrite the request_ See, to change the logic, the original direct assignment will report the error of the title

    def request_seen(self, request):
        temp_request = request
        if "ref" in temp_request.url:
            # An error is reported here, you cannot assign a value directly
            temp_request.url = temp_request.url.split("ref")[0]
        fp = self.request_fingerprint(temp_request)
        added = self.server.sadd(self.key, fp)
        return added == 0

Solution:

Use _set_URL (URL) is OK

temp_request._set_url(temp_request.url.split("ref")[0])

The complete code is as follows:

from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from scrapy_redis import get_redis_from_settings
from scrapy_redis import defaults
import logging
import time

logger = logging.getLogger(__name__)


class UrlFilter(BaseDupeFilter):
    logger = logger

    def __init__(self, server, key, debug=False):
        self.server = server
        self.key = key
        self.debug = debug
        self.logdupes = True

    @classmethod
    def from_settings(cls, settings):
        server = get_redis_from_settings(settings)
        # XXX: This creates one-time key. needed to support to use this
        # class as standalone dupefilter with scrapy's default scheduler
        # if scrapy passes spider on open() method this wouldn't be needed
        # TODO: Use SCRAPY_JOB env as default and fallback to timestamp.
        key = defaults.DUPEFILTER_KEY % {'timestamp': int(time.time())}
        debug = settings.getbool('DUPEFILTER_DEBUG')
        return cls(server, key=key, debug=debug)

    @classmethod
    def from_crawler(cls, crawler):
        """Returns instance from crawler.

        Parameters
        ----------
        crawler : scrapy.crawler.Crawler

        Returns
        -------
        RFPDupeFilter
            Instance of RFPDupeFilter.

        """
        return cls.from_settings(crawler.settings)

    def request_seen(self, request):
        temp_request = request
        if "ref" in temp_request.url:
            temp_request._set_url(temp_request.url.split("ref")[0])
        fp = self.request_fingerprint(temp_request)
        added = self.server.sadd(self.key, fp)
        return added == 0

    def request_fingerprint(self, request):
        """Returns a fingerprint for a given request.

        Parameters
        ----------
        request : scrapy.http.Request

        Returns
        -------
        str

        """
        return request_fingerprint(request)

    @classmethod
    def from_spider(cls, spider):
        settings = spider.settings
        server = get_redis_from_settings(settings)
        dupefilter_key = settings.get("SCHEDULER_DUPEFILTER_KEY", defaults.SCHEDULER_DUPEFILTER_KEY)
        key = dupefilter_key % {'spider': spider.name}
        debug = settings.getbool('DUPEFILTER_DEBUG')
        return cls(server, key=key, debug=debug)

    def close(self, reason=''):
        """Delete data on close. Called by Scrapy's scheduler.

        Parameters
        ----------
        reason : str, optional

        """
        self.clear()

    def clear(self):
        """Clears fingerprints data."""
        self.server.delete(self.key)

    def log(self, request, spider):
        """Logs given request.

        Parameters
        ----------
        request : scrapy.http.Request
        spider : scrapy.spiders.Spider

        """
        if self.debug:
            msg = "Filtered duplicate request: %(request)s"
            self.logger.debug(msg, {'request': request}, extra={'spider': spider})
        elif self.logdupes:
            msg = ("Filtered duplicate request %(request)s"
                   " - no more duplicates will be shown"
                   " (see DUPEFILTER_DEBUG to show all duplicates)")
            self.logger.debug(msg, {'request': request}, extra={'spider': spider})
            self.logdupes = False

tar: Error opening archive: Failed to open ‘/Users/xxx/Library/Caches/Homebrew/downloads/348a16e

When installing brew install graphviz, there was a problem with:
tar: Error opening archive: Failed to open ‘/Users/xxx/Library/Caches/Homebrew/downloads/348a16e5fedb24cb14fe4fd5c72caa96074c7b4e21ce4d2f7a89eb4b638c830f–gd-2.3.2.arm64_big_sur.bottle.tar.gz’
Error: Failure while executing; tar --extract --no-same-owner --file /Users/xxx/Library/Caches/Homebrew/downloads/348a16e5fedb24cb14fe4fd5c72caa96074c7b4e21ce4d2f7a89eb4b638c830f--gd-2.3.2.arm64_big_sur.bottle.tar.gz --directory /private/tmp/d20210927-26485-nzi2qo exited with 1. Here’s the output:
tar: Error opening archive: Failed to open ‘/Users/xxx/Library/Caches/Homebrew/downloads/348a16e5fedb24cb14fe4fd5c72caa96074c7b4e21ce4d2f7a89eb4b638c830f–gd-2.3.2.arm64_big_sur.bottle.tar.gz

A closer look reveals that there was a problem installing the dependency at this step: the

So, the solution: install the dependency brew install gd separately

Once done, just install graphviz again, and if the same type of error occurs again during this process, continue installing the dependency where the error occurred.

Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource

The errors encountered in writing as service items today are shown below. I only know that the creation of error creating bean with name ‘servletendpointregistrar’ defined in class path resource failed. I also found some solutions on the Internet. The most common solutions are that there is a lack of JDBC dependency, or that the database configuration file is wrong. I also compared the database, There is no lack of JDBC dependency, which shows that my database and dependency are correct. I compared other service services and found that more configuration files were introduced into the configuration file

[${project.name}] 2021-09-10 23:21:44,213 ERROR [localhost-startStop-1][Jdk14Logger.java:87] - Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.class]: Unsatisfied dependency expressed through method 'servletEndpointRegistrar' parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties': Could not bind properties to 'WebEndpointProperties' : prefix=management.endpoints.web, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'management.endpoints.web.exposure' to org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties$Exposure
[${project.name}] 2021-09-10 23:21:44,240 WARN [main][Jdk14Logger.java:87] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
[${project.name}] 2021-09-10 23:21:44,241 INFO [main][DubboGenericServiceFactory.java:159] - The Dubbo GenericService ReferenceBeans are destroying...
[${project.name}] 2021-09-10 23:21:44,245 INFO [main][Jdk14Logger.java:87] - class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!

My Nacos profile is

#HTTP format configuration spring:
http:
  encoding:
    charset: UTF‐8
    force: true
    enabled: true
  messages:
    encoding: UTF‐8
#tomcat header information (user ip and access protocol) and access path configuration
server:
  tomcat:
    remote_ip_header: x‐forwarded‐for
    protocol_header: x‐forwarded‐proto
  servlet:
    context‐path: /lifly
  use‐forward‐headers: true

#Service monitoring and management configuration, operation and maintenance related
management:
  endpoints:
    web:
      exposure:
      include: refresh,health,info,env

This configuration file defines the user IP and access path, as well as some configuration files related to service monitoring, management and operation and maintenance. However, the remote call is not used in the service, but I introduced this configuration file. The reason for my error is this, so I recorded it
My bootstrap.yml configuration file is as follows:

server:
  port: 56050 
nacos:
  server:
    addr: 127.0.0.1:8848
spring:
  application:
    name: transaction-service
#  main:
#    allow-bean-definition-overriding: true # Spring Boot 2.1 
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
#        server-addr: ${nacos.server.addr}
        namespace: 339eea59-f7f4-44d0-a3fa-9f1f85bd5b4f
#        cluster-name: COMMON_GROUP
      config:
        server-addr: 127.0.0.1:8848
#        server-addr: ${nacos.server.addr} 
        file-extension: yaml
        namespace: 339eea59-f7f4-44d0-a3fa-9f1f85bd5b4f  
        group: DEFAULT_GROUP 
        ext-config:
          -
            refresh: true
            data-id: spring-boot-http.yaml # spring boot http
            group: COMMON_GROUP 
#          -
#            refresh: true
#            data-id: spring-boot-starter-druid.yaml # spring boot starter druid
#            group: COMMON_GROUP 
#          -
#            refresh: true
#            data-id: spring-boot-mybatis-plus.yaml # spring boot mybatisplus
#            group: COMMON_GROUP 
#          - refresh: true
#            data-id: spring-boot-redis.yaml 
#            group: COMMON_GROUP 
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/huiminpay_transaction?useUnicode=true&useSSL=false
    #  url: jdbc:mysql://localhost:3306/huiminpay_merchant_service?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&useUnicode=true
    username: root
    password: 1234
mybatis-plus:
  type-aliases-package: com.huiminpay.transaction.entity
  mapper-locations: classpath:/mapper/*.xml

dubbo:
  scan:
    # dubbo 
    base-packages: com.huiminpay
  protocol:
    # dubbo 协议
    name: dubbo
    port: 20893
  registry:
    address: nacos://127.0.0.1:8848
  application:
    qos:
      port: 22250 # dubbo qos
  consumer:
    check: false
    timeout: 3000
    retries: -1

logging:
  config: classpath:log4j2.xml

I commented out the import file and the project started. Record it again, and I hope it will be helpful to you. Comment out the following import file

 ext-config:
          -
            refresh: true
            data-id: spring-boot-http.yaml # spring boot http set
            group: COMMON_GROUP