我正在从IBM RAD 8/WAS 7.0迁移到IBM RAD 9/WAS 8.5.Liberty Profile.有很多配置的东西,比如URL和命名空间绑定.
我发现WSADMIN不适用于Liberty Profile的信息.但是,我没有找到如何访问wsadmin/jython中的类似功能的信息,例如创建URL,命名空间绑定等等?
如何在WebSphere Liberty Profile下编写这样的东西?
我想在WebSphere Liberty Profile中使用timer-Service(尤其是@Schedule Annotation).那可能吗?
有功能吗?https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/8.5.5.0/什么都没有;-(
不幸的是,在Java EE中,某些服务器需要特定于供应商的组来进行角色映射以进行安全配置。对于这些服务器,即使实际上没有要映射的地方,这种映射也是必需的。
不幸的是,IBM Liberty就是这样的服务器。它需要在一个名为的文件中进行映射,该映射ibm-application-bnd.xml
应该放在EAR的META-INF /文件夹中。例如:
<?xml version="1.0" encoding="UTF-8"?>
<application-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-bnd_1_2.xsd"
xmlns="http://websphere.ibm.com/xml/ns/javaee"
version="1.2">
<security-role name="architect">
<group name="architect" />
</security-role>
</application-bnd>
Run Code Online (Sandbox Code Playgroud)
更不幸的是,该文件似乎只能从EAR使用。
与Liberty一起使用WAR时,如何从应用程序归档文件中指定组到角色的映射?
(不幸的是,要求我更改服务器内部任何内容或与任何类型的控制台或图形管理界面进行交互的解决方案对我来说都不可用)
尝试让我的Liberty配置文件服务器为我的Websphere消息队列实例创建一个事务处理的jmsConnectionFactory.
Liberty profile v 8.5.5.5
Websphere MQ 7.x
我试图将jmsQueueConnectionFactory更改为jmsXAQueueConnectionFactory但它没有帮助 - >然后它似乎只是忽略它并且没有连接到MQ
server.xml中
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>wmqJmsClient-1.1</feature>
<feature>jndi-1.0</feature>
<feature>jsp-2.2</feature>
<feature>localConnector-1.0</feature>
</featureManager>
<variable name="wmqJmsClient.rar.location" value="D:\wlp\wmq\wmq.jmsra.rar"/>
<jmsQueueConnectionFactory jndiName="jms/wmqCF" connectionManagerRef="ConMgr6">
<properties.wmqJms
transportType="CLIENT"
hostName="hostname"
port="1514"
channel="SYSTEM.DEF.SVRCONN"
queueManager="QM"
/>
</jmsQueueConnectionFactory>
<connectionManager id="ConMgr6" maxPoolSize="2"/>
<applicationMonitor updateTrigger="mbean"/>
<application id="App"
location="...\app.war"
name="App" type="war"/>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint"
httpPort="9080"
httpsPort="9443"/>
</server>
Run Code Online (Sandbox Code Playgroud)
日志
2015-04-23 17:07:14,981 …
Run Code Online (Sandbox Code Playgroud) 我试图在这里解决一些问题:注入仅适用于我的应用程序的第一层,但随后它停止,并且从我的工厂模式实现返回的对象中所有@Inject注释属性都为null.我读了很多关于让CDI与JAX-RS一起工作有问题的人,但这似乎不是我的问题.我觉得我错过了一些注释,或者我没有看到所有树木前面的木头(正如我们在这里所说);-)
编辑:是否有一个示例项目与我在这里发布的代码进行仔细检查.现在我意识到我过度简化了:事实上我正在使用工厂模式来获取我的服务,这可能会中断托管上下文.请参阅增强示例:
我们走吧.
第一层:JAX-RS应用程序,一切都很好
@RequestScoped
@Path("/somePath/someResource")
public class SomeResource {
@Inject
ISomeServiceFactory someServiceFactory;
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public SomeResponse someMethod(@PathParam("foo") final String foo) {
ISomeService myService = someServiceFactory.getService(ServiceCatalog.valueOf(foo)); // works, we jump in there!
myService.someMethod();
}
}
public enum ServiceCatalog {
STANDARD("standard"), ADVANCED("advanced"), FOO("foo");
// ...
}
Run Code Online (Sandbox Code Playgroud)
正在从REST API调用中选择基于已知参数(Enum)值的实现的已损坏服务工厂:
public interface ISomeServiceFactory {
public ISomeService getService(ServiceCatalog serviceType);
}
@Stateless
public class SomeServiceFactory implements ISomeServiceFactory {
public ISomeService getService(ServiceCatalog serviceType) { …
Run Code Online (Sandbox Code Playgroud) 我想通过以下方式加载p12以发送APNS通知:
InputStream in = new FileInputStream(certPath);
KeyStore ks = KeyStore.getInstance("PKCS12");
ks.load(in, certPass.toCharArray());
Run Code Online (Sandbox Code Playgroud)
使用IBM jdk在bluemix liberty运行时上执行时出错.
java.io.IOException: insufficient data
at com.ibm.security.util.DerInputBuffer.truncate(Unknown Source)
at com.ibm.security.util.DerValue.(Unknown Source)
at com.ibm.security.util.DerInputStream.getDerValue(Unknown Source)
at com.ibm.security.pkcs12.BasicPFX.decode(Unknown Source)
at com.ibm.security.pkcs12.PFX.decode(Unknown Source)
at com.ibm.security.pkcsutil.PKCSDerObject.decode(Unknown Source)
at com.ibm.security.pkcs12.PFX.(Unknown Source)
at com.ibm.crypto.provider.PKCS12KeyStoreOracle.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
使用openjdk在bluemix liberty运行时执行时出错:
java.io.IOException: insufficient data
at sun.security.util.DerInputBuffer.truncate(DerInputBuffer.java:125)
at sun.security.util.DerInputStream.subStream(DerInputStream.java:136)
at sun.security.util.DerInputStream.readVector(DerInputStream.java:381)
at sun.security.util.DerInputStream.getSequence(DerInputStream.java:298)
at sun.security.pkcs.ContentInfo.(ContentInfo.java:132)
at sun.security.pkcs.ContentInfo.(ContentInfo.java:109)
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1247)
at java.security.KeyStore.load(KeyStore.java:1214)
Run Code Online (Sandbox Code Playgroud)
Ejecutando un listado del contenido del amacen:
keytool -list -keystore apns-certificate-sandbox.p12 -storepass**** - storetype …
WebSphere(传统):在基于容器的身份验证的情况下custom user registry
,当从Web应用程序登录失败时,我们通过调用以下方法找到失败的根本原因:
com.ibm.websphere.security.auth.WSSubject.getRootLoginException();
以上API存在于:{Server_Root_Dir} /AppServer/plugins/com.ibm.ws.runtime_x.yzjar
反编译的方法源代码getRootLoginException()
是:
public static Throwable getRootLoginException(){
return ContextManagerFactory.getInstance().getRootException();
}
Run Code Online (Sandbox Code Playgroud)
WebSphere(Liberty):如果使用基于容器的身份验证custom user registry
,我们无法通过调用以下内容找到登录失败的根本原因:
com.ibm.websphere.security.auth.WSSubject.getRootLoginException();
以上API存在于:{Server_Root_Dir} /lib/com.ibm.websphere.security_x.yzjar
这是因为该方法的反编译源代码getRootLoginException()
是:
public static Throwable getRootLoginException(){
return null;
}
Run Code Online (Sandbox Code Playgroud)
IBM声称:
public static java.lang.Throwable getRootLoginException()
这个方便的方法返回系统登录模块中捕获的根登录异常(如果存在).
它将从当前线程中提取异常.您将获得登录模块视为根异常的内容.这可能是嵌套异常.您可能需要从返回的异常中提取异常,直到获得真正的根异常.
返回:包含根登录异常的Throwable.如果未发生登录异常,则返回null.
我想知道在WebSphere(Liberty)中调用哪个API,以便找到登录失败的根本原因.
为什么需要WSSubject.getRootLoginException():
自定义实现com.ibm.websphere.security.UserRegistry
要求您通过提供自己的定义来验证Web应用程序用户输入的用户名和密码checkPassword(String userSecurityName, String passwd)
.请参阅http://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/csec_customauth.html
如果用户提供的信息不正确,您可能会抛出PasswordCheckFailedException
或CustomRegistryException
发送消息.这checkPassword(String userSecurityName, String passwd)
实际上是由WebSphere(传统或自由)从JAAS调用javax.security.auth.spi.LoginModule.login()
和PasswordCheckFailedException
或CustomRegistryException
和他们的信息被包装和javax.security.auth.login.LoginException
抛出.
为了向Web应用程序用户提供反馈,我们需要抓住从中抛出的异常javax.security.auth.spi.LoginModule.login()
.这样做的方法是 …
java authentication websphere websphere-liberty user-registry
我正在构建一个单独的admincenter工具,需要管理员角色才能访问.如何在auth-constraint中指定它web.xml
.
我试过下面,它不起作用
<security-constraint>
<web-resource-collection>
<web-resource-name>commonlogin-secure-resources</web-resource-name>
<url-pattern>/rest/readyToLand</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>test</role-name>
<role-name>Administrator</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)
在 server.xml
<basicRegistry>
<user name="admin" password="adminPassword"/>
</basicRegistry>
<administrator-role>
<user>admin</user>
</administrator-role>
Run Code Online (Sandbox Code Playgroud)
登录后,如果我尝试访问此URL,则表示我无权访问它.我需要在某处做绑定吗?
添加IBM-Authorization-Roles: com.ibm.ws.management
到MANIFEST.MF 后,我可以使用admin角色访问它,但不能使用test
角色访问它.配置有什么问题.如何在osgi包中进行角色映射?
我们有一个新的第三方应用程序,Linux上的IBM WebSphere,支持SPNEGO,用于我们的Windows AD的SSO.除了一个案例外,这符合预期.
WebSphere调用使用传递身份验证的现有Windows Web服务,因此最终用户凭据将呈现给SQL Server.此Windows安装程序也可以.
什么不起作用:WebSphere凭据不会多跳到SQL Server
摘要
失败:
错误代码:0x24 KRB_AP_ERR_BADMATCH
服务器领域:XXX.CH.OURDOMAIN.COM
服务器名称:MSSQLSvc/oursqlserver.xxx.ch.ourdomain.com:50025
目标名称:MSSQLSvc/oursqlserver.xxx.ch.ourdomain.com:50025 @XXX. CH.OURDOMAIN.COM
其他信息
从IBM …
我以前在本地环境中使用Tomcat v9.0,同时使用
getServletContext()。getRealPath(“”)
检索路径,服务器返回
.... metadata.plugins \ org.eclipse.wst.server.core \ tmp1 \ wtpwebapps \ WebApp \
但是,当客户端运行WebSphere Application Server Liberty时,我在机器上安装了相同的软件,但是在Tomcat中返回路径的相同代码会返回
空值
在Websphere环境中。您能否帮助我了解为什么会发生这种情况以及如何在Websphere环境中获得通行证。我也检查了以下链接https://www.ibm.com/developerworks/community/forums/html/topic?id=eb04c8ae-02d4-421b-af2c-2ef626a3db1b&ps=50&tags=&query=&filter=&sortBy=&order=asc,但找不到解决方案。