[JBossWS] - Re: Jboss and wsse
by rmartony
I obtain a similar exception message.
I have deployed jbossws-samples-wssecurity-encrypt.war and jbossws-samples-wssecurity-encrypt-client.jar on JBoss 4.0.4-GA.
Whenever I try to invoke de client through JNDI I get the following exception:
java.rmi.RemoteException: Call invocation failed with code [MustUnderstand] because of: Unprocessed 'mustUnderstand' header element: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security; nested exception is:
javax.xml.rpc.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.jaxrpc.CallImpl.invokeInternal(CallImpl.java:715)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:398)
at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:164)
at $Proxy2.echoUserType(Unknown Source)
Any ideas? I am missing something?
Thanks,
Rafael.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974891#3974891
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974891
19 years, 6 months
[JBoss/Spring Integration] - Re: New feature proposal: byType injection of Spring beans
by c.vidal
Hi Ales,
Here is a quick and dirty patch. I just couldn't wait :) I didn't have the time to figure out how the jboss unit tests work though, so I didn't add any unit tests. If you could just explain that to me quickly, I'd be glad to add them.
The code tries to do as much guess-work as possible and i'm not sure if it's the best way to do it. The algorithm used is explained in the code.
Tell me if it suits you.
Regards,
Cédric
| Index: spring-int/src/main/org/jboss/spring/support/SpringInjectionSupport.java
| ===================================================================
| --- spring-int/src/main/org/jboss/spring/support/SpringInjectionSupport.java (revision 57255)
| +++ spring-int/src/main/org/jboss/spring/support/SpringInjectionSupport.java (working copy)
| @@ -26,6 +26,7 @@
| import org.jboss.logging.Logger;
| import org.jboss.naming.Util;
| import org.springframework.beans.factory.BeanFactory;
| +import org.springframework.beans.factory.ListableBeanFactory;
| import org.springframework.util.Assert;
|
| import java.lang.reflect.Field;
| @@ -111,30 +112,101 @@
| return m.getName().startsWith("set") && m.getParameterTypes().length == 1;
| }
|
| - private Object getObjectFromBeanFactory(Spring spring) throws Exception
| + private Object getObjectFromBeanFactory(Spring spring, String defaultBeanName, Class type) throws Exception
| {
| BeanFactory beanFactory = (BeanFactory) Util.lookup(spring.jndiName(), BeanFactory.class);
| - return beanFactory.getBean(spring.bean());
| + return getObjectFromBeanFactory(spring, beanFactory, defaultBeanName, type);
| }
|
| + private Object getObjectFromBeanFactory(Spring spring, BeanFactory beanFactory, String defaultBeanName, Class type) {
| + Object bean = null;
| +
| + if(spring.bean() != null && spring.bean().length() > 0) {
| +
| + /*
| + * If the bean name is specified in the annotation, then the bean
| + * must looked up by name whether the bean factory is listable or
| + * not.
| + */
| + bean = beanFactory.getBean(spring.bean());
| +
| + } else {
| + if (beanFactory instanceof ListableBeanFactory) {
| +
| + /*
| + * If no bean name is specified in the annotation but the bean
| + * factory is listable then the bean is looked up by type.
| + */
| + ListableBeanFactory listableBeanFactory = (ListableBeanFactory) beanFactory;
| + Map beans = listableBeanFactory.getBeansOfType(type);
| +
| + if(beans.size() > 1) {
| +
| + /*
| + * If there is a ambiguity, try with the default name
| + */
| + bean = beans.get(defaultBeanName);
| +
| + /*
| + * If no beans amongst the ones of the expected type has the
| + * default name then we can't do anything.
| + */
| + if(bean == null) {
| + throw new IllegalArgumentException("More than one bean is of type " + type);
| + }
| +
| + } else {
| + Iterator beansIterator = beans.values().iterator();
| + if(beansIterator.hasNext()) {
| + bean = beansIterator.next();
| + }
| + }
| +
| + } else {
| +
| + /*
| + * If no bean name is specified in the annotation and the bean
| + * factory is not listable then the bean can only be looked up
| + * by its default name.
| + */
| + bean = beanFactory.getBean(defaultBeanName);
| +
| + }
| + }
| + return bean;
| + }
| +
| private void injectToMethod(Object target, Method method, Spring spring) throws Exception
| {
| - Object bean = getObjectFromBeanFactory(spring);
| + String defaultBeanName = getDefaultBeanName(method);
| + Object bean = getObjectFromBeanFactory(spring, defaultBeanName, method.getReturnType());
| doAssert(bean, method.getParameterTypes()[0]);
| logInjection(spring, bean, target, method);
| method.setAccessible(true);
| method.invoke(target, bean);
| }
|
| - private void injectToField(Object target, Field field, Spring spring) throws Exception
| + private void injectToField(Object target, Field field, Spring spring) throws Exception
| {
| - Object bean = getObjectFromBeanFactory(spring);
| + String defaultBeanName = getDefaultBeanName(field);
| + Object bean = getObjectFromBeanFactory(spring, defaultBeanName, field.getType());
| doAssert(bean, field.getType());
| logInjection(spring, bean, target, field);
| field.setAccessible(true);
| field.set(target, bean);
| }
|
| + private String getDefaultBeanName(Method method) {
| + String name = method.getName().substring(3, 3).toLowerCase();
| + name += method.getName().substring(4);
| + return name;
| + }
| +
| + private String getDefaultBeanName(Field field) {
| + String name = field.getName();
| + return name;
| + }
| +
| private void doAssert(Object bean, Class expectedBeanClass)
| {
| Assert.isTrue(expectedBeanClass.isAssignableFrom(bean.getClass()),
| Index: spring-int/src/main/org/jboss/annotation/spring/Spring.java
| ===================================================================
| --- spring-int/src/main/org/jboss/annotation/spring/Spring.java (revision 57255)
| +++ spring-int/src/main/org/jboss/annotation/spring/Spring.java (working copy)
| @@ -38,6 +38,6 @@
|
| String jndiName();
|
| - String bean();
| + String bean() default "";
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974889#3974889
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974889
19 years, 6 months
[JBoss jBPM] - error enabling the hsql MBean and tcp/ip connections
by fernandogamba
hi, i follow the indications the startguide to run a process inside jboss, everything works fine until i try to enable the hsql mbean and the tcp/ip connections.
I check like the guide says in the hsqldb-ds.xml file if the line jdbc:hsqldb:hsql://localhost:1701 is uncommented in the <url-connection> and the other same tags are commented
next, i check if the mbean declaration is uncommented, now the guide says that if you choose to delete the other mbean definition? , it refers to the other mbean definition below the other mbean definition right?
next says that make sure to change the dependency on the datasource from jboss:service=hipersonic,database=localDB to jboss:service=hipersonic
it refers to the same mbean definition wich i choose to delete before?
excuse me if the question seems dumb but i dont understand that, besides when i try to create de databas schema ant -f jboss-buil.xml db-create-table give me the following:
Buildfile: jboss-build.xml
db-create-table:
[java] ScriptTool.init error: socket creation error
[java] java.sql.SQLException: socket creation error
[java] at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcConnection.(Unknown Source)
[java] at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
[java] at org.hsqldb.jdbcDriver.connect(Unknown Source)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:525)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:171)
[java] at org.hsqldb.util.ScriptTool.execute(Unknown Source)
[java] at org.hsqldb.util.ScriptTool.main(Unknown Source)
[java] Exception in thread "main" java.lang.NullPointerException
[java] at org.hsqldb.util.ScriptTool.execute(Unknown Source)
[java] at org.hsqldb.util.ScriptTool.main(Unknown Source)
[java] Java Result: 1
BUILD SUCCESSFUL
and the ant -f jboss-build.xml db-insert give me the following
db-insert:
[java] SQL Error at line 269: java.sql.SQLException: Table not found in statement [DELETE FROM tx]
idem for ant -f jboss-build.xml db-list
and when a run the jboss it give me the following log
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss:service=DefaultPartition
State: FAILED
Reason: ChannelException: java.lang.Exception: exception caused by UDP.start(): java.lang.Exception: UDP.createSockets(): cannot list on any port in range 0-1
I Depend On:
jboss:service=Naming
Depends On Me:
jboss:service=HASessionState
jboss:service=HAJNDI
jboss.cache:service=InvalidationBridge,type=JavaGroups
jboss.ha:service=HASingletonDeployer
jboss:service=FarmMember,partition=DefaultPartition
ObjectName: jboss:service=Hypersonic,database=localDB
State: NOTYETINSTALLED
Depends On Me:
jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
ObjectName: jboss:service=CorbaTransaction
State: FAILED
Reason: java.lang.Exception: Cannot bind transaction factory in CORBA naming service:
org.omg.CORBA.TRANSIENT: Retries exceeded, couldn't reconnect to 10.0.248.247:3528 vmcid: 0x0 minor code: 0 completed: No
I Depend On:
jboss:service=TransactionManager
jboss:service=CorbaORB
jboss:service=CorbaNaming
ObjectName: jboss.cache:service=TomcatClusteringCache
State: FAILED
Reason: ChannelException: java.lang.Exception: exception caused by UDP.start(): java.lang.Exception: UDP.createSockets(): cannot list on any port in range 0-1
I Depend On:
jboss:service=Naming
jboss:service=TransactionManager
i hope to be clear, thanks for any suggestions
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974883#3974883
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974883
19 years, 6 months