我有一个Spring Boot WAR应用程序在AWS上的Tomcat 8.0.39下完美地工作.发出后sudo service tomcat8 stop
,升级到Tomcat 8.0.41 sudo yum update
,然后重新启动实例,应用程序无法启动.在catalina日志文件中,我看到了大量类型的异常:
19-Feb-2017 10:27:15.326 WARNING [localhost-startStop-1] org.apache.tomcat.util.
scan.StandardJarScanner.scan Failed to scan [file:/usr/share/java/tomcat8/javax.
annotation-api.jar] from classloader hierarchy
java.io.FileNotFoundException: /usr/share/java/tomcat8/javax.annotation-api.jar
(No such file or directory)
Run Code Online (Sandbox Code Playgroud)
以下是Tomcat抱怨的文件:
javax.annotation-api.jar
jsr181-api.jar
jaxb-api.jar
javax.xml.soap-api.jar
FastInfoset.jar
mimepull.jar
saaj-impl.jar
stax2-api.jar
woodstox-core-asl.jar
jaxb-core-2.2.10-b140802.1033.jar
jaxb-api-2.2.12-b140109.1041.jar
istack-commons-runtime-2.19.jar
txw2-2.2.10-b140802.1033.jar
hk2-core.jar
class-model.jar
config.jar
auto-depends.jar
javax.inject.jar
hk2-api.jar
osgi-resource-locator.jar
tiger-types.jar
bean-validator.jar
jtype.jar
Run Code Online (Sandbox Code Playgroud)
对于如何解决这个问题,有任何的建议吗?
更新#1:
上面的一些文件属于jaxws-ri
.事实证明,我将JAX-WS RI 2.2.10 lib
目录中的一些(10)但不是全部(23)的jar 复制到Tomcat的lib
目录中.在复制丢失的13个罐子之后,Tomcat在catalina日志文件中抱怨的文件列表缩小为:
jaxb-core-2.2.10-b140802.1033.jar
jaxb-api-2.2.12-b140109.1041.jar
istack-commons-runtime-2.19.jar
txw2-2.2.10-b140802.1033.jar
hk2-core.jar
class-model.jar
config.jar
auto-depends.jar
javax.inject.jar …
Run Code Online (Sandbox Code Playgroud) 我在Windows 7上从命令提示符运行JDK 1.8.0_51 wsimport.通过HTTPS访问WSDL URL:
wsimport -keep -Xnocompile https:// ...?wsdl
WSDL包含对也通过HTTPS访问的XSD的引用:
...的schemaLocation = "HTTPS:// ... XSD = 1"
我收到这个警告:
[WARNING] schema_reference:无法读取架构文档"...?xsd = 1",因为由于accessExternalSchema属性设置的限制而不允许"https"访问.
该工具确实生成了客户端Java代码,但我不确定此代码是否正确.
我试图通过使用javax.xml.accessExternalSchema = all创建一个jaxp.properties文件并将此文件放在%JAVA_HOME%\ jre\lib中,来遵循使用JDK8在WebService Client Generation Error中提供的解决方案.没有效果.
我还尝试将此文件放在其他子目录中,例如%JAVA_HOME%\ lib(在http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#中提到ACCESS_EXTERNAL_SCHEMA)和%JAVA_HOME%\ bin都无济于事.
因此,问题归结为:如何在wsimport的上下文中指示JAXP 以允许HTTPS协议?似乎没有任何wsimport命令行选项来传达这样的设置.
关于如何实现这一目标的任何其他建议?
在我的 Spring Boot 应用程序中,我有:
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@Override
protected void configure(HttpSecurity httpSecurity)
throws Exception
{
httpSecurity
.authorizeRequests()
// various GET/POST path enable rules, none of which would enable access to default ones (see log below)
...
// finally, deny everything else
.antMatchers("/**").denyAll()
...
}
}
Run Code Online (Sandbox Code Playgroud)
启动时,日志显示:
2016-01-29 13:20:49.379 INFO 8044 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/css/**'], Ant [pattern='/js/**'], Ant [pattern='/images/**'], Ant [pattern='/**/favicon.ico'], Ant [pattern='/error']]], []
Run Code Online (Sandbox Code Playgroud)
我可以访问,例如,localhost:8080/blah/favicon.ico
即使我希望它被阻止。
我尝试遵循安全配置中的 …
在我工作的Spring Boot 1.4应用程序中,我目前有
import org.springframework.boot.context.embedded.ErrorPage;
Run Code Online (Sandbox Code Playgroud)
根据文档,从1.4开始,这个类被弃用了org.springframework.boot.web.ErrorPage
但是,当我将代码更改为
import org.springframework.boot.web.ErrorPage;
Run Code Online (Sandbox Code Playgroud)
我收到一个错误 The import org.springframework.boot.web.ErrorPage cannot be resolved
怎么解决这个问题?