我刚刚为WebLogic Server版本创建了一个身份验证提供程序:12.1.3.0.0,将jar放在域的lib中,但没有出现在提供者列表中以供选择
<?xml version="1.0"?>
<!DOCTYPE MBeanType SYSTEM "commo.dtd">
<!-- MBean Definition File (MDF) for the MMR WS Authenticator See documentation at: http://docs.oracle.com/cd/E13212_01/wles/docs42/dvspisec/mdf_ref.html Since it is for an identity asserter, it must extend the weblogic.management.security.authentication.IdentityAsserter mbean. The Name and DisplayName must be the same. They specify the name that will appear on the console for this provider. Set the PeristPolicy to "OnUpdate" so that if an attribute value is changed, the new value is written to disk immediately. See the "Developing Security Services" manual for more info. Note that since this is an xml document, you can't use double quotes directly. Instead you need to use " Note that setting "Writeable" to "false" on an attribute makes the attribute read-only. The default is read-write. -->
-<MBeanType PersistPolicy="OnUpdate" Extends="weblogic.management.security.authentication.Authenticator" Package="fr.telecom.security.authentication.provider.mbean" Name="MMRWSAuthenticator">
<!-- You must set the value of the ProviderClassName attribute (inherited from the weblogic.management.security.Provider mbean) to the name of the java class you wrote that implements the weblogic.security.spi.AuthenticationProvider interface. You can think of the provider's mbean as the factory for your provider's runtime implementation. -->
<MBeanAttribute Name="ProviderClassName" Default=""fr.telecom.security.authentication.provider.MMRWSAuthenticationProviderImpl"" Preprocessor="weblogic.management.configuration.LegalHelper.checkClassName(value)" Writeable="false" Type="java.lang.String"/>
<!-- You must set the value of the Description attribute (inherited from the weblogic.management.security.Provider mbean) to a brief description of your provider. It is displayed in the console. -->
<MBeanAttribute Name="Description" Default=""MMR WS Authenticator"" Writeable="false" Type="java.lang.String"/>
<!-- You must set the value of the Version attribute (inherited from the weblogic.management.security.Provider mbean) to your provider's version. There is no required format. -->
<MBeanAttribute Name="Version" Default=""1.0"" Writeable="false" Type="java.lang.String"/>
</MBeanType>
这是我的build.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!--
This project is not entirely handled by Maven, so be careful when generating the artifact, and use Ant with its default target.
-->
<project name="devices-ws-authentication-provider" default="all" basedir=".">
<echo>
Remember to execute the command below before doing an Ant:
%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd
</echo>
<property name="src-java" value="src/main/java" />
<property name="mbean" value="src/mbean" />
<target name="all" depends="build" />
<target name="build" depends="clean,build.mdf,build.mjf" />
<target name="clean">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${mbean}" includes="**/*"/>
</delete>
<delete file="target/devices-ws-authentication-provider-1.0.0-SNAPSHOT.jar" failonerror="false" />
<mkdir dir="target" />
<echo message="Clean finish" />
</target>
<!-- helper to build an MDF (mbean definition file) -->
<target name="build.mdf">
<java dir="${basedir}" fork="false" classname="weblogic.management.commo.WebLogicMBeanMaker">
<arg line="-files ${mbean}" />
<arg value="-createStubs" />
<arg line="-MDF src/main/resources/TntWSAuthenticator.xml" />
</java>
<echo message="Created Supporting Classes" />
<move todir="${src-java}/fr/telecom/security/authentication/provider/mbean" file="${mbean}/TntWSAuthenticatorImpl.java" />
<move todir="${src-java}/fr/telecom/security/authentication/provider/mbean" file="${mbean}//fr/telecom/security/authentication/provider/mbean/TntWSAuthenticatorMBean.java" />
</target>
<target name="build.mjf">
<mkdir dir="${mbean}" />
<copy todir="${mbean}">
<fileset dir="src/main/java">
<include name="**/*" />
</fileset>
<fileset dir="src/main/resources">
<include name="**/*" />
</fileset>
</copy>
<java dir="${basedir}" fork="false" classname="weblogic.management.commo.WebLogicMBeanMaker">
<arg line="-MJF target/devices-ws-authentication-provider-1.0.0-SNAPSHOT.jar" />
<arg line="-files ${mbean}" />
</java>
<echo message="Mbean JAR created." />
<!-- Do a small cleanup after building the JAR, in order to not have duplicated sources / classes in source paths -->
<!--
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${mbean}" includes="fr/telecom/security/authentication/provider/*.java" />
<fileset dir="${mbean}" includes="fr/telecom/domain/**/*.java" />
<fileset dir="${mbean}" includes="commo.dtd" />
<fileset dir="${mbean}" includes="rebel.xml" />
<fileset dir="${mbean}" includes="TntWSAuthenticator.xml" />
</delete>
-->
</target>
<target name="install" depends="build">
<copy todir="${user.home}/devices/lib" file="target/devices-ws-authentication-provider-1.0.0-SNAPSHOT.jar" />
</target>
</project>
打开生成的耳朵我发现有一些丢失的文件夹和文件,比如
/schemacom_bea_xml/element
/schemacom_bea_xml/namespace
/schemacom_bea_xml/system
/schemacom_bea_xml/type
/weblogic/
答案 0 :(得分:3)
WLS提供商是一场噩梦,我已经开发了两个,现在我正在使用Spring Security :)来简化和移植性。
好吧,我读了你的CREATE PROCEDURE dbo.spGetTrackingNumber
(
@SUID nvarchar(60),
@CarrierID nvarchar(20)
)
AS
SET NOCOUNT ON;
-- declare variables used to make your decision which UPDATE to execute
DECLARE @LastSeed INT, @FinalSeed INT;
-- fetch those variables - here I'm just *GUESSING* - adapt to your needs if I'm wrong
SELECT
@LastSeed = s.LastSeed,
@FinalSeed = s.FinalSeed
FROM
dbo.TrackingSeed s
INNER JOIN
dbo.Users u ON s.UID = u.UID
INNER JOIN
dbo.SubUsers su ON u.UID = su.UID
WHERE
s.CarrierCode = @_CarrierID
AND su.SUID = @_SUID
-- depending on the your values - run the one or the other UPDATE statement
IF (@LastSeed + 1 = @FinalSeed)
UPDATE t
SET
LastSeed = NewInitialSeed,
FinalSeed = NewFinalSeed,
NewInitialSeed = NULL,
NewFinalSeed = NULL
OUTPUT
deleted.LastSeed + 1 AS CurrentSeed, deleted.Prefix, deleted.PostFix, deleted.CarrierName,
deleted.TrackingUrl, (FinalSeed - inserted.LastSeed) AS RemainingSeeds
FROM
dbo.TrackingSeed t
INNER JOIN
dbo.Users u ON t.UID = u.UID
INNER JOIN
dbo.SubUsers su ON su.UID = u.UID
WHERE
su.SUID = @_SUID
AND t.CarrierCode = @_CarrierID
ELSE
UPDATE t
SET LastSeed = LastSeed + 1
OUTPUT
inserted.LastSeed + 1 AS CurrentSeed, inserted.Prefix, Inserted.PostFix,
inserted.CarrierName, inserted.TrackingUrl, (FinalSeed - inserted.LastSeed) AS RemainingSeeds
FROM
dbo.TrackingSeed t
INNER JOIN
dbo.Users u ON t.UID = u.UID
INNER JOIN
dbo.SubUsers su ON su.UID = u.UID
WHERE
su.SUID = @_SUID
AND t.CarrierCode = @_CarrierID
,这对我来说很奇怪,但最明显的是你缺少以下论点:
build.xml
在<arg line="-targetNameSpace your.namespace.here" />
蚂蚁规则中。尝试一下,但如果它不起作用,我会建议你重做。我可以为你提供一些样品。
在回复您的评论时,我将在此处添加一个我已经在真实项目中工作过的样本。
这是一个用{和}运行的WebLogicMBeanMake
文件。要运行此示例,需要安装WLS 12c。在运行build.xml
之前,您必须运行ant buildAndDeploy
脚本来准备环境。
您必须在文件开头调整全局属性。
${WLS_HOME}/server/bin/setWLSEnv.sh
希望它有所帮助!