[JBoss AS 7 Development] - JBOSS 7.0 Deployment failure
by Razmik Z
Razmik Z [https://community.jboss.org/people/razmikz] created the discussion
"JBOSS 7.0 Deployment failure"
To view the discussion, visit: https://community.jboss.org/message/823079#823079
--------------------------------------------------------------
Hi
I'm new to Jboss. We have a Windows 2008 R2 server that I used to install Jboss 7.0. I have added the following to the servers Environment Variable +C:\Program Files\Java\jdk1.7.0\bin+
Our developer has created a .war file that we have copied to the /standalone/deployments folder.
When we start the instance (standalone.bat -b 0.0.0.0), within 2 seconds the deployment fails and in the /deployments folder we have a file +filename.war.failed+.
As soon as we delete this file the deployment succeeds. Everytime we have a new .WAR file, or everytime we stop the site and start it we see the same thing.
I don't know much about the deployment process but is it possible that Jboss attempts to deploy before some conditions are met? And a few seconds later when we delete the +filename.war.failed+ file the conditions are correct and deployment succeeds?
Here is a typical log of the failed deployment. I would appreciate any help.
D:\Test_Jboss\bin>standalone.bat -b 10.238.57.133
Calling "D:\Test_Jboss\bin\standalone.conf.bat"
'#' is not recognized as an internal or external command,
operable program or batch file.
JAVA_HOME is not set. Unexpected results may occur.
Set JAVA_HOME to the directory of your local JDK to avoid this message.
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: D:\Test_Jboss
JAVA: java
JAVA_OPTS: -XX:+TieredCompilation -Dprogram.name=standalone.bat -Xms64M -Xmx51
2M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.se
rver.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.war
ning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.c
onfig=standalone.xml -Djboss.bind.address.management=10.238.57.133 -Djboss.bind.
address=10.238.57.133
===============================================================================
16:14:19,875 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
16:14:20,875 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
16:14:20,937 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" sta
rting
16:14:24,359 INFO [org.xnio] XNIO Version 3.0.3.GA
16:14:24,375 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
16:14:24,406 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
16:14:24,359 INFO [org.jboss.as.server] JBAS015888: Creating http management se
rvice using socket-binding (management-http)
16:14:24,641 INFO [org.jboss.as.configadmin] JBAS016200: Activating ConfigAdmin
Subsystem
16:14:24,672 INFO [org.jboss.as.clustering.infinispan] JBAS010280: Activating I
nfinispan subsystem.
16:14:24,656 INFO [org.jboss.as.osgi] JBAS011940: Activating OSGi Subsystem
16:14:24,703 INFO [org.jboss.as.naming] JBAS011800: Activating Naming Subsystem
16:14:24,688 INFO [org.jboss.as.webservices] JBAS015537: Activating WebServices
Extension
16:14:24,688 INFO [org.jboss.as.security] JBAS013101: Activating Security Subsy
stem
16:14:24,781 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log han
dlers
16:14:24,844 INFO [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: St
arting Naming Service
16:14:24,875 INFO [org.jboss.as.security] (MSC service thread 1-3) JBAS013100:
Current PicketBox version=4.0.7.Final
16:14:25,000 INFO [org.jboss.as.connector] (MSC service thread 1-1) JBAS010408:
Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
16:14:25,219 INFO [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS01
5400: Bound mail session [java:jboss/mail/Default]
16:14:25,297 INFO [org.jboss.as.connector.subsystems.datasources] (ServerServic
e Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Dr
iver (version 1.3)
16:14:25,891 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread
1-4) Starting Coyote HTTP/1.1 on http--10.238.57.133-8180
16:14:26,047 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service
thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
16:14:26,953 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC se
rvice thread 1-1) JBoss Web Services - Stack CXF Server 4.0.2.GA
16:14:27,407 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread
1-1) JBAS015012: Started FileSystemDeploymentService for directory D:\Test_Jboss
\standalone\deployments
16:14:27,469 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) JBAS015014: Re-attempting failed deployment OrangeCountyDemo (2).war
16:14:27,485 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) JBAS015014: Re-attempting failed deployment OrangeCountyDemo.war
16:14:27,485 INFO [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100:
Listening on /10.238.57.133:10000
16:14:27,485 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) JBAS015014: Re-attempting failed deployment TestOrangeCountyDemo.war
16:14:27,485 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100:
Listening on /10.238.57.133:4448
16:14:27,532 ERROR [org.jboss.as.controller.management-operation] (DeploymentSca
nner-threads - 2) Operation ("composite") failed - address: (undefined) - failur
e description: "JBAS014719: Invalid value specification OrangeCountyDemo (2).war
"
16:14:27,532 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) JBAS014719: Invalid value specification OrangeCountyDemo (2).war
16:14:27,547 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) undefined
16:14:27,547 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) JBAS015004: Caught exception writing deployment marker file D:\Test_
Jboss\standalone\deployments\Archive\OrangeCountyDemo.war.failed: java.io.FileNo
tFoundException: D:\Test_Jboss\standalone\deployments\Archive\OrangeCountyDemo.w
ar.failed (Access is denied)
at java.io.FileOutputStream.open(Native Method) [rt.jar:1.7.0_17]
at java.io.FileOutputStream.<init>(Unknown Source) [rt.jar:1.7.0_17]
at java.io.FileOutputStream.<init>(Unknown Source) [rt.jar:1.7.0_17]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.wr
iteFailedMarker(FileSystemDeploymentService.java:916) [jboss-as-deployment-scann
er-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.ac
cess$3100(FileSystemDeploymentService.java:88) [jboss-as-deployment-scanner-7.1.
1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService$De
ployTask.handleFailureResult(FileSystemDeploymentService.java:1056) [jboss-as-de
ployment-scanner-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.sc
an(FileSystemDeploymentService.java:447) [jboss-as-deployment-scanner-7.1.1.Fina
l.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService$De
ploymentScanRunnable.run(FileSystemDeploymentService.java:149) [jboss-as-deploym
ent-scanner-7.1.1.Final.jar:7.1.1.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
rt.jar:1.7.0_17]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
[rt.jar:1.7.0_17]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [rt.jar:1
.7.0_17]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$301(Unknown Source) [rt.jar:1.7.0_17]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source) [rt.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt
.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [r
t.jar:1.7.0_17]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_17]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-thread
s-2.0.0.GA.jar:2.0.0.GA]
16:14:27,563 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) undefined
16:14:27,563 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) JBAS015004: Caught exception writing deployment marker file D:\Test_
Jboss\standalone\deployments\Archive\TestOrangeCountyDemo.war.failed: java.io.Fi
leNotFoundException: D:\Test_Jboss\standalone\deployments\Archive\TestOrangeCoun
tyDemo.war.failed (Access is denied)
at java.io.FileOutputStream.open(Native Method) [rt.jar:1.7.0_17]
at java.io.FileOutputStream.<init>(Unknown Source) [rt.jar:1.7.0_17]
at java.io.FileOutputStream.<init>(Unknown Source) [rt.jar:1.7.0_17]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.wr
iteFailedMarker(FileSystemDeploymentService.java:916) [jboss-as-deployment-scann
er-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.ac
cess$3100(FileSystemDeploymentService.java:88) [jboss-as-deployment-scanner-7.1.
1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService$De
ployTask.handleFailureResult(FileSystemDeploymentService.java:1056) [jboss-as-de
ployment-scanner-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.sc
an(FileSystemDeploymentService.java:447) [jboss-as-deployment-scanner-7.1.1.Fina
l.jar:7.1.1.Final]
at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService$De
ploymentScanRunnable.run(FileSystemDeploymentService.java:149) [jboss-as-deploym
ent-scanner-7.1.1.Final.jar:7.1.1.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
rt.jar:1.7.0_17]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
[rt.jar:1.7.0_17]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [rt.jar:1
.7.0_17]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$301(Unknown Source) [rt.jar:1.7.0_17]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source) [rt.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt
.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [r
t.jar:1.7.0_17]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_17]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-thread
s-2.0.0.GA.jar:2.0.0.GA]
16:14:27,563 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-t
hreads - 1) undefined
16:14:27,907 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774
: Service status report
JBAS014777: Services which failed to start: service jboss.logging.handler
.FILE: org.jboss.msc.service.StartException in service jboss.logging.handler.FIL
E: java.io.FileNotFoundException: D:\Test_Jboss\standalone\log\server.log (Acces
s is denied)
16:14:27,922 ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Ca
ught exception during boot: java.lang.IllegalStateException: JBAS014643: Could n
ot delete D:\Test_Jboss\standalone\configuration\standalone_xml_history\20130503
-110307226\standalone.v1.xml
at org.jboss.as.controller.persistence.ConfigurationFile.deleteRecursive
(ConfigurationFile.java:441) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.persistence.ConfigurationFile.deleteRecursive
(ConfigurationFile.java:437) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.persistence.ConfigurationFile.createHistoryDi
rectory(ConfigurationFile.java:422) [jboss-as-controller-7.1.1.Final.jar:7.1.1.F
inal]
at org.jboss.as.controller.persistence.ConfigurationFile.successfulBoot(
ConfigurationFile.java:273) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.persistence.BackupXmlConfigurationPersister.s
uccessfulBoot(BackupXmlConfigurationPersister.java:65) [jboss-as-controller-7.1.
1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.AbstractControllerService.finishBoot(Abstract
ControllerService.java:195) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.ServerService.boot(ServerService.java:268) [jboss
-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractContr
ollerService.java:155) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_17]
16:14:27,938 FATAL [org.jboss.as.server] (Controller Boot Thread) JBAS015957: Se
rver boot has failed in an unrecoverable manner; exiting. See previous messages
for details.
16:14:27,969 INFO [org.jboss.as.osgi] JBAS011942: Stopping OSGi Framework
16:14:27,969 INFO [org.jboss.as.logging] JBAS011503: Restored bootstrap log han
dlers
16:14:28,079 INFO [com.arjuna.ats.jbossatx] ARJUNA032018: Destroying Transactio
nManagerService
16:14:28,079 INFO [com.arjuna.ats.jbossatx] ARJUNA032014: Stopping transaction
recovery manager
16:14:28,094 INFO [org.apache.catalina.core.StandardContext] Container org.apac
he.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been start
ed
16:14:28,110 INFO [org.jboss.as] JBAS015950: JBoss AS 7.1.1.Final "Brontes" sto
pped in 145ms
Press any key to continue . . .
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/823079#823079]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 6 months
[JBoss AS 7 Development] - Logging Id's - Clustering
by Richard Achmatowicz
Richard Achmatowicz [https://community.jboss.org/people/rachmato] modified the document:
"Logging Id's - Clustering"
To view the document, visit: https://community.jboss.org/docs/DOC-48622
--------------------------------------------------------------
h1. Clustering range: 10200 - 10399, 20700 - 20899
h1.
ClusteringApiLogger: 10200 (range = 10, used = 2)
ClusteringApiMessages: 10210 (range = 10, used = 10)
ClusteringImplLogger: 10220 (range = 20, used = 20), 20720(range = 10, used = ?)
ClusteringImplMessages: 10240 (range = 20, used = 9)
JGroupsLogger: 10260 (range = 10, used = 6)
JGroupsMessages: 10270 (range = 10, used = 10); 10390 (range = 10, used = ?)
InfinispanLogger: 10280 (range = 10, used = 7)
InfinispanMessages: 10290 (range = 10, used = 10); 10380 (range = 10, used = 6)
ClusteringWebLogger: 10300 (range = 10, used = 1)
ClusteringWebMessages: 10310 (range = 10, used = 5)
InfinispanWebLogger: 10320 (range = 10, used = 6)
InfinispanWebMessages: 10330 (range = 10, used = 7)
SingletonLogger: 10340 (range = 10, used = 7)
SingletonMessages: 10350 (range = 10, used = 2)
InfinispanEJBLogger: 10370 (range = 10, used = 0)
InfinispanEJBMessages: 10360 (range = 10, used = 4)
SubsystemLogger: 20700 (range = 10, used = 0)
SubsystemMessages: 20710 (range = 10, used = 0)
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-48622]
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
11 years, 6 months
[JBoss Web Services Development] - org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sts': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
by Anu Raj
Anu Raj [https://community.jboss.org/people/mpag1980] created the discussion
"org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sts': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:"
To view the discussion, visit: https://community.jboss.org/message/826599#826599
--------------------------------------------------------------
Hi, I am trying to publish Apache CXF STS in Jboss soa-p 5.1.3 G.A. I am following the sample program in the below link.
https://community.jboss.org/wiki/WS-TrustWithJBossWS-CXFOnJBossAS71/diff?... https://community.jboss.org/wiki/WS-TrustWithJBossWS-CXFOnJBossAS71/diff?...
I am getting the following error when I try to access my token service wsdl endpoint
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sts': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
My web.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance" xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee" xmlns:web=" http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>CXFworkingSTS</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description>Apache CXF Endpoint</description>
<display-name>cxf</display-name>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf-servlet.xml</param-value>
</context-param>
<servlet>
<servlet-name>SecurityTokenService</servlet-name>
<servlet-class>STS.SampleSTS</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SecurityTokenService</servlet-name>
<url-pattern>/SecurityTokenService/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
My cxf-servlet.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws=" http://cxf.apache.org/jaxws http://cxf.apache.org/jaxws"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint xmlns:tns=" http://docs.oasis-open.org/ws-sx/ws-trust/200512/ http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
id="sts" implementor="STS.SampleSTS"
wsdlLocation="wsdl/ws-trust-1.4-service.wsdl" endpointName="tns:UT_Port"
serviceName="tns:SecurityTokenService" address="/UT_Port">
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
</jaxws:features>
</jaxws:endpoint>
</beans>
SampleSTS.java
+++++++++++++++
/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org http://www.fsf.org.
*/
package STS;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import javax.servlet.annotation.WebServlet;
import javax.xml.ws.WebServiceProvider;
import org.apache.cxf.annotations.EndpointProperties;
import org.apache.cxf.annotations.EndpointProperty;
import org.apache.cxf.interceptor.InInterceptors;
import org.apache.cxf.sts.StaticSTSProperties;
import org.apache.cxf.sts.operation.TokenIssueOperation;
import org.apache.cxf.sts.operation.TokenValidateOperation;
import org.apache.cxf.sts.service.ServiceMBean;
import org.apache.cxf.sts.service.StaticService;
import org.apache.cxf.sts.token.provider.SAMLTokenProvider;
import org.apache.cxf.sts.token.validator.SAMLTokenValidator;
import org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
@WebServiceProvider(serviceName = "SecurityTokenService",
portName = "UT_Port",
targetNamespace = " http://docs.oasis-open.org/ws-sx/ws-trust/200512/ http://docs.oasis-open.org/ws-sx/ws-trust/200512/",
wsdlLocation = "WEB-INF/wsdl/ws-trust-1.4-service.wsdl")
@EndpointProperties(value = {
@EndpointProperty(key = "ws-security.signature.username", value = "mystskey"),
@EndpointProperty(key = "ws-security.signature.properties", value = "stsKeystore.properties"),
@EndpointProperty(key = "ws-security.callback-handler", value = "STSCallbackHandler")
})
@InInterceptors(interceptors = {"org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingPolicyInterceptor"})
@WebServlet(name = "SampleSTSServlet", urlPatterns = "/*")
public class SampleSTS extends SecurityTokenServiceProvider
{
@SuppressWarnings("deprecation")
public SampleSTS() throws Exception
{
super();
StaticSTSProperties props = new StaticSTSProperties();
props.setSignaturePropertiesFile("stsKeystore.properties");
props.setSignatureUsername("mystskey");
props.setCallbackHandlerClass(STSCallbackHandler.class.getName());
props.setIssuer("DoubleItSTSIssuer");
List<ServiceMBean> services = new LinkedList<ServiceMBean>();
StaticService service = new StaticService();
service.setEndpoints(Arrays.asList(" http://localhost:9090/CXFworking/services/SecurityServicePort http://localhost:9090/CXFworking/services/SecurityServicePort"));
services.add(service);
TokenIssueOperation issueOperation = new TokenIssueOperation();
issueOperation.setServices(services);
issueOperation.getTokenProviders().add(new SAMLTokenProvider());
issueOperation.setStsProperties(props);
TokenValidateOperation validateOperation = new TokenValidateOperation();
validateOperation.getTokenValidators().add(new SAMLTokenValidator());
validateOperation.setStsProperties(props);
this.setIssueOperation(issueOperation);
this.setValidateOperation(validateOperation);
}
}
I have a callback handler.
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 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.
*/
package STS;
import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.ws.security.WSPasswordCallback;
public class STSCallbackHandler implements CallbackHandler {
public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof WSPasswordCallback) {
WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
if ("mystskey".equals(pc.getIdentifier())) {
pc.setPassword("stskpass");
break;
} else if ("alice".equals(pc.getIdentifier())) {
pc.setPassword("clarinet");
break;
}
}
}
}
}
I see there is an issue with my web.xml file. Please help me out.
Thanks,
Abarna
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/826599#826599]
Start a new discussion in JBoss Web Services Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months