zoukankan      html  css  js  c++  java
  • Caused by: java.net.UnknownHostException: www.mybatis.org

    1、错误描述

    org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error creating document instance.  Cause: java.net.UnknownHostException: www.mybatis.org
    	at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:895)
    	at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:620)
    	at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:590)
    	at org.activiti.engine.impl.test.TestHelper.getProcessEngine(TestHelper.java:229)
    	at org.activiti.engine.test.ActivitiRule.initializeProcessEngine(ActivitiRule.java:237)
    	at org.activiti.engine.test.ActivitiRule.starting(ActivitiRule.java:205)
    	at org.activiti.engine.test.ActivitiRule.startingQuietly(ActivitiRule.java:171)
    	at org.activiti.engine.test.ActivitiRule.access$000(ActivitiRule.java:86)
    	at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:124)
    	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: java.net.UnknownHostException: www.mybatis.org
    	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:136)
    	at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:32)
    	at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:47)
    	at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initMybatisConfiguration(ProcessEngineConfigurationImpl.java:903)
    	at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:891)
    	... 24 more
    Caused by: java.net.UnknownHostException: www.mybatis.org
    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    	at java.net.Socket.connect(Socket.java:579)
    	at java.net.Socket.connect(Socket.java:528)
    	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    	at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
    	at sun.net.www.http.HttpClient.New(HttpClient.java:308)
    	at sun.net.www.http.HttpClient.New(HttpClient.java:326)
    	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
    	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)
    	at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2398)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1557)
    	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:637)
    	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1290)
    	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1257)
    	at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:263)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1164)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1050)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:964)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
    	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
    	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:134)
    	... 28 more
    
    java.lang.NullPointerException
    	at org.activiti.designer.test.ProcessTestMyProcess.startProcess(ProcessTestMyProcess.java:28)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:606)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:126)
    	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    
    org.activiti.engine.ActivitiException: Programmatic error: could not instantiate org.activiti.designer.test.ProcessTestMyProcess
    	at org.activiti.engine.test.ActivitiRule.finished(ActivitiRule.java:269)
    	at org.activiti.engine.test.ActivitiRule.finishedQuietly(ActivitiRule.java:179)
    	at org.activiti.engine.test.ActivitiRule.access$400(ActivitiRule.java:86)
    	at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:135)
    	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    Caused by: java.lang.ClassNotFoundException: org/activiti/designer/test/ProcessTestMyProcess
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:190)
    	at org.activiti.engine.test.ActivitiRule.finished(ActivitiRule.java:266)
    	... 19 more
    

    2、错误原因

            由错误提示,我查找了些资料,网上说缺少mybatis-3-config.dtd


    3、解决办法

          于是下载mybatis-3-config.dtd,将其放到resource下

    <?xml version="1.0" encoding="UTF-8" ?>
    <!--
    
           Copyright 2009-2016 the original author or authors.
    
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
    
              http://www.apache.org/licenses/LICENSE-2.0
    
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
    
    -->
    <!ELEMENT configuration (properties?, settings?, typeAliases?, typeHandlers?, objectFactory?, objectWrapperFactory?, reflectorFactory?, plugins?, environments?, databaseIdProvider?, mappers?)>
    
    <!ELEMENT databaseIdProvider (property*)>
    <!ATTLIST databaseIdProvider
    type CDATA #REQUIRED
    >
    
    <!ELEMENT properties (property*)>
    <!ATTLIST properties
    resource CDATA #IMPLIED
    url CDATA #IMPLIED
    >
    
    <!ELEMENT property EMPTY>
    <!ATTLIST property
    name CDATA #REQUIRED
    value CDATA #REQUIRED
    >
    
    <!ELEMENT settings (setting+)>
    
    <!ELEMENT setting EMPTY>
    <!ATTLIST setting
    name CDATA #REQUIRED
    value CDATA #REQUIRED
    >
    
    <!ELEMENT typeAliases (typeAlias*,package*)>
    
    <!ELEMENT typeAlias EMPTY>
    <!ATTLIST typeAlias
    type CDATA #REQUIRED
    alias CDATA #IMPLIED
    >
    
    <!ELEMENT typeHandlers (typeHandler*,package*)>
    
    <!ELEMENT typeHandler EMPTY>
    <!ATTLIST typeHandler
    javaType CDATA #IMPLIED
    jdbcType CDATA #IMPLIED
    handler CDATA #REQUIRED
    >
    
    <!ELEMENT objectFactory (property*)>
    <!ATTLIST objectFactory
    type CDATA #REQUIRED
    >
    
    <!ELEMENT objectWrapperFactory (property*)>
    <!ATTLIST objectWrapperFactory
    type CDATA #REQUIRED
    >
    
    <!ELEMENT reflectorFactory EMPTY>
    <!ATTLIST reflectorFactory
    type CDATA #REQUIRED
    >
    
    <!ELEMENT plugins (plugin+)>
    
    <!ELEMENT plugin (property*)>
    <!ATTLIST plugin
    interceptor CDATA #REQUIRED
    >
    
    <!ELEMENT environments (environment+)>
    <!ATTLIST environments
    default CDATA #REQUIRED
    >
    
    <!ELEMENT environment (transactionManager,dataSource)>
    <!ATTLIST environment
    id CDATA #REQUIRED
    >
    
    <!ELEMENT transactionManager (property*)>
    <!ATTLIST transactionManager
    type CDATA #REQUIRED
    >
    
    <!ELEMENT dataSource (property*)>
    <!ATTLIST dataSource
    type CDATA #REQUIRED
    >
    
    <!ELEMENT mappers (mapper*,package*)>
    
    <!ELEMENT mapper EMPTY>
    <!ATTLIST mapper
    resource CDATA #IMPLIED
    url CDATA #IMPLIED
    class CDATA #IMPLIED
    >
    
    <!ELEMENT package EMPTY>
    <!ATTLIST package
    name CDATA #REQUIRED
    >


  • 相关阅读:
    调用其他类函数,且其他类函数使用自己脚本的成员变量的方法
    伟程君解决端口被占用问题(接口jmeter 本地端口被占用完了,jmeter报错的问题)(亲测是可以的)
    JMeter 使用 http长连接的方法
    解决端口被占用问题(端口timewait)
    光辉岁月吉他指弹
    Jmeter获取 json字符的另外一种写法
    Jmeter-Critical Section Controller(临界区控制器)(还没看,是一个控制请求按顺序执行的东东)
    wrk一个能做模拟高并发请求的东东
    017-mac下project
    016-mac下ps
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314121.html
Copyright © 2011-2022 走看看