开发app时遇到"Source not found"的错误

我今天在做一个app,但是我好想不能找到代码中的错误。
当我检查的时候,没有语法错误,但是当我想要运行或者是测试的时候,就会报错:
"Source not found" on "ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2106`

它让我找另外一个路径,但是只有一个可用的默认设置。我代码错了吗?怎么解决?

这是logcat:

12-20 22:12:29.722: I/System.out(1518): debugger has settled (1479) 
12-20 22:12:30.172: W/Trace(1518): Unexpected value from nativeGetEnabledTags: 0 
12-20 22:12:30.222: W/Trace(1518): Unexpected value from nativeGetEnabledTags: 0

这个是控制台报的错误:

[2012-12-20 17:19:45 - rockPaperScissorLizardSpock] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.rockpaperscissorlizardspock/.MainActivity }
[2012-12-20 17:19:45 - rockPaperScissorLizardSpock] ActivityManager: Warning: Activity not started, its current task has been brought to the front

这是我源文件:

package com.example.rockpaperscissorlizardspock;
import java.util.Random;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
import android.view.View.OnClickListener;

public class rockpaperscissorlizardspock extends Activity {
    /**当activity第一次创建的时候调用 */

    private TextView resultText;
    private Button play, reset;
    private ImageButton scissors, paper, rock, lizard, spock;
    private int paperimg, paper_pressedimg, scissorsimg, scissors_pressedimg,     rockimg, rock_pressedimg, lizardimg, lizard_pressedimg, spockimg, spock_pressedimg;
        private ImageView compSciss, compPaper, compRock, compLiz, compSpock;
    Random rand = new Random();
    int compChoice = 0;
    String pChoice ="";
    String cChoice = "";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Initialize();
    }

    /** 初始化所有的组件*/
     private void Initialize()
    {
        play = (Button) findViewById(R.id.button1);
        reset = (Button) findViewById(R.id.button2);
        resultText = (TextView) findViewById(R.id.resultText);
        lizard = (ImageButton) findViewById(R.id.imageButton4);
        spock = (ImageButton) findViewById(R.id.imageButton5);
        scissors = (ImageButton) findViewById(R.id.imageButton3);
        paper = (ImageButton) findViewById(R.id.imageButton2);
        rock = (ImageButton) findViewById(R.id.imageButton1);
        compSciss = (ImageView) findViewById(R.id.computerScissors);
        compPaper = (ImageView) findViewById(R.id.computerPaper);
        compRock = (ImageView) findViewById(R.id.computerRock);
        spockimg = R.raw.spock;
        spock_pressedimg = R.raw.spock_pressed;
        lizardimg = R.raw.lizard;
        lizard_pressedimg = R.raw.lizard_pressed;
        paperimg = R.raw.paper;
        paper_pressedimg = R.raw.paper_pressed;
        scissorsimg = R.raw.scissors;
        scissors_pressedimg = R.raw.scissors_pressed;
        rockimg = R.raw.rock1;
        rock_pressedimg = R.raw.rock1_pressed;

        /**设置按钮 Listeners*/
        play.setOnClickListener(new OnClickListener(){
            public void onClick(View arg0){
                play();
            }
        });

        reset.setOnClickListener(new OnClickListener(){
             public void onClick(View arg0){
                paper.setImageResource(paperimg);

                 rock.setImageResource(rockimg);
                scissors.setImageResource(scissorsimg);
                lizard.setImageResource(lizardimg);
                spock.setImageResource(spockimg);
                compPaper.setImageResource(paperimg);
                compRock.setImageResource(rockimg);
                compSciss.setImageResource(scissorsimg);
                compLiz.setImageResource(lizardimg);
                compSpock.setImageResource    (spockimg);               
                pChoice = "";
                cChoice = "";
                play.setEnabled(false);
                reset.setEnabled(true);
                scissors.setEnabled(true);
                paper.setEnabled(true);
                rock.setEnabled(true);
                lizard.setEnabled(true);
                spock.setEnabled(true);
                resultText.setText("");
            }
        });

        /*
         * 当特殊的选择做出的时候声明
         */

        scissors.setOnClickListener(new OnClickListener(){
             public void onClick(View arg0){    
                     scissors.setImageResource(scissors_pressedimg);
                    paper.setImageResource(paperimg);
                    rock.setImageResource(rockimg);
                    spock.setImageResource(spockimg);
                    lizard.setImageResource(lizardimg);
                    pChoice = "S";
                    play.setEnabled(true);
             }
         });

         paper.setOnClickListener(new OnClickListener(){
            public void onClick(View arg0){
                    paper.setImageResource(paper_pressedimg);
                    scissors.setImageResource(scissorsimg);
                    spock.setImageResource(spockimg);
                    rock.setImageResource(rockimg);
                    lizard.setImageResource(lizardimg);
                    pChoice = "P";
                    play.setEnabled(true);
            }
         });

        rock.setOnClickListener(new OnClickListener(){
            public void onClick(View arg0){
                rock.setImageResource(rock_pressedimg);
                scissors.setImageResource(scissorsimg);
                paper.setImageResource(paperimg);
                spock.setImageResource(spockimg);
                lizard.setImageResource(lizardimg);
                pChoice = "R";
                play.setEnabled(true);
            }
        });

        lizard.setOnClickListener(new OnClickListener(){
             public void onClick(View arg0){
                 lizard.setImageResource(lizard_pressedimg);
                 spock.setImageResource(spockimg);
                 rock.setImageResource(rockimg);
                 scissors.setImageResource(scissorsimg);
                 paper.setImageResource(paperimg);
                 pChoice = "L";
                 play.setEnabled(true);
            }
         });

        spock.setOnClickListener(new OnClickListener(){
            public void onClick(View arg0){
                spock.setImageResource(spock_pressedimg);
                lizard.setImageResource(lizardimg);
                rock.setImageResource(rockimg);
                scissors.setImageResource(scissorsimg);
                paper.setImageResource(paperimg);
                pChoice = "SP";
                play.setEnabled(true);
            }
        });

    }

    /**这个方法是对电脑的移动和player的移动做出选择
     *  
     */
    public void play()
    {
        compChoice = rand.nextInt(5);

        if(compChoice == 0)
        {
            cChoice = "R";
            compRock.setImageResource(rock_pressedimg);
            }
        else if(compChoice == 1){
            cChoice = "P";
            compPaper.setImageResource(paper_pressedimg);
        }       
         else if(compChoice == 2)
        {
            cChoice = "S";
            compSciss.setImageResource(scissors_pressedimg);
            }
        else if(compChoice == 3)
           {
            cChoice = "L";
             compLiz.setImageResource(lizard_pressedimg);
            }
        else if(compChoice == 4)
       { 
       cChoice = "SP";
       compSpock.setImageResource(spock_pressedimg);
       }

    check();
}

/**
 * 比较电脑和player的移动
 */
public void check()
{
    if(pChoice == "R") //Rock
    {
        if(cChoice == "R")
            resultText.setText("Draw");

        else if(cChoice == "P")
            resultText.setText("You Lose");

        else if(cChoice == "S")
            resultText.setText("You Win");

        else if(cChoice == "L")
            resultText.setText("You Win");

        else if(cChoice == "SP")
            resultText.setText("You Lose");
    }

    else if(pChoice == "P") //Paper
    {
        if(cChoice == "R")
            resultText.setText("You Win");

        else if(cChoice == "P")
            resultText.setText("Draw");

        else if(cChoice == "S")
            resultText.setText("You Lose");

        else if(cChoice == "SP")
            resultText.setText("You Win");

        else if(cChoice == "L")
            resultText.setText("You Lose");


    }

    else if(pChoice == "S") //Scissors
    {
        if(cChoice == "R")
            resultText.setText("You Lose");

        else if(cChoice == "P")
            resultText.setText("You Win");

        else if(cChoice == "S")
            resultText.setText("Draw");

        else if(cChoice == "L")
            resultText.setText("You Win");

        else if(cChoice == "SP")
            resultText.setText("You Lose");


    }

    else if(pChoice == "L") //Lizard
    {
      if(cChoice == "R")
        resultText.setText("You Lose");

      else if(cChoice == "L")
        resultText.setText("Draw");

      else if(cChoice == "SP")
        resultText.setText("You Win");

      else if(cChoice == "S")
        resultText.setText("You Lose");

      else if(cChoice == "P")
        resultText.setText("You Win");
    }

    else if(pChoice == "SP") //Spock
    {
        if(cChoice == "SP")
            resultText.setText("Draw");

        else if(cChoice == "L")
            resultText.setText("You Lose");

        else if(cChoice == "S")
            resultText.setText("You Win");

        else if(cChoice == "P")
            resultText.setText("You Lose");

        else if(cChoice == "R")
            resultText.setText("You Win");

    }

    gameOver();
}


/**
 * 在每次round后运行,除了reset按钮禁用所有按钮
 * 
 */
public void gameOver()
{
    play.setEnabled(false);
    scissors.setEnabled(false);
    rock.setEnabled(false);
    paper.setEnabled(false);
    spock.setEnabled(false);
    lizard.setEnabled(false);
    reset.setEnabled(true);
}

1个回答

看起来好像你需要给你的AndroidManifest.xml加activity。看起来应该是这样,被定位在app的部分manifest中。详细的你可以看看这个http://developer.android.com/guide/topics/manifest/manifest-intro.html
这个是一个例子:

<activity
    android:name=".rockpaperscissorlizardspock"
    android:label="@string/app_name"
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
xiaoxiaoaishang
xiaoxiaoaishang 谢谢!
7 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Android 调用 wsdl ,在ht.call 出现 source not found
调试出现 在 ht.call 出现source not found,实在搞不懂了,麻烦帮看下 android 代码: import android.os.Bundle; import android.app.Activity; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import java.io.IOException; import android.view.View; import android.widget.Button; import org.ksoap2.transport.HttpTransportSE; import org.xmlpull.v1.XmlPullParserException; import android.view.View.OnClickListener; import android.widget.TextView; public class MainActivity extends Activity { private Button btnGet; private TextView textview; final static String SERVICE_NS="http://services.safe/"; final static String SERVICE_URL="http://jandy-ms-7673:8080/SafeShopServices/UserNamePort"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnGet=(Button)findViewById(R.id.btnGet); textview=(TextView)findViewById(R.id.textview); btnGet.setOnClickListener(new GetName()); } private class GetName implements OnClickListener{ public void onClick(View v) { String methodName="getuserName"; HttpTransportSE ht = new HttpTransportSE(SERVICE_URL); ht.debug=true; SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); SoapObject soop = new SoapObject(SERVICE_NS,methodName); soop.addProperty(null); envelope.bodyOut=soop; try { ht.call(null,envelope); if(envelope.getResponse()!=null) { textview.setText("123"); } else textview.setText("fuck"); } catch(IOException e) { e.printStackTrace(); } catch(XmlPullParserException e) { e.printStackTrace(); } } } } wsdl xml: <!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-hudson-390-. --> <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-hudson-390-. --> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://services.safe/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="UserNameService" targetNamespace="http://services.safe/"> <types> <xsd:schema> <xsd:import namespace="http://services.safe/" schemaLocation="http://jandy-ms-7673:8080/SafeShopServices/UserNamePort?xsd=1"/> </xsd:schema> </types> <message name="getusername"> <part element="tns:getusername" name="parameters"/> </message> <message name="getusernameResponse"> <part element="tns:getusernameResponse" name="parameters"/> </message> <portType name="UserNameDelegate"> <operation name="getusername"> <input message="tns:getusername"/> <output message="tns:getusernameResponse"/> </operation> </portType> <binding name="UserNamePortBinding" type="tns:UserNameDelegate"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getusername"> <soap:operation soapAction=""/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="UserNameService"> <port binding="tns:UserNamePortBinding" name="UserNamePort"> <soap:address location="http://jandy-ms-7673:8080/SafeShopServices/UserNamePort"/> </port> </service> </definitions>
nginx 400错误,哪位大佬救救我
nginx配置信息 ``` user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; client_header_buffer_size 128k; large_client_header_buffers 4 128k; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/*.conf; upstream app_server { # for UNIX domain socket setups server unix:/webapps/learning_log/gunicorn.sock fail_timeout=0; } server { charset utf-8; listen 80; server_name www.xxxxxxxxxxxx.tk; # 日志 access_log /webapps/learning_log/logs/nginx.access.log; error_log /webapps/learning_log/logs/nginx.error.log; # 不记录访问不到 favicon.ico 的报错日志 location = /favicon.ico { access_log off; log_not_found off; } # static 和 media 的地址 location /static {#注意!!!:static后面不能有/斜杠,否则会导致静态文件404 alias /webapps/learning_log/static; } location /media { alias /webapps/learning_log/media; } location / { proxy_pass http://app_server; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { listen 80; server_name xxxxxxxxxxxx.tk; rewrite ^(.*) http://www.xxxxxxxxxxxx.tk$1 permanent; } ``` gunicorn运行正常 nginx_error.log ``` 2020/03/31 14:40:12 [crit] 90216#90216: *2 connect() to unix:/webapps/learning_log/gunicorn.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.229.1, server: www.perry-in-the-sky.tk, request: "GET / HTTP/1.1", upstream: "http://unix:/webapps/learning_log/gunicorn.sock:/", host: "www.perry-in-the-sky.tk" ```
react"^16.8.6" creacte-react-app@3.0.1脚手架npm run eject 问题?
请问 ,我npm run eject 后,config文件夹下怎么只有一个webpack.config.js文件? 我看教程和其他文章都写的是有2个文件的,一个是webpack.config.dev.js 开发环境下的配置项,另一个是webpack.config.prod.js 生产环境下的配置项. 如果这是由于更新后的正常现象,那么请问怎么添加less配置代码? 另外,执行npm run eject 暴露配置文件后, 执行npm run start 就一直报错, 缺少几种loader. 按照错误提示安装'@babel/plugin-transform-react-jsx-source' 后,又找不到is-wsl. 安装了is-wsl 又再次提示找不到 @babel/plugin-transform-react-jsx-source. 最后重新 npm install ,在执行 npm run start 还是不能成功编译.提示错误: Starting the development server... Failed to compile. ./node_modules/react-dev-utils/formatWebpackMessages.js Module not found: Can't resolve 'F:\react-test\my-app\node_modules\babel-preset-react-app\node_modules\@babel\runtime/helper s/slicedToArray' in 'F:\react-test\my-app\node_modules\react-dev-utils' Compiling... Failed to compile. ./node_modules/react-dev-utils/formatWebpackMessages.js Module not found: Can't resolve 'F:\react-test\my-app\node_modules\babel-preset-react-app\node_modules\@babel\runtime/helper s/slicedToArray' in 'F:\react-test\my-app\node_modules\react-dev-utils' Compiling... Failed to compile. ./node_modules/react-dev-utils/formatWebpackMessages.js Module not found: Can't resolve 'F:\react-test\my-app\node_modules\babel-preset-react-app\node_modules\@babel\runtime/helper s/slicedToArray' in 'F:\react-test\my-app\node_modules\react-dev-utils' 请帮我看看怎么解决这几个问题?
ubantu16 安装opencv3.2 在 cmake时出项很多问题
FP16: Feature disabled -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") -- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one. Could not find a package configuration file provided by "Qt5Core" with any of the following names: Qt5CoreConfig.cmake qt5core-config.cmake Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package): By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Gui", but CMake did not find one. Could not find a package configuration file provided by "Qt5Gui" with any of the following names: Qt5GuiConfig.cmake qt5gui-config.cmake Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set "Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package): By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Widgets", but CMake did not find one. Could not find a package configuration file provided by "Qt5Widgets" with any of the following names: Qt5WidgetsConfig.cmake qt5widgets-config.cmake Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package): By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Test", but CMake did not find one. Could not find a package configuration file provided by "Qt5Test" with any of the following names: Qt5TestConfig.cmake qt5test-config.cmake Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set "Qt5Test_DIR" to a directory containing one of the above files. If "Qt5Test" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package): By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Concurrent", but CMake did not find one. Could not find a package configuration file provided by "Qt5Concurrent" with any of the following names: Qt5ConcurrentConfig.cmake qt5concurrent-config.cmake Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set "Qt5Concurrent_DIR" to a directory containing one of the above files. If "Qt5Concurrent" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) -- Looking for Q_WS_X11 -- Looking for Q_WS_X11 - found -- Looking for Q_WS_WIN -- Looking for Q_WS_WIN - not found -- Looking for Q_WS_QWS -- Looking for Q_WS_QWS - not found -- Looking for Q_WS_MAC -- Looking for Q_WS_MAC - not found -- Found Qt4: /usr/bin/qmake (found version "4.8.7") -- Checking for module 'gstreamer-base-1.0' -- No package 'gstreamer-base-1.0' found -- Checking for module 'gstreamer-video-1.0' -- No package 'gstreamer-video-1.0' found -- Checking for module 'gstreamer-app-1.0' -- No package 'gstreamer-app-1.0' found -- Checking for module 'gstreamer-riff-1.0' -- No package 'gstreamer-riff-1.0' found -- Checking for module 'gstreamer-pbutils-1.0' -- No package 'gstreamer-pbutils-1.0' found -- Checking for module 'gstreamer-base-0.10' -- Found gstreamer-base-0.10, version 0.10.36 -- Checking for module 'gstreamer-video-0.10' -- Found gstreamer-video-0.10, version 0.10.36 -- Checking for module 'gstreamer-app-0.10' -- Found gstreamer-app-0.10, version 0.10.36 -- Checking for module 'gstreamer-riff-0.10' -- Found gstreamer-riff-0.10, version 0.10.36 -- Checking for module 'gstreamer-pbutils-0.10' -- Found gstreamer-pbutils-0.10, version 0.10.36 -- Checking for module 'libxine' -- No package 'libxine' found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- Checking for module 'libavresample' -- No package 'libavresample' found -- Checking for module 'libgphoto2' -- No package 'libgphoto2' found -- Found TBB: /usr/lib/x86_64-linux-gnu/libtbb.so CMake Error at cmake/OpenCVFindIPP.cmake:243 (include): include could not find load file: ...................... CMake Warning at CMakeLists.txt:1356 (message): The source directory is the same as binary directory. "make clean" may damage the source tree -- Configuring incomplete, errors occurred! See also "/home/zyz/文档/opencv-3.2.0/CMakeFiles/CMakeOutput.log". See also "/home/zyz/文档/opencv-3.2.0/CMakeFiles/CMakeError.log".
node项目运行后提示错误信息ERR_HTTP_INVALID_HEADER_VALUE
我在运行node项目时提示运行错误 ``` D:\hichat>node app.js server on *:3000 _http_outgoing.js:475 throw new ERR_HTTP_INVALID_HEADER_VALUE(value, name); ^ TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "Content-Type" at storeHeader (_http_outgoing.js:432:5) at processHeader (_http_outgoing.js:427:3) at ServerResponse._storeHeader (_http_outgoing.js:332:11) at ServerResponse.writeHead (_http_server.js:303:8) at D:\hichat\modules\StaticService.js:30:8 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3) { code: 'ERR_HTTP_INVALID_HEADER_VALUE' } ``` 网上找了很多,都没有找到相应的方法和出现的原因 ``` StaticService.js var fs = require("fs"),//内部模块 处理文件操作 path =require("path"),//内部模块 处理路径操作 mime =require("./mime").types;//自定义模块请求处理文档类型操作 /** * 404 NOT FOUNT 函数 * @param {[type]} res [请求对象] */ function send404(res){ res.writeHead(404,{"Content-Type":"text/plain"}); res.end("404 not found"); } /** * 静态文件请求函数 * @param {[type]} realpath [绝对路径] * @param {[type]} res [服务器请求对象] */ function staticServer(realpath,res){ fs.readFile(realpath,function(err,data){ if(!err){ var extname=path.extname(realpath); res.writeHead(200,{"Content-Type":mime[extname]}); //这行报错 res.end(data); }else{ send404(res); } }); } /** * 静态服务器主入口模块 * @param {[type]} pathname [请求路径名称] * @param {[type]} res [请求对象] * @param {[type]} base_dir [根目录] */ exports.staticRender=function(pathname,res,base_dir){ var reg = /^\/static|upload/;//目录匹配 if(reg.test(pathname)){ fs.exists(path.join(base_dir,pathname),function(exists){ if(exists){ staticServer(path.join(base_dir,pathname),res) }else{ send404(res); } }) }else{ send404(res); } } ``` ``` /** * title hichat聊天室 文件mime类型对象 */ exports.types = { '.hqx':'application/mac-binhex40', '.cpt':'application/mac-compactpro', '.csv':['text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'], '.bin':'application/macbinary', '.dms':'application/octet-stream', '.lha':'application/octet-stream', '.lzh':'application/octet-stream', '.exe':['application/octet-stream', 'application/x-msdownload'], '.class':'application/octet-stream', '.psd':'application/x-photoshop', '.so':'application/octet-stream', '.sea':'application/octet-stream', '.dll':'application/octet-stream', '.oda':'application/oda', '.pdf':['application/pdf', 'application/x-download'], '.ai':'application/postscript', '.eps':'application/postscript', '.ps':'application/postscript', '.smi':'application/smil', '.smil':'application/smil', '.mif':'application/vnd.mif', '.xls':['application/excel', 'application/vnd.ms-excel', 'application/msexcel'], '.ppt':['application/powerpoint', 'application/vnd.ms-powerpoint'], '.wbxml':'application/wbxml', '.wmlc':'application/wmlc', '.dcr':'application/x-director', '.dir':'application/x-director', '.dxr':'application/x-director', '.dvi':'application/x-dvi', '.gtar':'application/x-gtar', '.gz':'application/x-gzip', '.php':'application/x-httpd-php', '.php4':'application/x-httpd-php', '.php3':'application/x-httpd-php', '.phtml':'application/x-httpd-php', '.phps':'application/x-httpd-php-source', '.js':'application/x-javascript', '.swf':'application/x-shockwave-flash', '.sit':'application/x-stuffit', '.tar':'application/x-tar', '.tgz':['application/x-tar', 'application/x-gzip-compressed'], '.xhtml':'application/xhtml+xml', '.xht':'application/xhtml+xml', '.zip':['application/x-zip', 'application/zip', 'application/x-zip-compressed'], '.mid':'audio/midi', '.midi':'audio/midi', '.mpga':'audio/mpeg', '.mp2':'audio/mpeg', '.mp3':['audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'], '.aif':'audio/x-aiff', '.aiff':'audio/x-aiff', '.aifc':'audio/x-aiff', '.ram':'audio/x-pn-realaudio', '.rm':'audio/x-pn-realaudio', '.rpm':'audio/x-pn-realaudio-plugin', '.ra':'audio/x-realaudio', '.rv':'video/vnd.rn-realvideo', '.wav':['audio/x-wav', 'audio/wave', 'audio/wav'], '.bmp':['image/bmp', 'image/x-windows-bmp'], '.gif':'image/gif', '.jpeg':['image/jpeg', 'image/pjpeg'], '.jpg':['image/jpeg', 'image/pjpeg'], '.jpe':['image/jpeg', 'image/pjpeg'], '.png':['image/png', 'image/x-png'], '.tiff':'image/tiff', '.tif':'image/tiff', '.css':'text/css', '.html':'text/html', '.htm':'text/html', '.shtml':'text/html', '.txt':'text/plain', '.text':'text/plain', '.log':['text/plain', 'text/x-log'], '.rtx':'text/richtext', '.rtf':'text/rtf', '.xml':'text/xml', '.xsl':'text/xml', '.mpeg':'video/mpeg', '.mpg':'video/mpeg', '.mpe':'video/mpeg', '.qt':'video/quicktime', '.mov':'video/quicktime', '.avi':'video/x-msvideo', '.movie':'video/x-sgi-movie', '.doc':'application/msword', '.docx':['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'], '.xlsx':['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'], '.word':['application/msword', 'application/octet-stream'], '.xl':'application/excel', '.eml':'message/rfc822', '.json':['application/json', 'text/json'] }; ```
springboot 多模块打包war,tomcat启动提示找不到配置文件
新项目使用springboot maven module方式新建了多个子模块,(多个)web,service,dao,entity,util、storage。其中web依赖entity、service、util、storage。 uitl模块中有个ConfigUtil.java @Component @ConfigurationProperties @PropertySource(value = "classpath:config.properties",encoding = "utf-8") public class ConfigUtil { ...... } 其中config.properties文件放在util模块的resources文件夹下。 在将其中一个web项目打包成war时,在tomcat中启动时提示找不到config.properties ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579522003_255875.png) 下面是uitl模块的pom文件 ``` <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.zjyc.dsy</groupId> <artifactId>dsy-al</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <name>dsy-util</name> <packaging>jar</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>artemis</groupId> <artifactId>artemis-lib</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/jar/artemis-http-client-1.0-SNAPSHOT.jar</systemPath> </dependency> </dependencies> <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> </includes> <!-- resource的filtering属性用来表示资源文件中的占位符是否需要被替换,true为需要替换。 --> <filtering>false</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*</include> </includes> <filtering>false</filtering> </resource> </resources> </build> </project> ``` 下面是web模块的pom ``` <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> <parent> <groupId>com.zjyc.dsy</groupId> <artifactId>dsy-al</artifactId> <version>0.0.1-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>com.zjyc.dsy.web</groupId> <artifactId>dsy-web</artifactId> <name>dsy-web</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>com.zjyc.dsy.entity</groupId> <artifactId>dsy-entity</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.service</groupId> <artifactId>dsy-service</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.storage</groupId> <artifactId>dsy-storage</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <!-- 引入java编译器插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <compilerVersion>1.8</compilerVersion> <encoding>UTF-8</encoding> </configuration> </plugin> <!-- 资源文件拷贝插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <version>0.0.1-SNAPSHOT</version> <type>jar</type> <overWrite>true</overWrite> <outputDirectory>${project.build.directory}/classes</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-dependency-plugin </artifactId> <versionRange> [2.1,) </versionRange> <goals> <goal>unpack</goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> <excludes> <exclude>**/*.properties</exclude> </excludes> </resource> </resources> </build> </project> ``` 下面是war解压之后classes的目录结构 ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579522257_42080.png) tomcat启动报错代码 ``` 20-Jan-2020 19:55:46.409 警告 [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '500' did not find a matching property. 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.6 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 5 2018 09:34:35 UTC 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.6.0 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows Server 2008 R2 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_161\jre 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_161-b12 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: E:\apache-tomcat-9 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: E:\apache-tomcat-9 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=E:\apache-tomcat-9\conf\logging.properties 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=E:\apache-tomcat-9 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=E:\apache-tomcat-9 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=E:\apache-tomcat-9\temp 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3]. 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 20-Jan-2020 19:55:47.440 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017] 20-Jan-2020 19:55:47.565 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"] 20-Jan-2020 19:55:47.612 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Jan-2020 19:55:47.628 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-7778"] 20-Jan-2020 19:55:47.628 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Jan-2020 19:55:47.628 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1553 ms 20-Jan-2020 19:55:47.659 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 20-Jan-2020 19:55:47.659 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.6 20-Jan-2020 19:55:47.675 信息 [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] 20-Jan-2020 19:55:50.815 信息 [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 20-Jan-2020 19:55:52.456 严重 [main] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dsy-web-0.0.1-SNAPSHOT]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.zjyc.dsy.web.App]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/config.properties] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:325) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:242) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5030) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 38 more Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/config.properties] at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:159) at org.springframework.core.io.support.EncodedResource.getReader(EncodedResource.java:143) at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:95) at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:73) at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:59) at org.springframework.core.io.support.ResourcePropertySource.<init>(ResourcePropertySource.java:67) at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:455) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:274) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:194) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:298) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:202) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:170) ... 54 more 20-Jan-2020 19:55:52.471 严重 [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dsy-web-0.0.1-SNAPSHOT]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:746) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493) 20-Jan-2020 19:55:52.487 信息 [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] has finished in [4,812] ms 20-Jan-2020 19:55:52.487 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"] 20-Jan-2020 19:55:52.503 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-7778"] 20-Jan-2020 19:55:52.518 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 4881 ms ```
tomcat7.0运行报错:No rules found 'Server/Service/...
tomcat7.0下运行工程报错:No rules found matching 'Server/Service/Engine/Host/Resource' 我的web工程中有个配置: 在contextConfigLocation中配置加载app-context.xml 然后在app-context.xml文件中有个配置: < jee:jndi-lookup id="mDS" jndi-name="java:comp/env/jdbc/MDS" /> 然后我在ecplice的service标签下配置tomcat后,修改tomcat的context.xml文件,在< Context中添加了一个Resource配置如下: < Resource driverClassName="org.gjt.mm.mysql.Driver" maxActive="8" maxIdle="4" name="jdbc/MDS" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/mdb?characterEncoding=UTF-8" username="root" password="root" /> 其余就没有配置了,然后再启动tomcat的时候就报了如下的错误: 2014-12-5 21:40:23 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_43\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jdk1.6.0_43/bin/../jre/bin/server;C:/Program Files/Java/jdk1.6.0_43/bin/../jre/bin;C:/Program Files/Java/jdk1.6.0_43/bin/../jre/lib/amd64;C:\Program Files\Java\jdk1.6.0_43\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\software\apache-maven-3.2.1\bin;D:\tools\SVN\bin;D:\tools\MYSQL\MySQL Utilities 1.4.4\;D:\tools\MYSQL\MySQL Utilities 1.4.4\Doctrine extensions for PHP\;.;;D:\eclipse;;.;;. 2014-12-5 21:40:23 org.apache.tomcat.util.digester.Digester endElement 警告: No rules found matching 'Server/Service/Engine/Host/Resource'. 2014-12-5 21:40:23 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:m' did not find a matching property. 按照网上的各种方法试了都不行,请为下各位大神是什么原因,我用的tomcat7.0,jdk是jdk1.6.0_43,ecplise版本是Kepler Service Release 2,实在是黔驴技穷了,求帮助~~
Spring整合hibernate4时出现no session错误
首先将eclipse抛出的错误贴出来: ``` 严重: Servlet.service() for servlet [springDispatcherServlet] in context with path [/VideoMngSys] threw exception [Request processing failed; nested exception is org.hibernate.HibernateException: No Session found for current thread] with root cause org.hibernate.HibernateException: No Session found for current thread at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:106) at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:988) at com.vincent.videosys.dao.BaseDao.getSession(BaseDao.java:17) at com.vincent.videosys.dao.UserDao.usernameExist(UserDao.java:29) at com.vincent.videosys.service.UserService.usernameExistService(UserService.java:19) at com.vincent.videosys.controller.home.UserController.usernameExist(UserController.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle (ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod (RequestMappingHandlerAdapter.java:748) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal (RequestMappingHandlerAdapter.java:689) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle (AbstractHandlerMethodAdapter.java:83) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931) .... ``` ![项目工程结构如下:](https://img-ask.csdn.net/upload/201601/02/1451707793_69876.png) 下面依次贴出我的相关文件代码: 1.web.xml ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <!-- 加载Spring配置文件,Spring应用上下文,理解层次化的ApplicationContext --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 可以将POST请求转为PUT请求和DELETE请求 --> <filter> <filter-name>HiddenHttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> </filter> <filter-mapping> <filter-name>HiddenHttpMethodFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- The front controller of this Spring Web application, responsible for handling all application requests --> <servlet> <servlet-name>springDispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springmvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!-- Map all requests to the DispatcherServlet for handling --> <servlet-mapping> <servlet-name>springDispatcherServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> </web-app> ``` 2.spring-mvc.xml ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" ......> <!-- 向Spring容器注册AutowiredAnnotationBeanPostProcessor、 CommonAnnotationBeanPostProcessor、 PersistenceAnnotationBeanPostProcessor、 RequiredAnnotationBeanPostProcessor,使系统能识别注解 --> <context:annotation-config /> <!-- 使用annotation自动注册bean,并检查@Controller、@Service、@Repository --> <context:component-scan base-package="com.vincent.videosys"></context:component-scan> <!-- 导入资源文件 --> <context:property-placeholder location="classpath:db.properties"/> <!-- 配置C3P0数据源 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="user" value="${jdbc.user}"></property> <property name="password" value="${jdbc.password}"></property> <property name="driverClass" value="${jdbc.driverClass}"></property> <property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property> <property name="initialPoolSize" value="${jdbc.initPoolSize}"></property> <property name="maxPoolSize" value="${jdbc.maxPoolSize}"></property> </bean> <!-- 配置SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <property name="configLocation" value="classpath:hibernate.cfg.xml"></property> <property name="packagesToScan"> <list> <value>com.vincent.videosys.*</value> </list> </property> </bean> <!-- 配置hibernate的事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <!-- 定义AutoWired自动注入bean --> <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"></bean> <!-- 用注解来实现事务管理 --> <tx:annotation-driven transaction-manager="transactionManager"/> <!-- 3. 配置事务切入点, 再把事务属性和事务切入点关联起来 --> <aop:config> <aop:pointcut expression="execution(* com.vincent.videosys.service.*.*(..))" id="txPointcut"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/> </aop:config> </beans> ``` 4.hibernate.cfg.xml ``` <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- Database connection settings --> <!-- JDBC connection pool (use the built-in) --> <!-- <property name="connection.pool_size">1</property>--> <!-- 数据库使用的方言 --> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <!-- Echo all executed SQL to stdout --> <!-- 设置 打印输出 sql 语句 为真 --> <property name="hibernate.show_sql">true</property> <!-- 设置格式为 sql --> <property name="hibernate.format_sql">true</property> <!-- 第一次加载 hibernate 时根据实体类自动建立表结构,以后自动更新表结构 --> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext</property> </session-factory> </hibernate-configuration> ``` 5.db.properties jdbc.user=root jdbc.password=root jdbc.driverClass=com.mysql.jdbc.Driver jdbc.jdbcUrl=jdbc:mysql://localhost:3306/videomngsys jdbc.initPoolSize=5 jdbc.maxPoolSize=10 6. BaseDao.java ``` package com.vincent.videosys.dao; import javax.annotation.Resource; ..... @Repository("baseDao") public class BaseDao{ @Autowired protected SessionFactory sessionFactory; public Session getSession(){ return this.sessionFactory.getCurrentSession(); } } ``` 7.UserDao.java ``` package com.vincent.videosys.dao; import org.hibernate.Query; import org.hibernate.Session; .... @Repository("userDao") public class UserDao extends BaseDao{ protected SessionFactory sessionFactory; /** * 查看该用户名在数据库中是否存在 * 存在返回true * 不存在返回false * 默认返回true * @param username * @return */ public boolean usernameExist(String username){ boolean exist = true; String hqlString = "from user where username = :username"; Session session = super.getSession(); Query query = session.createQuery(hqlString); query.setParameter("username", username); List<User> list = query.list(); if(list.size() > 0) { exist = false; } return exist; } } ``` 8 UserService.java ``` package com.vincent.videosys.service; import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired; ... @Transactional @Service("userService") public class UserService { @Autowired private UserDao userDao; public boolean usernameExistService(String username){ return userDao.usernameExist(username); } } ``` 9. UserController.java ``` package com.vincent.videosys.controller.home; import java.util.HashMap; import java.util.Map; import javax.annotation.Resource; ..... @RequestMapping("/user") @Controller public class UserController { @Autowired private UserService userService; @ResponseBody @RequestMapping(value="/usernameExist",method=RequestMethod.POST) public Map<String, String> usernameExist(@RequestParam("username")String usernameString ){ Map<String, String> resultMap = new HashMap<String, String>(); System.out.println("username: "+usernameString); if(userService.usernameExistService(usernameString)){ resultMap.put("status", "1");//exits } else{ resultMap.put("status", "0");//not exist } return resultMap; } } ``` 每次程序执行到UserController类中的userNameExist方法时,开始调用userService中的方法时,便开始抛出错误.....
No mapping found for HTTP request with URI
问题描述: No mapping found for HTTP request with URI [/myspingmvc/helloworld] in DispatcherServlet with name 'springDispatcherServlet' 项目目录结构: ![图片说明](https://img-ask.csdn.net/upload/201702/22/1487773461_45153.png) web.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!-- This web.xml file is not required when using Servlet 3.0 container, see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html --> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- 配置DispatcherServerlet --> <!-- The front controller of this Spring Web application, responsible for handling all application requests --> <servlet> <servlet-name>springDispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!--配置springDispatcherServlet的一个初始化参数:配置SpingMVC配置文件的位置和名称 --> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springmvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!-- Map all requests to the DispatcherServlet for handling --> <servlet-mapping> <servlet-name>springDispatcherServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app> ``` springmvc.xml ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd"> <mvc:annotation-driven/> <!-- 配置自动扫描的包 --> <context:component-scan base-package="com.myspringmvc.handlers"></context:component-scan> <!-- 配置试图解析器:如何把handler --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="WEB-INF/views"></property> <property name="suffix" value=".jsp"></property> </bean> </beans> ``` HelloWorld.java ``` package com.myspringmvc.handlers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping("/myspingmvc") public class HelloWorld { @RequestMapping("/helloworld") public String hello(){ System.out.println("Hello World"); return "success"; } } ``` 日志: 二月 22, 2017 10:32:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:my_webapp' did not find a matching property. 二月 22, 2017 10:32:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:myspingmvc' did not find a matching property. 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/7.0.70 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Jun 15 2016 16:27:45 UTC 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 7.0.70.0 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 7 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 6.1 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: x86 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files\Java\jre1.8.0_91 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_91-b15 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: E:\ProgramFiles\apache-tomcat-7.0.70 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=E:\ProgramFiles\apache-tomcat-7.0.70 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=E:\ProgramFiles\apache-tomcat-7.0.70\endorsed 二月 22, 2017 10:32:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=GBK 二月 22, 2017 10:32:54 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_91\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_91/bin/client;C:/Program Files/Java/jre1.8.0_91/bin;C:/Program Files/Java/jre1.8.0_91/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\AMD APP\bin\x86;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\SinoVoice\jTTS 5.0 Desktop\Bin;D:\Java\jdk1.8.0_91\bin;E:\Java\Maven\apache-maven-3.3.9\bin;E:\Java\gradle-2.14\bin;;D:\eclipse;;. 二月 22, 2017 10:32:55 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-bio-8080"] 二月 22, 2017 10:32:55 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-bio-8009"] 二月 22, 2017 10:32:55 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 988 ms 二月 22, 2017 10:32:55 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 二月 22, 2017 10:32:55 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.70 二月 22, 2017 10:32:56 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [523] milliseconds. 二月 22, 2017 10:32:57 下午 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 二月 22, 2017 10:32:57 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 二月 22, 2017 10:32:58 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springDispatcherServlet' 二月 22, 2017 10:32:58 下午 org.springframework.web.servlet.DispatcherServlet initServletBean 信息: FrameworkServlet 'springDispatcherServlet': initialization started 二月 22, 2017 10:32:58 下午 org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh 信息: Refreshing WebApplicationContext for namespace 'springDispatcherServlet-servlet': startup date [Wed Feb 22 22:32:58 CST 2017]; root of context hierarchy 二月 22, 2017 10:32:58 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [springmvc.xml] 二月 22, 2017 10:32:59 下午 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register 信息: Mapped "{[/myspingmvc/helloworld]}" onto public java.lang.String com.myspringmvc.handlers.HelloWorld.hello() 二月 22, 2017 10:32:59 下午 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache 信息: Looking for @ControllerAdvice: WebApplicationContext for namespace 'springDispatcherServlet-servlet': startup date [Wed Feb 22 22:32:58 CST 2017]; root of context hierarchy 二月 22, 2017 10:32:59 下午 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache 信息: Looking for @ControllerAdvice: WebApplicationContext for namespace 'springDispatcherServlet-servlet': startup date [Wed Feb 22 22:32:58 CST 2017]; root of context hierarchy 二月 22, 2017 10:32:59 下午 org.springframework.web.servlet.DispatcherServlet initServletBean 信息: FrameworkServlet 'springDispatcherServlet': initialization completed in 1731 ms 二月 22, 2017 10:33:00 下午 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 二月 22, 2017 10:33:01 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 二月 22, 2017 10:33:01 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 二月 22, 2017 10:33:01 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 6724 ms 二月 22, 2017 10:33:12 下午 org.springframework.web.servlet.PageNotFound noHandlerFound 警告: No mapping found for HTTP request with URI [/myspingmvc/helloworld] in DispatcherServlet with name 'springDispatcherServlet' 界面提示信息: ![图片说明](https://img-ask.csdn.net/upload/201702/22/1487775136_309532.png)
在页面上访问tomcat错误
我在C:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\servlet.xm中把端口号改成了8888; 截止现在,之前运行都是对的。可是现在我在IE地址内输入:http://localhost:8888,按下Enter键,出现一下错误: [color=red]java.lang.IllegalArgumentException: Document base C:\Program Files\Apache Software Foundation\Tomcat [/color]5.0\webapps\balancer does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:185) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3851) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4073) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:832) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) at org.apache.commons.digester.Rule.end(Rule.java:276) at org.apache.commons.digester.Digester.endElement(Digester.java:1058) at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:123) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:512) at org.apache.catalina.core.StandardHost.install(StandardHost.java:890) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:523) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:393) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) 2008-7-23 13:08:16 org.apache.catalina.core.StandardContext start [color=red]严重: Error in resourceStart() 2008-7-23 13:08:17 org.apache.catalina.core.StandardContext start 严重: Error getConfigured 2008-7-23 13:08:17 org.apache.catalina.core.StandardContext start 严重: Context startup failed due to previous errors 2008-7-23 13:08:17 org.apache.catalina.core.StandardContext start 严重: Exception during cleanup after start failed LifecycleException: Container StandardContext[/balancer] has not been started[/color] at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4390) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4288) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:832) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) at org.apache.commons.digester.Rule.end(Rule.java:276) at org.apache.commons.digester.Digester.endElement(Digester.java:1058) at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:123) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:512) at org.apache.catalina.core.StandardHost.install(StandardHost.java:890) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:523) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:393) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) 什么错误啊,解决了好长时间都没解决掉 [b]问题补充:[/b] 以下是servlet.xml <!-- Example Server Configuration File --> <!-- Note that component elements are nested corresponding to their parent-child relationships with each other --> <!-- A "Server" is a singleton element that represents the entire JVM, which may contain one or more "Service" instances. The Server listens for a shutdown command on the indicated port. Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" or "Loggers" at this level. --> <Server port="8005" shutdown="SHUTDOWN" debug="0"> <!-- Comment out these entries to disable JMX MBeans support --> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/> <!-- Global JNDI resources --> <GlobalNamingResources> <!-- Test entry for demonstration purposes --> <Environment name="simpleValue" type="java.lang.Integer" value="30"/> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved"> </Resource> <ResourceParams name="UserDatabase"> <parameter> <name>factory</name> <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value> </parameter> <parameter> <name>pathname</name> <value>conf/tomcat-users.xml</value> </parameter> </ResourceParams> </GlobalNamingResources> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" (and therefore the web applications visible within that Container). Normally, that Container is an "Engine", but this is not required. Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" or "Loggers" at this level. --> <!-- Define the Tomcat Stand-Alone Service --> <Service name="Catalina"> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Each Connector passes requests on to the associated "Container" (normally an Engine) for processing. By default, a non-SSL HTTP/1.1 Connector is established on port 8080. You can also enable an SSL HTTP/1.1 Connector on port 8443 by following the instructions below and uncommenting the second Connector entry. SSL support requires the following steps (see the SSL Config HOWTO in the Tomcat 5 documentation bundle for more detailed instructions): * Download and install JSSE 1.0.2 or later, and put the JAR files into "$JAVA_HOME/jre/lib/ext". * Execute: %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows) $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix) with a password value of "changeit" for both the certificate and the keystore itself. By default, DNS lookups are enabled when a web application calls request.getRemoteHost(). This can have an adverse impact on performance, so you can disable it by setting the "enableLookups" attribute to "false". When DNS lookups are disabled, request.getRemoteHost() will return a String containing the IP address of the remote client. --> <!-- Define a non-SSL Coyote HTTP/1.1 Connector on the port specified during installation --> <Connector port="8888" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" /> <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --> <!-- <Connector port="8443" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" debug="0" scheme="https" secure="true"> <Factory clientAuth="false" protocol="TLS" /> </Connector> --> <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --> <Connector port="8009" enableLookups="false" redirectPort="8443" debug="0" protocol="AJP/1.3" /> <!-- Define a Proxied HTTP/1.1 Connector on port 8082 --> <!-- See proxy documentation for more information about using this. --> <!-- <Connector port="8082" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" acceptCount="100" debug="0" connectionTimeout="20000" proxyPort="80" disableUploadTimeout="true" /> --> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). --> <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie : <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1"> --> <!-- Define the top level container in our container hierarchy --> <Engine name="Catalina" defaultHost="localhost" debug="0"> <!-- The request dumper valve dumps useful debugging information about the request headers and cookies that were received, and the response headers and cookies that were sent, for all requests received by this instance of Tomcat. If you care only about requests to a particular virtual host, or a particular application, nest this element inside the corresponding <Host> or <Context> entry instead. For a similar mechanism that is portable to all Servlet 2.4 containers, check out the "RequestDumperFilter" Filter in the example application (the source for this filter may be found in "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters"). Request dumping is disabled by default. Uncomment the following element to enable it. --> <!-- <Valve className="org.apache.catalina.valves.RequestDumperValve"/> --> <!-- Global logger unless overridden at lower levels --> <Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true"/> <!-- Because this Realm is here, an instance will be shared globally --> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" debug="0" resourceName="UserDatabase"/> <!-- Comment out the old realm but leave here for now in case we need to go back quickly --> <!-- <Realm className="org.apache.catalina.realm.MemoryRealm" /> --> <!-- Replace the above Realm with one of the following to get a Realm stored in a database and accessed via JDBC --> <!-- <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="org.gjt.mm.mysql.Driver" connectionURL="jdbc:mysql://localhost/authority" connectionName="test" connectionPassword="test" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" /> --> <!-- <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL" connectionName="scott" connectionPassword="tiger" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" /> --> <!-- <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="sun.jdbc.odbc.JdbcOdbcDriver" connectionURL="jdbc:odbc:CATALINA" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" /> --> <!-- Define the default virtual host --> <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- Add the following attributes if you want to turn XML validation on. Remember to comment the Host element above. Note: XML Schema validationn will works with Xerces 2.0.1 or Xerces 2.1. Xerces 2.0.2 and Xerces 2.2 have bugs that prevent their use with Tomcat--> <!-- <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="true" xmlNamespaceAware="true"> --> <!-- Defines a cluster for this node, By defining this element, means that every manager will be changed. So when running a cluster, only make sure that you have webapps in there that need to be clustered and remove the other ones. A cluster has the following parameters: className = the fully qualified name of the cluster class name = a descriptive name for your cluster, can be anything debug = the debug level, higher means more output mcastAddr = the multicast address, has to be the same for all the nodes mcastPort = the multicast port, has to be the same for all the nodes mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes tcpListenAddress = the listen address (bind address) for TCP cluster request on this host, in case of multiple ethernet cards. auto means that address becomes InetAddress.getLocalHost().getHostAddress() tcpListenPort = the tcp listen port tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS has a wakup bug in java.nio. Set to 0 for no timeout printToScreen = true means that managers will also print to std.out expireSessionsOnShutdown = true means that useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called. false means to replicate the session after each request. false means that replication would work for the following piece of code: <% HashMap map = (HashMap)session.getAttribute("map"); map.put("key","value"); %> replicationMode = can be either 'synchronous' or 'asynchronous'. * Synchronous means that the thread that executes the request, is also the thread the replicates the data to the other nodes, and will not return until all nodes have received the information. * Asynchronous means that there is a specific 'sender' thread for each cluster node, so the request thread will queue the replication request into a "smart" queue, and then return to the client. The "smart" queue is a queue where when a session is added to the queue, and the same session already exists in the queue from a previous request, that session will be replaced in the queue instead of replicating two requests. This almost never happens, unless there is a large network delay. --> <!-- When uncommenting the cluster, REMEMBER to uncomment the replication Valve below as well <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster" name="FilipsCluster" debug="10" serviceclass="org.apache.catalina.cluster.mcast.McastService" mcastAddr="228.0.0.4" mcastPort="45564" mcastFrequency="500" mcastDropTime="3000" tcpThreadCount="2" tcpListenAddress="auto" tcpListenPort="4001" tcpSelectorTimeout="100" printToScreen="false" expireSessionsOnShutdown="false" useDirtyFlag="true" replicationMode="synchronous" /> --> <!-- When configuring for clustering, you also add in a valve to catch all the requests coming in, at the end of the request, the session may or may not be replicated. A session is replicated if and only if all the conditions are met: 1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND 2. a session exists (has been created) 3. the request is not trapped by the "filter" attribute The filter attribute is to filter out requests that could not modify the session, hence we don't replicate the session after the end of this request. The filter is negative, ie, anything you put in the filter, you mean to filter out, ie, no replication will be done on requests that match one of the filters. The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to. filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI ending with .gif and .js are intercepted. --> <!-- <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/> --> <!-- Normally, users must authenticate themselves to each web app individually. Uncomment the following entry if you would like a user to be authenticated the first time they encounter a resource protected by a security constraint, and then have that user identity maintained across *all* web applications contained in this virtual host. --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" debug="0"/> --> <!-- Access log processes all requests for this virtual host. By default, log files are created in the "logs" directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the "directory" attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory. --> <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> --> <!-- Logger shared by all Contexts related to this virtual host. By default (when using FileLogger), log files are created in the "logs" directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the "directory" attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory.--> <Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true"/> <!-- Define properties for each web application. This is only needed if you want to set non-default properties, or have web application document roots in places other than the virtual host's appBase directory. --> <!-- Tomcat Root Context --> <!-- <Context path="" docBase="ROOT" debug="0"> --> </Host> </Engine> </Service> </Server>
关于dev gridview 主键的问题
前台代码<dx:ASPxGridView ID="ASPxGridView1" ClientInstanceName="grid" runat="server" KeyFieldName="物料组" Width="90%" SkinID="skDev" CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx"> <Columns> <dx:GridViewDataTextColumn Caption=""> <DataItemTemplate> <%#Container.ItemIndex+1 %> </DataItemTemplate> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="物料组" FieldName="物料组"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="物料号" FieldName="物料号"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="物料名称" FieldName="物料名称"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="数量" FieldName="数量"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="单位" FieldName="单位"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="单价" FieldName="单价"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="总价" FieldName="总价"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="增减项" FieldName="增减项"> </dx:GridViewDataTextColumn> </Columns> 后台: public partial class BuildingMaterials : System.Web.UI.Page { public string pid { get { return Request["pid"]; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string pid = Request["pid"]; List<sb> xsb = GetSbList(); this.ASPxGridView1.DataSource = xsb; this.ASPxGridView1.DataBind(); } } public string a; public List<sb> GetSbList() { GreenInterface g = new GreenInterface(); var xsb = new sb(); var ctx = new Linq.DBPSDataContext(); var ctx1 = new Linq.DBQSDataContext(); var xsbList = new List<sb>(); var temp = new sb(); string sql = "select prod_OrgName,prod_NO,prod_Name,Count,prod_Unit,prod_Price,DealTotal from T_SubOrders group by prod_OrgName,prod_NO,prod_Name,Count,prod_Unit,prod_Price,DealTotal"; DataTable dt = g.Query(sql,ConnectionStrings.DBPS).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (a != dt.Rows[i]["prod_OrgName"].ToString()) { string b = dt.Rows[i]["prod_OrgName"].ToString(); temp.ID = i; temp.单位 = "报价"; temp.单价 = "800"; xsbList.Add(temp); } xsb.ID = i; xsb.物料组 = dt.Rows[i]["prod_OrgName"].ToString(); xsb.物料号 = dt.Rows[i]["prod_NO"].ToString(); xsb.物料名称 = dt.Rows[i]["prod_Name"].ToString(); xsb.数量 = dt.Rows[i]["Count"].ToString(); xsb.单位 = dt.Rows[i]["prod_Unit"].ToString(); xsb.单价 = dt.Rows[i]["prod_Price"].ToString(); xsb.总价 = dt.Rows[i]["DealTotal"].ToString(); a = dt.Rows[i]["prod_OrgName"].ToString(); xsbList.Add(xsb); } } return xsbList; } public class sb { public int ID; public string 物料组; public string 物料号; public string 物料名称; public string 数量; public string 单位; public string 单价; public string 总价; public string 增减项; } 一直显示这个错误:其他信息: A primary key field specified via the KeyFieldName property is not found in the underlying data source. Make sure the field name is spelled correctly. Pay attention to the character case. 我主键也设置了 为什么还显示这个
哪位大神帮我解决一下eclipse运行突然报404,好像是spring配置文件有问题
七月 28, 2019 2:17:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:xuexiao' did not find a matching property. 七月 28, 2019 2:17:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MyHRSht' did not find a matching property. 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.5.34 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Sep 4 2018 22:28:22 UTC 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.5.34.0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 10 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 10.0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files\Java\jre1.8.0_201 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_201-b09 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: E:\apache-tomcat-8.5.34-myeclipse 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=E:\apache-tomcat-8.5.34-myeclipse 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=E:\apache-tomcat-8.5.34-myeclipse\endorsed 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=UTF-8 七月 28, 2019 2:17:54 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_201\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_201/bin/server;C:/Program Files/Java/jre1.8.0_201/bin;C:/Program Files/Java/jre1.8.0_201/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_201\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\申红涛\AppData\Local\Microsoft\WindowsApps;;E:\eclipse;;.] 七月 28, 2019 2:17:55 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8083"] 七月 28, 2019 2:17:56 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 28, 2019 2:17:57 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8039"] 七月 28, 2019 2:17:57 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 28, 2019 2:17:57 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 2984 ms 七月 28, 2019 2:17:57 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service [Catalina] 七月 28, 2019 2:17:57 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.5.34 七月 28, 2019 2:18:15 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 七月 28, 2019 2:18:15 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 七月 28, 2019 2:18:15 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 七月 28, 2019 2:20:49 下午 org.apache.ibatis.mapping.VendorDatabaseIdProvider getDatabaseId 严重: Could not get a databaseId from dataSource java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:395) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) 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: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 29 more 七月 28, 2019 2:20:50 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springmvc' 七月 28, 2019 2:21:10 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 七月 28, 2019 2:21:10 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 七月 28, 2019 2:21:10 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2019-07-28 14:21:13 Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xuexiao\WEB-INF\classes\springconfig\common.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) 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: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:490) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ... 20 more Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:135) at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:434) at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:406) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:163) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470) ... 26 more 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xuexiao\WEB-INF\classes\springconfig\common.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) 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: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:490) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ... 20 more Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:135) at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:434) at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:406) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:163) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470) ... 26 more 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/xuexiao] startup failed due to previous errors 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 七月 28, 2019 2:21:14 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks 严重: The web application [xuexiao] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5c5c779c]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 七月 28, 2019 2:21:14 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks 严重: The web application [xuexiao] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5c353122]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 七月 28, 2019 2:21:14 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8083"] 七月 28, 2019 2:21:14 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8039"] 七月 28, 2019 2:21:14 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 197051 ms web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>SpringMybatisOa</display-name> <!-- dwr --> <servlet> <servlet-name>dwr_invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr_invoker</servlet-name> <url-pattern>/dwre/*</url-pattern> </servlet-mapping> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springconfig/*</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>*.action</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app> spring.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" value="classpath:jdbc.properties"></property> </bean> <bean id="ds" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${driverClass}" /> <property name="jdbcUrl" value="${url}" /> <property name="user" value="${userName}" /> <property name="password" value="${passWord}" /> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="ds" /> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="ds" /> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value="dao/*.xml"></property> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> <property name="basePackage" value="dao" /> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> <context:component-scan base-package="biz.impl"/> </beans> springmvc.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <mvc:annotation-driven/><!-- 启动注解方式的mvc --> <context:component-scan base-package="action"/><!-- 扫描该包下所有类加载到容器 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/"/> <property name="suffix" value=".jsp"/> </bean> </beans>
hive _jdbc 连接SASL认证问题
【java代码】 package org.neworigin.hive.Hive_JDBC; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class App { public static void main( String[] args ) throws ClassNotFoundException, SQLException { Class.forName("org.apache.hive.jdbc.HiveDriver"); Connection conn=DriverManager.getConnection("jdbc:hive2://192.168.170.100:10000/student"," neworigin","123456 "); PreparedStatement ppst=conn.prepareStatement("select * from jdbchive"); ResultSet rs = ppst.executeQuery(); while(rs.next()){ int id=rs.getInt("id"); String name=rs.getString("name"); int age =rs.getInt("age"); System.out.println(id+","+name+","+age); } conn.close(); ppst.cancel(); rs.close(); } } 【运行结果】 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/Hw_PC/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.4.1/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/Hw_PC/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] 12,chw,22 22,zrt,23 Exception in thread "main" java.sql.SQLException: org.apache.thrift.transport.TTransportException: SASL authentication not complete at org.apache.hive.jdbc.HiveStatement.cancel(HiveStatement.java:174) at org.neworigin.hive.Hive_JDBC.App.main(App.java:24) Caused by: org.apache.thrift.transport.TTransportException: SASL authentication not complete at org.apache.thrift.transport.TSaslTransport.write(TSaslTransport.java:474) at org.apache.thrift.transport.TSaslClientTransport.write(TSaslClientTransport.java:37) at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:178) at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:106) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:70) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) at org.apache.hive.service.rpc.thrift.TCLIService$Client.send_CancelOperation(TCLIService.java:484) at org.apache.hive.service.rpc.thrift.TCLIService$Client.CancelOperation(TCLIService.java:476) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.hive.jdbc.HiveConnection$SynchronizedHandler.invoke(HiveConnection.java:1412) at com.sun.proxy.$Proxy10.CancelOperation(Unknown Source) at org.apache.hive.jdbc.HiveStatement.cancel(HiveStatement.java:168) ... 1 more (库中的数据可以全部提出来,但是后面老是报认证错误。。。。。。不解。。。。)
在eclipse中运行HelloServlet.java,出现404
tomcat显示已经启动了,但为什么出现404,http://localhost:8080页面也打不开, 错误信息为 七月 22, 2013 9:32:57 上午 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;D:\app\Administrator\product\11.1.0\db_1\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;D:\Program Files\Java\jdk1.7.0_01\bin;;E:\eclipse;;. 七月 22, 2013 9:32:57 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Test123' did not find a matching property. 七月 22, 2013 9:32:57 上午 org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] 七月 22, 2013 9:32:57 上午 org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] 七月 22, 2013 9:32:57 上午 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 989 ms 七月 22, 2013 9:32:57 上午 org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina 七月 22, 2013 9:32:57 上午 org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.42 七月 22, 2013 9:32:58 上午 org.apache.catalina.util.SessionIdGenerator createSecureRandom INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [109] milliseconds. 七月 22, 2013 9:32:58 上午 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] 七月 22, 2013 9:32:58 上午 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] 七月 22, 2013 9:32:58 上午 org.apache.catalina.startup.Catalina start INFO: Server startup in 724 ms 七月 22, 2013 9:33:36 上午 org.apache.catalina.core.StandardServer await INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance. 七月 22, 2013 9:33:36 上午 org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-bio-8080"] 七月 22, 2013 9:33:36 上午 org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ajp-bio-8009"] 七月 22, 2013 9:33:36 上午 org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina 七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8080"] 七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"] 七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8080"] 七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
struts2 找不到action 页面404
QAQ大晚上的有没有人啊啊啊啊呜呜呜 struts.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="DoudouShop" extends="struts-default"> <action name="login" class="doudou.struts.aciton.AdminAction"> <result name="success">/loginsuccess.jsp</result> <result name="error">/loginerror.jsp</result> </action> </package> </struts> web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>DoudouShop</display-name> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> AdminAction.java package doudou.struts.action; import com.opensymphony.xwork2.ActionSupport; import doudou.service.AdminServiceImpl; public class AdminAction extends ActionSupport { private String adminType; private String loginPwd; private String loginName; private String adminName; public String getAdminType() { return adminType; } public void setAdminType(String adminType) { this.adminType = adminType; } public String getLoginPwd() { return loginPwd; } public void setLoginPwd(String loginPwd) { this.loginPwd = loginPwd; } public String getLoginName() { return loginName; } public void setLoginName(String loginName) { this.loginName = loginName; } public String getAdminName() { return adminName; } public void setAdminName(String adminName) { this.adminName = adminName; } public String adminLogin() throws Exception{ AdminServiceImpl b=new AdminServiceImpl(); if(b.adminLogin(loginName, loginPwd)==null) return"success"; else return"error"; } } 我运行最基本的jsp(没加任何内容) 还是显示404啊为什么啊 六月 12, 2016 12:55:27 上午 org.apache.catalina.core.StandardContext startInternal 严重: One or more Filters failed to start. Full details will be found in the appropriate container log file 六月 12, 2016 12:55:27 上午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/DoudouMall] startup failed due to previous errors 六月 12, 2016 12:55:28 上午 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 六月 12, 2016 12:55:29 上午 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter struts2 Unable to load configuration. - action - file:/D:/JEEworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/DoudouShop/WEB-INF/classes/struts.xml:7:71 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:501) 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:279) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4908) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5602) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562) 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:/D:/JEEworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/DoudouShop/WEB-INF/classes/struts.xml:7:71 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489) ... 14 more Caused by: Action class [doudou.struts.aciton.AdminAction] not found - action - file:/D:/JEEworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/DoudouShop/WEB-INF/classes/struts.xml:7:71 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:482) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:426) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:552) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292) at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:258) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) ... 16 more 六月 12, 2016 12:55:29 上午 org.apache.catalina.core.StandardContext startInternal 严重: One or more Filters failed to start. Full details will be found in the appropriate container log file 六月 12, 2016 12:55:29 上午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/DoudouShop] startup failed due to previous errors 六月 12, 2016 12:55:29 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 六月 12, 2016 12:55:29 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 六月 12, 2016 12:55:29 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 12908 ms
tomcat启动struts1.3项目超时,如何解决?
我的struts1.3项目在以前的网络(A城市的电信)下是启动起来的,现在换了网络(B城市的移动)启动不起来了,我在怀疑是不是eclipse读取dtd文件的时候太慢了。导致启动失败,在工作过程中,我也有tomcat启动超过45秒的情况,一般是把tomcat timeout配置更长,可是这很不科学,因为他在启动的时候就卡住了,你把tomcat启动允许最大时间配置的再长也无法。 控制台输出如下: ``` 九月 05, 2016 9:29:17 下午 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\jdk\jdk_7u79\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/jdk/jdk_7u79/bin/../jre/bin/client;C:/jdk/jdk_7u79/bin/../jre/bin;C:/jdk/jdk_7u79/bin/../jre/lib/i386;D:\app\Administrator\product\11.2.0\dbhome_1\bin;C:\jdk\jdk_7u79\bin;C:\Windows\System32;C:\Program Files\Subversion\bin;C:\Program Files\TortoiseSVN\bin;D:\maven\apache-maven-3.3.9\bin;;C:\Windows;C:\Windows\system32\wbem;D:\mysql-5.6.24-win32\bin;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;D:\JavaTools\eclipse;;. 九月 05, 2016 9:29:18 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:FileUpdateAndDownload' did not find a matching property. 九月 05, 2016 9:29:19 下午 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-6789 九月 05, 2016 9:29:19 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 2486 ms 九月 05, 2016 9:29:19 下午 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 九月 05, 2016 9:29:19 下午 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.44 九月 05, 2016 9:29:21 下午 org.apache.struts.action.ActionServlet initChain 信息: Loading chain catalog from jar:file:/D:/JavaProgram/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/FileUpdateAndDownload/WEB-INF/lib/struts-core-1.3.10.jar!/org/apache/struts/chain/chain-config.xml ``` 我的struts-config.xml配置如下: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-Apache Software Foundation//DTD struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> <struts-config> <!-- 配置表单 --> <form-beans> <form-bean name="loginForm" type="com.shizongger.web.form.LoginForm" /> </form-beans> <!-- 配置action --> <action-mappings> <action path="/login" name="loginForm" type="com.shizongger.web.action.LoginAction" > <forward name="success" path="WEB-INF/users/main.jsp" /> <forward name="fail" path="WEB-INF/users/login.jsp" /> </action> </action-mappings> </struts-config> ``` web.xml配置如下: ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/config/struts-config.xml</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> </web-app> ```
ssh配置error
tomcat启动时包了这样的错误 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br />at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br />at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br />at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br />at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br />at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br />at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br />at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br />at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br />at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br />at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br />at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br />at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br />at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br />at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br />at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br />at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br />at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br />at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br />at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br />at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br />at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br />at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br />at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br />at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br />at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br />at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br />at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br />at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br />at java.lang.reflect.Method.invoke(Method.java:585) <br />at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br />at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br />... 40 more <br />2008-09-15 11:13:02,694 INFO [org.apache.struts.action.ActionServlet] - &lt;loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml=""&gt; <br />2008-09-15 11:13:03,882 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started=""&gt; <br />2008-09-15 11:13:03,898 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br />at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br />at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br />at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br />at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br />at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br />at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br />at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br />at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br />at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br />at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br />at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br />at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br />at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br />at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br />at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br />at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br />at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br />at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br />at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br />at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br />at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br />at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br />at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br />at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br />at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br />at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br />at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br />at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br />at java.lang.reflect.Method.invoke(Method.java:585) <br />at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br />at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br />... 40 more <br />我的applicationContext.xml是这样配置的 <br />&lt;bean id="dataSource" &lt;br=""&gt;class="org.springframework.jndi.JndiObjectFactoryBean"&gt; <br />&lt;property name="jndiName" value="java:comp/env/jdbc/mldn"&gt;&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean id="sessionFactory" &lt;br=""&gt;class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt; <br />&lt;property name="dataSource"&gt; <br />&lt;ref bean="dataSource"&gt; <br />&lt;/property&gt; <br />&lt;property name="hibernateProperties"&gt; <br />&lt;props&gt; <br />&lt;prop key="hibernate.dialect"&gt; <br />org.hibernate.dialect.MySQLDialect <br />&lt;/prop&gt; <br />&lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; <br />&lt;prop key="hibernate.autocommit"&gt;true&lt;/prop&gt; <br />&lt;/props&gt; <br />&lt;/property&gt; <br />&lt;property name="mappingResources"&gt; <br />&lt;list&gt; <br />&lt;value&gt;com/db/mznt/vo/TUser.hbm.xml&lt;/value&gt; <br />&lt;/list&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean id="hibernateTemplate" &lt;br=""&gt;class="org.springframework.orm.hibernate3.HibernateTemplate"&gt; <br />&lt;property name="sessionFactory"&gt; <br />&lt;ref bean="sessionFactory"&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean id="t_userdao" class="com.db.mznt.dao.t_userDAO" &lt;br=""&gt;abstract="true"&gt; <br />&lt;/bean&gt; <br />&lt;bean id="t_userdaoimpl" class="com.db.mznt.daoimpl.t_userDAOImpl" &lt;br=""&gt;parent="t_userdao"&gt; <br />&lt;property name="hibernateTemplate"&gt; <br />&lt;ref bean="hibernateTemplate"&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean name="/jsp/user" &lt;br=""&gt;class="com.db.mznt.struts.action.UserAction"&gt; <br />&lt;property name="t_userdao"&gt; <br />&lt;ref bean="t_userdaoimpl"&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;/beans&gt;<br /><strong>问题补充:</strong><br />我在web.xml中是这样啊应该没错啊 <br />&lt;context-param&gt; <br /> &lt;param-name&gt;contxtConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt; <br /> /WEB-INF/classes/applicationContext.xml <br /> &lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;context&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.springframework.web.context.ContextLoaderServlet <br /> &lt;/servlet-class&gt; <br /> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; <br /> &lt;/servlet&gt;<br /><strong>问题补充:</strong><br />做了和原来一样错误<br /><strong>问题补充:</strong><br />我是这样写的啊 <br />&lt;param-value&gt;/WEB-INF/classes/applicationContext.xml&lt;/param-value&gt;<br /><strong>问题补充:</strong><br />我是这样写的没错啊 <br />但不知道为什么报错时说我写的是/WEB-INF/applicationContext.xml <br />其实我一直是这样写的 <br />&lt;context-param&gt; <br /> &lt;param-name&gt;contxtConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt; <br /> /WEB-INF/classes/applicationContext.xml <br /> &lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;context&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.springframework.web.context.ContextLoaderServlet <br /> &lt;/servlet-class&gt; <br /> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br /><strong>问题补充:</strong><br />我是按你说的那样做的 <br />就是包的这个错误 <br />不知道是不是其他别的地方的错误<br /><strong>问题补充:</strong><br />按你说的做了 <br />结果是 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) <br /> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) <br /> at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) <br /> at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) <br /> at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) <br /> ... 41 more <br />2008-09-15 16:19:03,468 INFO [org.apache.struts.action.ActionServlet] - &lt;loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml=""&gt; <br />2008-09-15 16:19:04,625 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started=""&gt; <br />2008-09-15 16:19:04,640 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) <br /> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) <br /> at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) <br /> at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) <br /> at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) <br /> ... 41 more <br />2008-09-15 16:19:04,656 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.&gt; <br />2008-09-15 16:19:04,656 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh.properties Not Found.&gt; <br />2008-9-15 16:19:04 org.apache.catalina.core.StandardHostDeployer install<br /><strong>问题补充:</strong><br />全部是meeclipse自动运行配置的我只补充了部分内容<br /><strong>问题补充:</strong><br />我配置了问题任然存在<br /><strong>问题补充:</strong><br />刚才这个beans的问题是我刚才该了东西该错了<br /><strong>问题补充:</strong><br />这是现在的错误 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br /> ... 40 more <br />2008-09-15 16:43:26,453 INFO [org.apache.struts.action.ActionServlet] - &lt;loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml=""&gt; <br />2008-09-15 16:43:27,921 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started=""&gt; <br />2008-09-15 16:43:27,937 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br /> ... 40 more <br />2008-09-15 16:43:27,937 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.&gt; <br />2008-09-15 16:43:27,937 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh.properties Not Found.&gt; <br />2008-9-15 16:43:27 org.apache.catalina.core.StandardHostDeployer install<br /><strong>问题补充:</strong><br />这是我的web.xml <br /> <br />&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee" &lt;br=""&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" <br /> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt; <br /> &lt;filter&gt; <br /> &lt;filter-name&gt;encoding&lt;/filter-name&gt; <br /> &lt;filter-class&gt;com.db.mznt.filter.EncodingFilter&lt;/filter-class&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;charset&lt;/param-name&gt; <br /> &lt;param-value&gt;utf-8&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;/filter&gt; <br /> &lt;filter-mapping&gt; <br /> &lt;filter-name&gt;encoding&lt;/filter-name&gt; <br /> &lt;url-pattern&gt;/*&lt;/url-pattern&gt; <br /> &lt;/filter-mapping&gt; <br /> &lt;context-param&gt; <br /> &lt;param-name&gt;contxtConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt; <br /> /WEB-INF/classes/applicationContext.xml <br /> &lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;context-param&gt; <br /> &lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt;/WEB-INF/classes/log4j.properties&lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;context&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.springframework.web.context.ContextLoaderServlet <br /> &lt;/servlet-class&gt; <br /> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; <br /> &lt;/servlet&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;action&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.apache.struts.action.ActionServlet <br /> &lt;/servlet-class&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;config&lt;/param-name&gt; <br /> &lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;debug&lt;/param-name&gt; <br /> &lt;param-value&gt;3&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;detail&lt;/param-name&gt; <br /> &lt;param-value&gt;3&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;load-on-startup&gt;0&lt;/load-on-startup&gt; <br /> &lt;/servlet&gt; <br /> &lt;servlet-mapping&gt; <br /> &lt;servlet-name&gt;action&lt;/servlet-name&gt; <br /> &lt;url-pattern&gt;*.do&lt;/url-pattern&gt; <br /> &lt;/servlet-mapping&gt; <br /> &lt;welcome-file-list&gt; <br /> &lt;welcome-file&gt;jsp/register.jsp&lt;/welcome-file&gt; <br /> &lt;/welcome-file-list&gt; <br />&lt;/web-app&gt; <br /> <br /><br /><strong>问题补充:</strong><br />这是我的applicationContext.xml <br /> <br />&lt;beans xmlns="http://www.springframework.org/schema/beans" &lt;br=""&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <br /> xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt; <br /> <br /> <br /> &lt;bean id="dataSource" &lt;br=""&gt; class="org.springframework.jndi.JndiObjectFactoryBean"&gt; <br /> &lt;property name="jndiName" value="java:comp/env/jdbc/mldn"&gt;&lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="sessionFactory" &lt;br=""&gt; class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt; <br /> &lt;property name="dataSource"&gt; <br /> &lt;ref bean="dataSource"&gt; <br /> &lt;/property&gt; <br /> &lt;property name="hibernateProperties"&gt; <br /> &lt;props&gt; <br /> &lt;prop key="hibernate.dialect"&gt; <br /> org.hibernate.dialect.MySQLDialect <br /> &lt;/prop&gt; <br /> &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; <br /> &lt;prop key="hibernate.connection.autocommit"&gt;true&lt;/prop&gt; <br /> &lt;/props&gt; <br /> &lt;/property&gt; <br /> &lt;property name="mappingResources"&gt; <br /> &lt;list&gt; <br /> &lt;value&gt;com/db/mznt/vo/TUser.hbm.xml&lt;/value&gt; <br /> &lt;/list&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="hibernateTemplate" &lt;br=""&gt; class="org.springframework.orm.hibernate3.HibernateTemplate"&gt; <br /> &lt;property name="sessionFactory"&gt; <br /> &lt;ref bean="sessionFactory"&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="t_userdao" class="com.db.mznt.dao.t_userDAO" &lt;br=""&gt; abstract="true"&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="t_userdaoimpl" class="com.db.mznt.daoimpl.t_userDAOImpl" &lt;br=""&gt; parent="t_userdao"&gt; <br /> &lt;property name="hibernateTemplate"&gt; <br /> &lt;ref bean="hibernateTemplate"&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean name="/jsp/user" &lt;br=""&gt; class="com.db.mznt.struts.action.UserAction"&gt; <br /> &lt;property name="t_userdao"&gt; <br /> &lt;ref bean="t_userdaoimpl"&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br />&lt;/beans&gt;<br /><strong>问题补充:</strong><br />这是我的struts-config.xml <br /> <br /> <br /> <br />&lt;struts-config&gt; <br /> &lt;form-beans&gt; <br /> &lt;form-bean name="userForm" &lt;br=""&gt; type="com.db.mznt.struts.form.UserForm" /&gt; <br /> <br /> &lt;/form-beans&gt; <br /> <br /> &lt;global-exceptions&gt; <br /> &lt;global-forwards&gt; <br /> &lt;action-mappings&gt; <br /> &lt;action attribute="userForm" input="/jsp/errors.jsp" &lt;br=""&gt; name="userForm" parameter="status" path="/jsp/user" scope="request" <br /> type="com.db.mznt.struts.action.UserAction"&gt; <br /> &lt;forward name="registersuccess" &lt;br=""&gt; path="/jsp/registerSuccess.jsp"&gt; <br /> &lt;/forward&gt; <br /> &lt;forward name="registerfalure" path="/jsp/register.jsp"&gt;&lt;/forward&gt; <br /> &lt;/action&gt; <br /> <br /> &lt;/action-mappings&gt; <br /> <br /> &lt;controller &lt;br=""&gt; processorClass="org.springframework.web.struts.DelegatingRequestProcessor"&gt; <br /> &lt;/controller&gt; <br /> &lt;message-resources &lt;br=""&gt; parameter="com.db.mznt.struts.ApplicationResources" /&gt; <br /> &lt;plug-in &lt;br=""&gt; className="org.springframework.web.struts.ContextLoaderPlugIn"&gt; <br /> &lt;set-property property="contxtConfigLocation" &lt;br=""&gt; value="/WEB-INF/classes/applicationContext.xml" /&gt; <br /> &lt;/plug-in&gt; <br /> <br />&lt;/struts-config&gt; <br /> <br /><br /><strong>问题补充:</strong><br />改了还是包那个错<br /><strong>问题补充:</strong><br />都该了<br /><strong>问题补充:</strong><br />先在错误编程了 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context <br /> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)<br /><strong>问题补充:</strong><br />我这样写的好像还是有点问题 <br /> <br />&lt;context path="/mldn"&gt; <br /> &lt;resource name="java:comp/env/jdbc/mldn" type="javax.sql.DataSource" &lt;br=""&gt; username="root" password="ads" driverClassName="com.mysql.jdbc.Driver" <br /> url="jdbc:mysql://localhost:3306/mldn" maxActive="4" maxIdle="2" /&gt; <br />&lt;/context&gt; <br /><br /><strong>问题补充:</strong><br />改后怎么还是包这个错 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context<br /><strong>问题补充:</strong><br />applicationContext.xml中我用的是 <br />&lt;bean id="dataSource" &lt;br=""&gt; class="org.springframework.jndi.JndiObjectFactoryBean"&gt; <br /> &lt;property name="jndiName" value="java:comp/env/jdbc/mldn"&gt;&lt;/property&gt; <br /> &lt;/bean&gt;<br /><strong>问题补充:</strong><br />现在的问题是 <br />ERROR [org.hibernate.util.JDBCExceptionReporter] - &lt;cannot create="" jdbc="" driver="" of="" class="" ''="" for="" connect="" url="" 'null'=""&gt; <br />2008-09-15 20:37:40,015 WARN [org.hibernate.cfg.SettingsFactory] - &lt;could not="" obtain="" connection="" metadata=""&gt; <br />org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'<br /><strong>问题补充:</strong><br />这个问题一直没解决了 <br />ERROR [org.hibernate.util.JDBCExceptionReporter] - &lt;cannot create="" jdbc="" driver="" of="" class="" ''="" for="" connect="" url="" 'null'=""&gt; <br />2008-09-15 21:56:56,687 WARN [org.hibernate.cfg.SettingsFactory] - &lt;could not="" obtain="" connection="" metadata=""&gt; <br />org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'<br /><strong>问题补充:</strong><br />放进去了的,任然报这个错误。都快郁闷死了<br /><strong>问题补充:</strong><br />好的,谢谢你 <br />sxwave@163.com<br /><strong>问题补充:</strong><br />昨天的问题出在我tomcat中没有配置,但配置好后现在出现了个新问题。问题是 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
hexo博客无法显示背景图片
hexo框架写的博客,主题是next,本地预览可以看到背景,但是真实网站看不到,已经试过先hexo c之后再上传,还是没有用 hexo的配置文件 ``` # Hexo Configuration ## Docs: https://hexo.io/docs/configuration.html ## Source: https://github.com/hexojs/hexo/ # Site title: subtitle: description: 这是一个搞着玩的博客,功能暂未完全完善,将就着看吧您内~! keywords: author: 肖肖 language: zh-Hans timezone: # URL ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' url: http://yoursite.com root: / permalink: :year/:month/:day/:title/ permalink_defaults: # Directory source_dir: source public_dir: public tag_dir: tags archive_dir: archives category_dir: categories code_dir: downloads/code i18n_dir: :lang skip_render: # Writing new_post_name: :title.md # File name of new posts default_layout: post titlecase: false # Transform title into titlecase external_link: true # Open external links in new tab filename_case: 0 render_drafts: false post_asset_folder: true relative_link: false future: true highlight: enable: true line_number: true auto_detect: false tab_replace: # Home page setting # path: Root path for your blogs index page. (default = '') # per_page: Posts displayed per page. (0 = disable pagination) # order_by: Posts order. (Order by date descending by default) index_generator: path: '' per_page: 10 order_by: -date # Category & Tag default_category: uncategorized category_map: tag_map: # Date / Time format ## Hexo uses Moment.js to parse and display date ## You can customize the date format as defined in ## http://momentjs.com/docs/#/displaying/format/ date_format: YYYY-MM-DD time_format: HH:mm:ss # Pagination ## Set per_page to 0 to disable pagination per_page: 10 pagination_dir: page # Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: next # Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repo: branch: master ``` 然后是next的配置文件 ``` # =============================================================== # ========================= ATTENTION! ========================== # =============================================================== # NexT repository is moving here: https://github.com/theme-next # =============================================================== # It's rebase to v6.0.0 and future maintenance will resume there # =============================================================== # --------------------------------------------------------------- # Theme Core Configuration Settings # --------------------------------------------------------------- # Set to true, if you want to fully override the default configuration. # Useful if you don't want to inherit the theme _config.yml configurations. override: false # --------------------------------------------------------------- # Site Information Settings # --------------------------------------------------------------- # To get or check favicons visit: https://realfavicongenerator.net # Put your favicons into `hexo-site/source/` (recommend) or `hexo-site/themes/next/source/images/` directory. # Default NexT favicons placed in `hexo-site/themes/next/source/images/` directory. # And if you want to place your icons in `hexo-site/source/` root directory, you must remove `/images` prefix from pathes. # For example, you put your favicons into `hexo-site/source/images` directory. # Then need to rename & redefine they on any other names, otherwise icons from Next will rewrite your custom icons in Hexo. favicon: small: /images/favicon-16x16-next.png medium: /images/favicon.ico apple_touch_icon: /images/apple-touch-icon-next.png safari_pinned_tab: /images/logo.svg #android_manifest: /images/manifest.json #ms_browserconfig: /images/browserconfig.xml # Set default keywords (Use a comma to separate) keywords: "Hexo, NexT" # Set rss to false to disable feed link. # Leave rss as empty to use site's feed link. # Set rss to specific value if you have burned your feed already. rss: footer: # Specify the date when the site was setup. # If not defined, current year will be used. since: 2019 # Icon between year and copyright info. icon: user # If not defined, will be used `author` from Hexo main config. copyright: # ------------------------------------------------------------- # Hexo link (Powered by Hexo). powered: true theme: # Theme & scheme info link (Theme - NexT.scheme). enable: true # Version info of NexT after scheme info (vX.X.X). version: true # ------------------------------------------------------------- # Any custom text can be defined here. #custom_text: Hosted by <a target="_blank" href="https://pages.github.com">GitHub Pages</a> # --------------------------------------------------------------- # SEO Settings # --------------------------------------------------------------- # Canonical, set a canonical link tag in your hexo, you could use it for your SEO of blog. # See: https://support.google.com/webmasters/answer/139066 # Tips: Before you open this tag, remember set up your URL in hexo _config.yml ( ex. url: http://yourdomain.com ) canonical: true # Change headers hierarchy on site-subtitle (will be main site description) and on all post/pages titles for better SEO-optimization. seo: false # If true, will add site-subtitle to index page, added in main hexo config. # subtitle: Subtitle index_with_subtitle: false # --------------------------------------------------------------- # Menu Settings # --------------------------------------------------------------- # When running the site in a subdirectory (e.g. domain.tld/blog), remove the leading slash from link value (/archives -> archives). # Usage: `Key: /link/ || icon` # Key is the name of menu item. If translate for this menu will find in languages - this translate will be loaded; if not - Key name will be used. Key is case-senstive. # Value before `||` delimeter is the target link. # Value after `||` delimeter is the name of FontAwesome icon. If icon (with or without delimeter) is not specified, question icon will be loaded. menu: home: / || home #about: /about/ || user #tags: /tags/ || tags #categories: /categories/ || th archives: /archives/ || archive #schedule: /schedule/ || calendar #sitemap: /sitemap.xml || sitemap #commonweal: /404/ || heartbeat # Enable/Disable menu icons. menu_icons: enable: true # --------------------------------------------------------------- # Scheme Settings # --------------------------------------------------------------- # Schemes #scheme: Muse #scheme: Mist #scheme: Pisces scheme: Gemini # --------------------------------------------------------------- # Sidebar Settings # --------------------------------------------------------------- # Social Links. # Usage: `Key: permalink || icon` # Key is the link label showing to end users. # Value before `||` delimeter is the target permalink. # Value after `||` delimeter is the name of FontAwesome icon. If icon (with or without delimeter) is not specified, globe icon will be loaded. #social: #GitHub: https://github.com/yourname || github #E-Mail: mailto:yourname@gmail.com || envelope #Google: https://plus.google.com/yourname || google #Twitter: https://twitter.com/yourname || twitter #FB Page: https://www.facebook.com/yourname || facebook #VK Group: https://vk.com/yourname || vk #StackOverflow: https://stackoverflow.com/yourname || stack-overflow #YouTube: https://youtube.com/yourname || youtube #Instagram: https://instagram.com/yourname || instagram #Skype: skype:yourname?call|chat || skype social_icons: enable: true icons_only: false transition: false # Blog rolls links_icon: link links_title: Links links_layout: block #links_layout: inline #links: #Title: http://example.com/ # Sidebar Avatar # in theme directory(source/images): /images/avatar.gif # in site directory(source/uploads): /uploads/avatar.gif avatar: /images/avatar.png # Table Of Contents in the Sidebar toc: enable: true # Automatically add list number to toc. number: true # If true, all words will placed on next lines if header width longer then sidebar width. wrap: false # Creative Commons 4.0 International License. # http://creativecommons.org/ # Available: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | zero #creative_commons: by-nc-sa #creative_commons: sidebar: # Sidebar Position, available value: left | right (only for Pisces | Gemini). position: left #position: right # Sidebar Display, available value (only for Muse | Mist): # - post expand on posts automatically. Default. # - always expand for all pages automatically # - hide expand only when click on the sidebar toggle icon. # - remove Totally remove sidebar including sidebar toggle. display: post #display: always #display: hide #display: remove # Sidebar offset from top menubar in pixels (only for Pisces | Gemini). offset: 12 # Back to top in sidebar (only for Pisces | Gemini). b2t: false # Scroll percent label in b2t button. scrollpercent: true # Enable sidebar on narrow view (only for Muse | Mist). onmobile: true # --------------------------------------------------------------- # Post Settings # --------------------------------------------------------------- # Automatically scroll page to section which is under <!-- more --> mark. scroll_to_more: true # Automatically saving scroll position on each post/page in cookies. save_scroll: false # Automatically excerpt description in homepage as preamble text. excerpt_description: true # Automatically Excerpt. Not recommend. # Please use <!-- more --> in the post to control excerpt accurately. auto_excerpt: enable: true length: 0 # Post meta display settings post_meta: item_text: true created_at: true updated_at: false categories: true # Post wordcount display settings # Dependencies: https://github.com/willin/hexo-wordcount post_wordcount: item_text: true wordcount: true min2read: true totalcount: false separated_meta: true # Wechat Subscriber #wechat_subscriber: #enabled: true #qcode: /path/to/your/wechatqcode ex. /uploads/wechat-qcode.jpg #description: ex. subscribe to my blog by scanning my public wechat account # Reward #reward_comment: Donate comment here #wechatpay: /images/wechatpay.jpg #alipay: /images/alipay.jpg #bitcoin: /images/bitcoin.png # Declare license on posts post_copyright: enable: false license: CC BY-NC-SA 3.0 license_url: https://creativecommons.org/licenses/by-nc-sa/3.0/ # --------------------------------------------------------------- # Misc Theme Settings # --------------------------------------------------------------- # Reduce padding / margin indents on devices with narrow width. mobile_layout_economy: false # Android Chrome header panel color ($black-deep). android_chrome_color: "#222" # Custom Logo. # !!Only available for Default Scheme currently. # Options: # enabled: [true/false] - Replace with specific image # image: url-of-image - Images's url custom_logo: enabled: true image: # Code Highlight theme # Available value: # normal | night | night eighties | night blue | night bright # https://github.com/chriskempson/tomorrow-theme highlight_theme: normal # --------------------------------------------------------------- # Font Settings # - Find fonts on Google Fonts (https://www.google.com/fonts) # - All fonts set here will have the following styles: # light, light italic, normal, normal italic, bold, bold italic # - Be aware that setting too much fonts will cause site running slowly # - Introduce in 5.0.1 # --------------------------------------------------------------- # CAUTION! Safari Version 10.1.2 bug: https://github.com/iissnan/hexo-theme-next/issues/1844 # To avoid space between header and sidebar in Pisces / Gemini themes recommended to use Web Safe fonts for `global` (and `logo`): # Arial | Tahoma | Helvetica | Times New Roman | Courier New | Verdana | Georgia | Palatino | Garamond | Comic Sans MS | Trebuchet MS # --------------------------------------------------------------- font: enable: true # Uri of fonts host. E.g. //fonts.googleapis.com (Default). host: # Font options: # `external: true` will load this font family from `host` above. # `family: Times New Roman`. Without any quotes. # `size: xx`. Use `px` as unit. # Global font settings used on <body> element. global: external: true family: Lato size: # Font settings for Headlines (h1, h2, h3, h4, h5, h6). # Fallback to `global` font settings. headings: external: true family: size: # Font settings for posts. # Fallback to `global` font settings. posts: external: true family: # Font settings for Logo. # Fallback to `global` font settings. logo: external: true family: size: # Font settings for <code> and code blocks. codes: external: true family: size: # --------------------------------------------------------------- # Third Party Services Settings # --------------------------------------------------------------- # MathJax Support mathjax: enable: false per_page: false cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML # Han Support docs: https://hanzi.pro/ han: false # Swiftype Search API Key #swiftype_key: # Baidu Analytics ID #baidu_analytics: # Duoshuo ShortName #duoshuo_shortname: # Disqus disqus: enable: false shortname: count: true # Hypercomments #hypercomments_id: # changyan changyan: enable: false appid: appkey: # Valine. # You can get your appid and appkey from https://leancloud.cn # more info please open https://valine.js.org valine: enable: true appid: appkey: notify: false # mail notifier , https://github.com/xCss/Valine/wiki verify: false # Verification code placeholder: 高冷的你说点什么吧( ´・・)ノ(._.`) avatar: mm # gravatar style guest_info: nick,mail,link # custom comment header pageSize: 10 # pagination size # Support for youyan comments system. # You can get your uid from http://www.uyan.cc #youyan_uid: your uid # Support for LiveRe comments system. # You can get your uid from https://livere.com/insight/myCode (General web site) #livere_uid: your uid # Gitment # Introduction: https://imsun.net/posts/gitment-introduction/ # You can get your Github ID from https://api.github.com/users/<Github username> gitment: enable: false mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway count: true # Show comments count in post meta area lazy: false # Comments lazy loading with a button cleanly: false # Hide 'Powered by ...' on footer, and more language: # Force language, or auto switch by theme github_user: # MUST HAVE, Your Github ID github_repo: # MUST HAVE, The repo you use to store Gitment comments client_id: # MUST HAVE, Github client id for the Gitment client_secret: # EITHER this or proxy_gateway, Github access secret token for the Gitment proxy_gateway: # Address of api proxy, See: https://github.com/aimingoo/intersect redirect_protocol: # Protocol of redirect_uri with force_redirect_protocol when mint enabled # Baidu Share # Available value: # button | slide # Warning: Baidu Share does not support https. #baidushare: ## type: button # Share # This plugin is more useful in China, make sure you known how to use it. # And you can find the use guide at official webiste: http://www.jiathis.com/. # Warning: JiaThis does not support https. #jiathis: ##uid: Get this uid from http://www.jiathis.com/ #add_this_id: # Share duoshuo_share: true # NeedMoreShare2 # This plugin is a pure javascript sharing lib which is useful in China. # See: https://github.com/revir/need-more-share2 # Also see: https://github.com/DzmVasileusky/needShareButton # iconStyle: default | box # boxForm: horizontal | vertical # position: top / middle / bottom + Left / Center / Right networks: Weibo,Wechat,Douban,QQZone,Twitter,Linkedin,Mailto,Reddit, # Delicious,StumbleUpon,Pinterest,Facebook,GooglePlus,Slashdot, # Technorati,Posterous,Tumblr,GoogleBookmarks,Newsvine, # Evernote,Friendfeed,Vkontakte,Odnoklassniki,Mailru needmoreshare2: enable: false postbottom: enable: false options: iconStyle: box boxForm: horizontal position: bottomCenter networks: Weibo,Wechat,Douban,QQZone,Twitter,Facebook float: enable: false options: iconStyle: box boxForm: horizontal position: middleRight networks: Weibo,Wechat,Douban,QQZone,Twitter,Facebook # Google Webmaster tools verification setting # See: https://www.google.com/webmasters/ #google_site_verification: # Google Analytics #google_analytics: # Bing Webmaster tools verification setting # See: https://www.bing.com/webmaster/ #bing_site_verification: # Yandex Webmaster tools verification setting # See: https://webmaster.yandex.ru/ #yandex_site_verification: # CNZZ count #cnzz_siteid: # Application Insights # See https://azure.microsoft.com/en-us/services/application-insights/ # application_insights: # Make duoshuo show UA # user_id must NOT be null when admin_enable is true! # you can visit http://dev.duoshuo.com get duoshuo user id. duoshuo_info: ua_enable: true admin_enable: false user_id: 0 #admin_nickname: Author # Post widgets & FB/VK comments settings. # --------------------------------------------------------------- # Facebook SDK Support. # https://github.com/iissnan/hexo-theme-next/pull/410 facebook_sdk: enable: false app_id: #<app_id> fb_admin: #<user_id> like_button: #true webmaster: #true # Facebook comments plugin # This plugin depends on Facebook SDK. # If facebook_sdk.enable is false, Facebook comments plugin is unavailable. facebook_comments_plugin: enable: false num_of_posts: 10 # min posts num is 1 width: 100% # default width is 550px scheme: light # default scheme is light (light or dark) # VKontakte API Support. # To get your AppID visit https://vk.com/editapp?act=create vkontakte_api: enable: false app_id: #<app_id> like: true comments: true num_of_posts: 10 # Star rating support to each article. # To get your ID visit https://widgetpack.com rating: enable: false id: #<app_id> color: fc6423 # --------------------------------------------------------------- # Show number of visitors to each article. # You can visit https://leancloud.cn get AppID and AppKey. leancloud_visitors: enable: false app_id: #<app_id> app_key: #<app_key> # Another tool to show number of visitors to each article. # visit https://console.firebase.google.com/u/0/ to get apiKey and projectId # visit https://firebase.google.com/docs/firestore/ to get more information about firestore firestore: enable: false collection: articles #required, a string collection name to access firestore database apiKey: #required projectId: #required bluebird: false #enable this if you want to include bluebird 3.5.1(core version) Promise polyfill # Show PV/UV of the website/page with busuanzi. # Get more information on http://ibruce.info/2015/04/04/busuanzi/ busuanzi_count: # count values only if the other configs are false enable: true # custom uv span for the whole site site_uv: true site_uv_header: 本站访问人数 site_uv_footer: 人次 # custom pv span for the whole site site_pv: true site_pv_header: 本站访问量 site_pv_footer: 次 # custom pv span for one page only page_pv: true page_pv_header: 本文阅读量 page_pv_footer: 次 # Tencent analytics ID # tencent_analytics: # Tencent MTA ID # tencent_mta: # Enable baidu push so that the blog will push the url to baidu automatically which is very helpful for SEO baidu_push: false # Google Calendar # Share your recent schedule to others via calendar page # # API Documentation: # https://developers.google.com/google-apps/calendar/v3/reference/events/list calendar: enable: false calendar_id: <required> api_key: <required> orderBy: startTime offsetMax: 24 offsetMin: 4 timeZone: showDeleted: false singleEvents: true maxResults: 250 # Algolia Search algolia_search: enable: false hits: per_page: 10 labels: input_placeholder: Search for Posts hits_empty: "We didn't find any results for the search: ${query}" hits_stats: "${hits} results found in ${time} ms" # Local search # Dependencies: https://github.com/flashlab/hexo-generator-search local_search: enable: true # if auto, trigger search by changing input # if manual, trigger search by pressing enter key or search button trigger: auto # show top n results per article, show all results by setting to -1 top_n_per_article: 1 # --------------------------------------------------------------- # Tags Settings # --------------------------------------------------------------- # External URL with BASE64 encrypt & decrypt. # Usage: {% exturl text url "title" %} # Alias: {% extlink text url "title" %} exturl: false # Note tag (bs-callout). note: # Note tag style values: # - simple bs-callout old alert style. Default. # - modern bs-callout new (v2-v3) alert style. # - flat flat callout style with background, like on Mozilla or StackOverflow. # - disabled disable all CSS styles import of note tag. style: simple icons: false border_radius: 3 # Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6). # Offset also applied to label tag variables. This option can work with disabled note tag. light_bg_offset: 0 # Label tag. label: true # Tabs tag. tabs: enable: true transition: tabs: false labels: true border_radius: 0 #! --------------------------------------------------------------- #! DO NOT EDIT THE FOLLOWING SETTINGS #! UNLESS YOU KNOW WHAT YOU ARE DOING #! --------------------------------------------------------------- # Use velocity to animate everything. motion: enable: true async: false transition: # Transition variants: # fadeIn | fadeOut | flipXIn | flipXOut | flipYIn | flipYOut | flipBounceXIn | flipBounceXOut | flipBounceYIn | flipBounceYOut # swoopIn | swoopOut | whirlIn | whirlOut | shrinkIn | shrinkOut | expandIn | expandOut # bounceIn | bounceOut | bounceUpIn | bounceUpOut | bounceDownIn | bounceDownOut | bounceLeftIn | bounceLeftOut | bounceRightIn | bounceRightOut # slideUpIn | slideUpOut | slideDownIn | slideDownOut | slideLeftIn | slideLeftOut | slideRightIn | slideRightOut # slideUpBigIn | slideUpBigOut | slideDownBigIn | slideDownBigOut | slideLeftBigIn | slideLeftBigOut | slideRightBigIn | slideRightBigOut # perspectiveUpIn | perspectiveUpOut | perspectiveDownIn | perspectiveDownOut | perspectiveLeftIn | perspectiveLeftOut | perspectiveRightIn | perspectiveRightOut post_block: fadeIn post_header: slideDownIn post_body: slideDownIn coll_header: slideLeftIn # Only for Pisces | Gemini. sidebar: slideUpIn # Fancybox fancybox: true # Progress bar in the top during page loading. pace: true # Themes list: #pace-theme-big-counter #pace-theme-bounce #pace-theme-barber-shop #pace-theme-center-atom #pace-theme-center-circle #pace-theme-center-radar #pace-theme-center-simple #pace-theme-corner-indicator #pace-theme-fill-left #pace-theme-flash #pace-theme-loading-bar #pace-theme-mac-osx #pace-theme-minimal # For example # pace_theme: pace-theme-center-simple pace_theme: pace-theme-minimal # Canvas-nest canvas_nest: true # three_waves three_waves: false # canvas_lines canvas_lines: false # canvas_sphere canvas_sphere: false # Only fit scheme Pisces # Canvas-ribbon # size: The width of the ribbon. # alpha: The transparency of the ribbon. # zIndex: The display level of the ribbon. canvas_ribbon: enable: false size: 300 alpha: 0.6 zIndex: -1 # Script Vendors. # Set a CDN address for the vendor you want to customize. # For example # jquery: https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js # Be aware that you should use the same version as internal ones to avoid potential problems. # Please use the https protocol of CDN files when you enable https on your site. vendors: # Internal path prefix. Please do not edit it. _internal: lib # Internal version: 2.1.3 jquery: # Internal version: 2.1.5 # See: http://fancyapps.com/fancybox/ fancybox: fancybox_css: # Internal version: 1.0.6 # See: https://github.com/ftlabs/fastclick fastclick: # Internal version: 1.9.7 # See: https://github.com/tuupola/jquery_lazyload lazyload: # Internal version: 1.2.1 # See: http://VelocityJS.org velocity: # Internal version: 1.2.1 # See: http://VelocityJS.org velocity_ui: # Internal version: 0.7.9 # See: https://faisalman.github.io/ua-parser-js/ ua_parser: # Internal version: 4.6.2 # See: http://fontawesome.io/ fontawesome: # Internal version: 1 # https://www.algolia.com algolia_instant_js: algolia_instant_css: # Internal version: 1.0.2 # See: https://github.com/HubSpot/pace # Or use direct links below: # pace: //cdn.bootcss.com/pace/1.0.2/pace.min.js # pace_css: //cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-flash.min.css pace: pace_css: # Internal version: 1.0.0 # https://github.com/hustcc/canvas-nest.js canvas_nest: # three three: # three_waves # https://github.com/jjandxa/three_waves three_waves: # three_waves # https://github.com/jjandxa/canvas_lines canvas_lines: # three_waves # https://github.com/jjandxa/canvas_sphere canvas_sphere: # Internal version: 1.0.0 # https://github.com/zproo/canvas-ribbon canvas_ribbon: # Internal version: 3.3.0 # https://github.com/ethantw/Han han: # needMoreShare2 # https://github.com/revir/need-more-share2 needMoreShare2: # Assets css: css js: js images: images # Online contact daovoice: true daovoice_app_id: # 这里填你刚才获得的 app_id # Theme version live2d: enable: false model: z16 bottom: -30 version: 5.1.4 ``` 已经折腾了两天了,就差回档了,感觉回档也没有用,小白在此感谢各位大佬了 然后我修改背景图片修改的是Blog\themes\next\source\css\_custom\custom.styl文件 ``` // Custom styles. // 主页文章添加阴影效果 .post { margin-top: 60px; margin-bottom: 60px; padding: 25px; -webkit-box-shadow: 0 0 5px rgba(202, 203, 203, .5); -moz-box-shadow: 0 0 5px rgba(202, 203, 204, .5); } .site-meta { background: $orange; //天空的颜色,和我的眼镜是绝配 } // 鼠标样式 * { cursor: url(""),auto!important } :active { cursor: url(""),auto!important } // Custom styles. body { background-image: url(/images/background.jpg); background-attachment: fixed; background-repeat: no-repeat; background-size: cover; //改变背景色和透明度 .main-inner { padding: 25px; opacity: 0.85; border-radius: 10px; right: 0 !important; top: 0 !important; bottom: 0 !important; } } body .main { margin-bottom: 0px; } ```
关于struts2的问题,x新手求指导
初学struts2,跟着网上视频做一个简单的表单校验,但是发布时就出现404错误,截图如下: web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>struts2-3</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> 这是index.jsp: html> <head> </head> <body> <form action="<%=path %>/loginAction.action" method="post"> username: <input type="text" name="username"><br> password: <input type="password" name="password"><br> <input type="submit" name="tijiao"> </form> </body> </html> 这是struts.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="userlogin" extends="struts-default"> <action name="loginAction" class="com.zengyue.action.LoginAction"> <result name="success">/index.jsp</result> </action> </package> </struts> 这是LoginAction.java package com.zengyue.action; import com.opensymphony.xwork2.ActionSupport; public class LoginAction extends ActionSupport{ private String username; private String password; private String excute() throws Exception{ System.out.println("username"); System.out.println("password"); return "success"; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } 这是tomcat 信息: 四月 18, 2017 12:30:05 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:struts2-3' did not find a matching property. 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.0.43 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Mar 28 2017 14:42:59 UTC 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.0.43.0 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 8 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 6.2 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: F:\My_E\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\jre 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.7.0_45-b18 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: F:\tomcat\apache-tomcat-8.0.43 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: F:\tomcat\apache-tomcat-8.0.43 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=F:\tomcat\apache-tomcat-8.0.43 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=F:\tomcat\apache-tomcat-8.0.43 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=F:\tomcat\apache-tomcat-8.0.43\me-webapps 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=F:\tomcat\apache-tomcat-8.0.43\endorsed 四月 18, 2017 12:30:05 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=GBK 四月 18, 2017 12:30:05 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\My_E\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\java\jdk1.8.0_45\bin;C:\Program Files\java\jdk1.8.0_45\jre\bin;E:\adt-bundle-windows-x86_64-20140702\sdk\tools;E:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;C:\Windows\System32;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;F:\Dev-Cpp\MinGW64\bin;C:\Users\月\AppData\Local\Microsoft\WindowsApps;F:\Dev-Cpp\bin\;. 四月 18, 2017 12:30:06 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8080"] 四月 18, 2017 12:30:06 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 四月 18, 2017 12:30:06 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8009"] 四月 18, 2017 12:30:06 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 四月 18, 2017 12:30:06 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 2324 ms 四月 18, 2017 12:30:06 上午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 四月 18, 2017 12:30:06 上午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.0.43 四月 18, 2017 12:30:07 上午 org.apache.tomcat.util.digester.Digester fatalError 严重: Parse Fatal Error at line 1 column 7: 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。 org.xml.sax.SAXParseException; systemId: file:/F:/tomcat/apache-tomcat-8.0.43/me-webapps/struts2-3/WEB-INF/web.xml; lineNumber: 1; columnNumber: 7; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。 四月 18, 2017 12:30:07 上午 org.apache.tomcat.util.descriptor.web.WebXmlParser parseWebXml 严重: Parse error in application web.xml file at file:/F:/tomcat/apache-tomcat-8.0.43/me-webapps/struts2-3/WEB-INF/web.xml org.xml.sax.SAXParseException; systemId: file:/F:/tomcat/apache-tomcat-8.0.43/me-webapps/struts2-3/WEB-INF/web.xml; lineNumber: 1; columnNumber: 7; 不允许有匹配 "[xX][mM][lL]" 的处理指令目标。 四月 18, 2017 12:30:07 上午 org.apache.tomcat.util.descriptor.web.WebXmlParser parseWebXml 严重: Occurred at line 1 column 7 四月 18, 2017 12:30:07 上午 org.apache.catalina.startup.ContextConfig configureStart 严重: Marking this application unavailable due to previous error(s) 四月 18, 2017 12:30:07 上午 org.apache.catalina.core.StandardContext startInternal 严重: One or more components marked the context as not correctly configured 四月 18, 2017 12:30:07 上午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/struts2-3] startup failed due to previous errors 四月 18, 2017 12:30:07 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\docs 四月 18, 2017 12:30:07 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\docs has finished in 196 ms 四月 18, 2017 12:30:07 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\examples 四月 18, 2017 12:30:08 上午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 四月 18, 2017 12:30:08 上午 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\examples has finished in 800 ms 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\host-manager 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\host-manager has finished in 44 ms 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\manager 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\manager has finished in 63 ms 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\ROOT 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory F:\tomcat\apache-tomcat-8.0.43\webapps\ROOT has finished in 62 ms 四月 18, 2017 12:30:08 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8080"] 四月 18, 2017 12:30:08 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8009"] 四月 18, 2017 12:30:08 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 2445 ms
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
Java 14 都快来了,为什么还有这么多人固守Java 8?
从Java 9开始,Java版本的发布就让人眼花缭乱了。每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份,...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
讲真,这两个IDE插件,可以让你写出质量杠杠的代码
周末躺在床上看《拯救大兵瑞恩》 周末在闲逛的时候,发现了两个优秀的 IDE 插件,据说可以提高代码的质量,我就安装了一下,试了试以后发现,确实很不错,就推荐给大家。 01、Alibaba Java 代码规范插件 《阿里巴巴 Java 开发手册》,相信大家都不会感到陌生,其 IDEA 插件的下载次数据说达到了 80 万次,我今天又贡献了一次。嘿嘿。 该项目的插件地址: https://github....
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
2020 年,大火的 Python 和 JavaScript 是否会被取而代之?
Python 和 JavaScript 是目前最火的两大编程语言,但是2020 年,什么编程语言将会取而代之呢? 作者 |Richard Kenneth Eng 译者 |明明如月,责编 | 郭芮 出品 | CSDN(ID:CSDNnews) 以下为译文: Python 和 JavaScript 是目前最火的两大编程语言。然而,他们不可能永远屹立不倒。最终,必将像其他编程语言一...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
Idea 中最常用的10款插件(提高开发效率),一定要学会使用!
学习使用一些插件,可以提高开发效率。对于我们开发人员很有帮助。这篇博客介绍了开发中使用的插件。
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
立即提问