小编har*_*028的帖子

在使用Jenkins在远程Tomcat8上部署时,您提供的用户名不允许使用基于文本的Tomcat Manager(错误403)

我正在尝试使用Jenkins部署到容器插件在远程Tomcat(远程计算机)上部署WAR.我在tomcat-users.xml中完成了以下配置

<user username="deployer" password="deployer" roles="manager-gui,manager-script,admin" />
Run Code Online (Sandbox Code Playgroud)

我在Jenkins deployer容器插件中设置了正确的用户名密码和端口.该设置适用于本地Tomcat.但对于远程Tomcat,我不断收到以下错误:

Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username you provided is not allowed to use the text-based Tomcat Manager (error 403) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:555)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
... 16 more Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://1.203.190.5:8080/manager/text/list at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:544) ... 19 more
Run Code Online (Sandbox Code Playgroud)

请帮忙.

tomcat web-deployment maven jenkins

15
推荐指数
3
解决办法
1万
查看次数

在最新的spring-security-oauth2-2.0.6.RELEASE.jar中找不到TokenServicesUserApprovalHandler

<bean id="userApprovalHandler" class="org.springframework.security.oauth2.provider.approval.TokenServicesUserApprovalHandler">
  <property name="tokenServices" ref="tokenServices" />
</bean>
Run Code Online (Sandbox Code Playgroud)

我的spring-security.xml中的以下代码正在使用spring-security-oauth2-1.0.1.RELEASE.jar但是当我将它升级到spring-security-oauth2-2.0.6.RELEASE.jar时,上面的文件即,未找到"org.springframework.security.oauth2.provider.approval.TokenServicesUserApprovalHandler".

我这样做是因为以前的jar因为Spring 4.1.X而在jackson方面存在一些冲突

17:14:53,679 WARN [org.springframework.web.context.support.XmlWebApplicationContext] (MSC service thread 1-1) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.oauth2.provider.token.DefaultTokenServices
com.aricent.ans.controller.um.UserController.tokenServices; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tokenServices' defined in ServletContext resource [/WEB-INF/spring-security.xml]: Cannot
resolve reference to bean 'clientDetails' while setting bean property 'clientDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: …
Run Code Online (Sandbox Code Playgroud)

java security spring spring-mvc spring-security

5
推荐指数
1
解决办法
4191
查看次数

构建和公开机器学习模型 REST api 的最佳方法是什么?

我一直致力于使用 springframework 设计 REST api 并将它们部署在 Tomcat 等 Web 服务器上。我还致力于构建机器学习模型,并使用该模型在 Python 中使用 sklearn 进行预测。现在我有一个用例,我想公开一个构建机器学习模型的 REST api 和另一个进行预测的 REST api。什么架构应该帮助我实现同样的目标。(同样的例子可能是亚马逊机器学习。他们已经公开了用于生成模型和进行预测的 REST api)

我在网上搜索了一下,找到了以下方法:

  1. 用 Java 编写整个内容 - ML 模型 + REST api
  2. 用 Python 编写整个内容 - ML 模型 + REST api

但是,与 Java 相比,使用 sklearn 等库在 Python 中使用机器学习、其模型和预测确实更容易、更受支持。我真的很想使用 python 进行机器学习部分

我正在考虑使用 JAVA 编写 REST api 但使用子进程进行 python ML 调用的方法。那行得通吗?

有人可以帮助我了解我可以采取的可能的架构方法吗?还请建议最可行的解决方案。

提前致谢。

python java rest machine-learning scikit-learn

5
推荐指数
1
解决办法
6839
查看次数

为什么生成令牌via/oauth/token的方法已从GET更改为POST?

我使用的是spring-security-oauth2-1.0.0.RELEASE.jar,并且能够通过GET方法访问/ oauth/token 来生成令牌.当我更新到spring-security-oauth2-2.0.6.RELEASE.jar时,不支持GET方法.我现在只能通过POST方法访问/ oauth/token来生成令牌.

还发现新jar中缺少"org.springframework.security.oauth2.provider.approval.TokenServicesUserApprovalHandler".任何人都可以解释原因吗?Plz帮助!Thanx提前

java spring oauth access-token oauth-2.0

2
推荐指数
1
解决办法
1880
查看次数