[JBossWS] - Is there a workaround for the UsernameToken security header?
by kimbaltrue
I'm using 4.2.0.GA with JSR-181 EJB webservices.
My EBJ's are topped with the following annotations:
@WebService(name = "InstitutionServices", targetNamespace = "http://tagus.ccf.org/", serviceName = "InstitutionServices")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
| /*
| * JBOSS specific security annotations
| */
| @SecurityDomain("tagus-domain")
| @WebContext(authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false)
|
| @Stateless(name = "InstitutionServices")
| @Local(InstitutionServices.class)
| @Remote(InstitutionServices.class)
| /*
| * JBOSS Specific
| */
| @RemoteBinding(jndiBinding = "/ejb3/InstitutionServices")
|
| @Interceptors(ServiceMetrics.class)
| @TransactionManagement(TransactionManagementType.BEAN)
I'm using a Java 6.0 client to generate the request which looks like this:
<?xml version="1.0" ?>
| <soapenv:Envelope
| xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:ns1="http://tagus.ccf.org/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <soapenv:Header>
| <wsse:Security
| xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext..."
| soapenv:mustUnderstand="1">
| <wsse:UsernameToken
| xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
| wsu:Id="XWSSGID-1187016843328-1067189645">
| <wsse:Username>1234/kimbal</wsse:Username>
| <wsse:Password
| Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...">welch</wsse:Password>
| <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-secu...">aNzX50aOu5XC7UYDOXZd7/xh</wsse:Nonce>
| <wsu:Created>2007-08-13T14:54:11.937Z</wsu:Created>
| </wsse:UsernameToken>
| </wsse:Security>
| </soapenv:Header>
| <soapenv:Body>
| <ns1:Ping>
| <ns1:Request>Hello World</ns1:Request>
| </ns1:Ping>
| </soapenv:Body>
| </soapenv:Envelope>
Everything looks right, but I'm getting the following error:
11:22:13,593 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| javax.xml.ws.soap.SOAPFaultException: Unprocessed 'mustUnderstand' header element: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security
| at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:70)
| at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:109)
| at org.jboss.ws.core.CommonSOAP11Binding.verifyUnderstoodHeader(CommonSOAP11Binding.java:87)
| at org.jboss.ws.core.CommonSOAPBinding.checkMustUnderstand(CommonSOAPBinding.java:911)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:184)
| at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
| at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
I've gone through all the topics on the JBossWS forum that refer to security or unprocessed mustUnderstand headers. I couldn't find a fix or a work around in any of them. After reading some it sounded like JBoss doesn't understand the current security header format. Is there a work around for this? What format is JBoss expecting? I'm willing the code a replacement header that will match what JBoss is expecting if that will work. However, at this point I'm not sure if JBoss is even looking for a security header at all. When using JSR-181 do I need an XML configuration file for a clear text password?
At this stage I'm even willing to rip the security out if I didn't need the user identification during server processing.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073638#4073638
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073638
18Â years, 11Â months
[JBoss Seam] - Re: Hibernate Exception
by searabbitmm
I have the following classes:
class Item, class AnnotationArea.
Item(long id;String title;URL link;String language;Date date;String description;String article;ing guidTag;Set annotationArea)
AnnotationArea(long annotationId, long startoffset, long startendset, String annotationSetName, Map<String, String> features)
Mapping file:
Item.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<many-to-many column="EMMTRIGGER_ID" class="dataObjects.EmmTrigger"/>
<key column="ITEM_ID" not-null="true"/>
<many-to-many column="ANNOTATION_ID" class="dataObjects.AnnotationArea" unique="true"/>
</hibernate-mapping>
AnnotationArea.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<map name="features" table="FEATURES" order-by="feature_name asc">
<map-key column="feature_name" type="string"/>
<element type="string" column="feature_value" not-null="false"/>
</hibernate-mapping>
The problem occurs, when I want to update the annotationArea.
I use GATE and HSQL datastore.
Error:
Using C:\Program Files\GATE-4.0 as GATE home
Using C:\Program Files\GATE-4.0\plugins as installed plug-ins directory.
Using C:\Program Files\GATE-4.0\gate.xml as site configuration file.
Using C:\Documents and Settings\Administrator\gate.xml as user configuration file
Using C:\Documents and Settings\Administrator\gate.session as user session file
CREOLE plugin loaded: file:/C:/Program Files/GATE-3.1/plugins/ANNIE/
17:59:31,203 INFO UpdateDatabase:50 - initiate GATE!
17:59:31,265 INFO UpdateDatabase:62 - serialdatastore is opened.
17:59:31,281 INFO UpdateDatabase:68 - get all document ids..
17:59:31,281 INFO UpdateDatabase:70 - the first document id: 17507___1186991906296___6100
17:59:31,390 INFO UpdateDatabase:123 - document_id: 17507
17:59:31,390 INFO UpdateDatabase:95 - without annotation Id is 17507content This is a test article :-)guidTag nulldescription nullarticle This is a test article :-)
17:59:31,390 INFO UpdateDatabase:166 - startoffset: 0
17:59:31,390 INFO UpdateDatabase:167 - endoffset: 4
17:59:31,390 INFO UpdateDatabase:169 - AnnotationTyp: feature1
17:59:31,390 INFO UpdateDatabase:171 - feature: {1id=1234}
17:59:31,390 INFO UpdateDatabase:173 - annotationId: 1
17:59:31,406 INFO UpdateDatabase:176 - AnnotationArea:
id: 1
annotationNameSet: feature1
startOffset: 0
endOffset: 4
features{1id=1234}
17:59:31,406 INFO UpdateDatabase:179 - with annotation [AnnotationArea:
id: 1
annotationNameSet: feature1
startOffset: 0
endOffset: 4
features{1id=1234}]
17:59:31,406 INFO UpdateDatabase:97 - Item final id 17507
17:59:31,546 INFO Environment:500 - Hibernate 3.2.0.cr5
17:59:31,562 INFO Environment:533 - hibernate.properties not found
17:59:31,562 INFO Environment:667 - Bytecode provider name : cglib
17:59:31,578 INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
17:59:31,765 INFO Configuration:1350 - configuring from resource: /hibernate.cfg.xml
17:59:31,765 INFO Configuration:1327 - Configuration resource: /hibernate.cfg.xml
17:59:31,937 INFO Configuration:507 - Reading mappings from resource: dataObjects/Item.hbm.xml
17:59:32,171 INFO HbmBinder:300 - Mapping class: dataObjects.Item -> ITEMS
17:59:32,265 INFO HbmBinder:1412 - Mapping collection: dataObjects.Item.emmTriggers -> ITEM_EMMTRIGGER
17:59:32,265 INFO HbmBinder:1412 - Mapping collection: dataObjects.Item.annotationArea -> ITEM_ANNOTATION
17:59:32,265 INFO Configuration:507 - Reading mappings from resource: dataObjects/EmmTrigger.hbm.xml
17:59:32,343 INFO HbmBinder:300 - Mapping class: dataObjects.EmmTrigger -> EMMTRIGGER
17:59:32,343 INFO Configuration:507 - Reading mappings from resource: dataObjects/AnnotationArea.hbm.xml
17:59:32,421 INFO HbmBinder:300 - Mapping class: dataObjects.AnnotationArea -> ANNOTATIONAREA
17:59:32,421 INFO HbmBinder:1412 - Mapping collection: dataObjects.AnnotationArea.features -> FEATURES
17:59:32,421 INFO Configuration:1465 - Configured SessionFactory: null
17:59:32,625 INFO C3P0ConnectionProvider:50 - C3P0 using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost
17:59:32,625 INFO C3P0ConnectionProvider:51 - Connection properties: {user=sa, password=****}
17:59:32,625 INFO C3P0ConnectionProvider:54 - autocommit mode: false
17:59:32,703 INFO MLog:80 - MLog clients using log4j logging.
17:59:33,953 INFO C3P0Registry:204 - Initializing c3p0-0.9.1.1 [built 15-March-2007 01:32:31; debug? true; trace: 10]
17:59:34,187 INFO AbstractPoolBackedDataSource:462 - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@c786ab36 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@bfb659b9 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge1367oqmfkzf1veg14g|1976011, idleConnectionTestPeriod -> 3000, initialPoolSize -> 5, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 300, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@7a149228 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1hge1367oqmfkzf1veg14g|1b15692, jdbcUrl -> jdbc:hsqldb:hsql://localhost, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 1hge1367oqmfkzf1veg14g|13c6a22, numHelperThreads -> 3 ]
17:59:34,703 INFO SettingsFactory:81 - RDBMS: HSQL Database Engine, version: 1.8.0
17:59:34,703 INFO SettingsFactory:82 - JDBC driver: HSQL Database Engine Driver, version: 1.8.0
17:59:35,031 INFO Dialect:141 - Using dialect: org.hibernate.dialect.HSQLDialect
17:59:35,125 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
17:59:35,125 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
17:59:35,125 INFO SettingsFactory:134 - Automatic flush during beforeCompletion(): disabled
17:59:35,140 INFO SettingsFactory:138 - Automatic session close at end of transaction: disabled
17:59:35,140 INFO SettingsFactory:145 - JDBC batch size: 15
17:59:35,140 INFO SettingsFactory:148 - JDBC batch updates for versioned data: disabled
17:59:35,140 INFO SettingsFactory:153 - Scrollable result sets: enabled
17:59:35,140 INFO SettingsFactory:161 - JDBC3 getGeneratedKeys(): disabled
17:59:35,140 INFO SettingsFactory:169 - Connection release mode: auto
17:59:35,171 INFO SettingsFactory:196 - Default batch fetch size: 1
17:59:35,171 INFO SettingsFactory:200 - Generate SQL with comments: disabled
17:59:35,171 INFO SettingsFactory:204 - Order SQL updates by primary key: disabled
17:59:35,171 INFO SettingsFactory:369 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
17:59:35,187 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
17:59:35,203 INFO SettingsFactory:212 - Query language substitutions: {}
17:59:35,218 INFO SettingsFactory:217 - JPA-QL strict compliance: disabled
17:59:35,218 INFO SettingsFactory:222 - Second-level cache: enabled
17:59:35,218 INFO SettingsFactory:226 - Query cache: disabled
17:59:35,218 INFO SettingsFactory:356 - Cache provider: org.hibernate.cache.NoCacheProvider
17:59:35,218 INFO SettingsFactory:241 - Optimize cache for minimal puts: disabled
17:59:35,218 INFO SettingsFactory:250 - Structured second-level cache entries: disabled
17:59:35,234 INFO SettingsFactory:270 - Echoing all SQL to stdout
17:59:35,234 INFO SettingsFactory:277 - Statistics: disabled
17:59:35,265 INFO SettingsFactory:281 - Deleted entity synthetic identifier rollback: disabled
17:59:35,265 INFO SettingsFactory:296 - Default entity-mode: pojo
17:59:35,437 INFO SessionFactoryImpl:161 - building session factory
17:59:36,203 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
17:59:36,218 INFO HibernateUtil:28 - -SESSION---------------------------------------------------------
17:59:36,218 INFO HibernateUtil:30 - -----------------------------------------------------------------
17:59:36,421 WARN UpdateDatabase:136 - 17507
Hibernate: insert into ITEMS (ITEM_ID, title, link, language, ITEM_DATE, description, article, guidTag) values (null, ?, ?, ?, ?, ?, ?, ?)
Hibernate: call identity()
Hibernate: update ANNOTATIONAREA set STARTOFFSET=?, ENDOFFSET=?, ANNOTATIONNAMESET=? where ANNOTATION_ID=?
17:59:36,656 ERROR AbstractBatcher:51 - Exception executing batch:
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at theseus.fzi.de.main.UpdateDatabase.synchronize(UpdateDatabase.java:151)
at theseus.fzi.de.main.UpdateDatabase.main(UpdateDatabase.java:98)
17:59:36,656 ERROR AbstractFlushingEventListener:301 - Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at theseus.fzi.de.main.UpdateDatabase.synchronize(UpdateDatabase.java:151)
at theseus.fzi.de.main.UpdateDatabase.main(UpdateDatabase.java:98)
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at theseus.fzi.de.main.UpdateDatabase.synchronize(UpdateDatabase.java:151)
at theseus.fzi.de.main.UpdateDatabase.main(UpdateDatabase.java:98)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073631#4073631
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073631
18Â years, 11Â months