[Security & JAAS/JBoss] - Invoking external WebService over https
by stbutler11
I would like to invoke a WebService over https from within my web application. The WebService is running on an external server. Is there a way to specify the keystore and truststore that are used without using the system properties for these values?
I've tried using a security domain by adding the following to $JBOSS_HOME/server/[my_profile]/conf/jboss-service.xml:
| <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
| name="jboss.security:service=JaasSecurityDomain,domain=my-domain">
| <depends>jboss.security:service=JaasSecurityManager</depends>
| <constructor>
| <arg type="java.lang.String" value="my-domain" />
| </constructor>
|
| <attribute name="ManagerServiceName">jboss.security:service=JaasSecurityManager</attribute>
| <attribute name="KeyStoreURL">/tmp/keystore</attribute>
| <attribute name="KeyStorePass">password</attribute>
| <attribute name="TrustStoreURL">/tmp/keystore</attribute>
| <attribute name="TrustStorePass">password</attribute>
| </mbean>
|
and in the jboss-web.xml of my web app:
| <jboss-web>
| <security-domain>java:/jaas/my-domain</security-domain>
| ...
|
I've set the system property javax.net.debug=ssl in run.sh. It looks like the default keystore and truststore are being used when the connection is made from my web app. The debug prints out :
trustStore is: /usr/jdk/instances/jdk1.6.0_07/jre/lib/security/cacerts
Should this work or is there a better way to invoke an external webservice from jboss over https?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193046#4193046
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193046
16 years, 11 months
[EJB 3.0] - JPA Deployment problems
by sbonino@antel.com.uy
I'm working with JBOSS 4.2.3 and JPA/Hibernate, and Postgress.
I managed to create my tables, but then I created a new class to be mapped as a new tables but when I deploy the jar,I got the following error:
Problem starting service persistence.units:unitName=JPAResources
javax.persistence.PersistenceException: org.hibernate.HibernateException: cannot
simultaneously fetch multiple bags
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Con
figuration.java:720)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFa
ctory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnit
Deployment.java:246)
..................
................
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:unitName=JPARecursos
State: FAILED
Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
I Depend On:
jboss.jca:service=DataSourceBinding,name=PostgresDS
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:unitName=JPARecursos
State: FAILED
Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
I Depend On:
jboss.jca:service=DataSourceBinding,name=PostgresDS
JPAResources is the name of may persistence-unit
JPAResources.jar is the name of the jars containing the classes and de pesistence.xml file
I will apreciate any help you can provide me.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193040#4193040
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193040
16 years, 11 months
[JBoss Cache: Core Edition] - Re: newbie question, jgroups udp multicast
by repkin
I have get over it by "-Djava.net.preferIPv4Stack=true" jvm parameter but now I am taking different exceptions.
| [11/28/08 15:30:23:181 EET] 0000002e viewhandler E Error Rendering View[/pages/error_before_login.xhtml]
| javax.faces.FacesException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException
| at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1536)
| at com.sun.faces.renderkit.RenderKitUtils.hasPassThruAttributes(RenderKitUtils.java:372)
| at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:441)
| at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:405)
| at com.sun.faces.renderkit.html_basic.ImageRenderer.encodeEnd(ImageRenderer.java:147)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:847)
| at com.sun.faces.renderkit.html_basic.OutputLinkRenderer.encodeChildren(OutputLinkRenderer.java:180.java:4173)
| at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
| at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1491)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| at java.lang.reflect.Method.invoke(Method.java:618)
| at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:62)
| at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| at java.lang.reflect.Method.invoke(Method.java:618)
| at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:265)
| at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1092)
| at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:973)
| at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231)
| at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238)
| at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
| at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
| at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1082)
| at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
| at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:975)
| at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:139)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| at java.lang.reflect.Method.invoke(Method.java:618)
| at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:351)
| at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:207)
| at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:55)
| at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:680)
| at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:484)
| ... 1 more
| Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedOperationException
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
| at java.security.AccessController.doPrivileged(AccessController.java:219)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
| at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
| at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
| at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
| at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
| at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
| at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:308)
| at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:270)
| at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:122)
| at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:78)
| at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)
| at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:97)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1326)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
| ... 62 more
| Caused by: java.lang.UnsupportedOperationException
| at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.suspend(WebSphereExtendedJTATransactionLookup.java:175)
| at org.hibernate.cache.jbc2.BasicRegionAdapter.suspend(BasicRegionAdapter.java:334)
| at org.hibernate.cache.jbc2.BasicRegionAdapter.activateLocalClusterNode(BasicRegionAdapter.java:92)
| at org.hibernate.cache.jbc2.BasicRegionAdapter.<init>(BasicRegionAdapter.java:80)
| at org.hibernate.cache.jbc2.TransactionalDataRegionAdapter.<init>(TransactionalDataRegionAdapter.java:41)
| at org.hibernate.cache.jbc2.timestamp.TimestampsRegionImpl.<init>(TimestampsRegionImpl.java:75)
| at org.hibernate.cache.jbc2.JBossCacheRegionFactory.buildTimestampsRegion(JBossCacheRegionFactory.java:143)
| at org.hibernate.cache.UpdateTimestampsCache.<init>(UpdateTimestampsCache.java:58)
| at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:369)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
| at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
| at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
| at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224)
| at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
| ... 79 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193025#4193025
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193025
16 years, 11 months
[JNDI/Naming/Network] - CommunicationException / ClassNotFoundException on lookup()
by meiners
I develop a Swing Client, which by RMI a JBoss 4.0.5 (on Vista machine) accesses and services implements.
| Properties objProperties = new Properties();
| objProperties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
| objProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
| objProperties.put(Context.PROVIDER_URL, "serverIPv4:2001" );
| javax.naming.InitialContext initial = new javax.naming.InitialContext(objProperties);
| NamingEnumeration ne=initial.list("");
| while(ne.hasMore()){
| System.out.println("Bind Objects :"+ne.next());
| }
| Object ref=initial.lookup("project_projectQ");
|
An exception is thrown with the Swing Client on the Debian machine, here:
initial.lookup("project_projectQ");
The exception reads:
javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: project.query.projectQHome]
(in this moment there is not one reaction in the server log of the JBoss (on Vista machine), also not in the Debug mode)
The project.query.projectQHome is with us an interface in one project.ear, which is on the JBoss (the Vista machine) deployed.
The interface project.query.projectQHome does not exist in the.jar file of the Swing Client.
The Swing Client runs thus completely conflict-free on various Machinen, on which only one network entrance and jre 1.6.0 must be present.
On the Debian machine all functionalities of the Swing Client normally, also an email dispatch run functioned smoothly, but the exception already becomes here with the attempt of initial.lookup("project_projectQ") thrown. All ports of the JBoss (on Vista machine) of the Debian machine are attainable and visible.
Main question position:
1. Why funtioniert initial.lookup("project_projectQ") not on the Debian machine?
2. From where does the exception know the name of the interface project.query.projectQHome?
3. Why can in the variable javax.naming.InitialContext initial = new javax.naming.InitialContext (objProperties); obviously existing information for the Naming object "project_projectQ" in initial.lookup("project_projectQ"); not to be used?
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193021#4193021
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193021
16 years, 11 months