[JBossWS] - WS-Security internal error when signing
by bertaa
Operating system : Windows XP
Java version: 1.4.2_08
JBoss Sever version : jboss-4.0.5.GA
Hello,
I am trying to develop a ws-client, but when I try to test it I get the following error
| java.rmi.RemoteException: Call invocation failed with code [InternalError] because of: An internal WS-Security error occurred. See log for details; nested exception is:
| javax.xml.rpc.soap.SOAPFaultException: An internal WS-Security error occurred. See log for details
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:713)
| at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
| at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
| at $Proxy2.wS_LPROCS(Unknown Source)
| at org.tempuri.Prueba.test7WS_PROCSoapWS_LPROCS(Prueba.java:62)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at junit.framework.TestCase.runTest(TestCase.java:154)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:436)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:311)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
| Caused by: javax.xml.rpc.soap.SOAPFaultException: An internal WS-Security error occurred. See log for details
| at org.jboss.ws.wsse.WSSecurityDispatcher.convertToFault(WSSecurityDispatcher.java:103)
| at org.jboss.ws.wsse.WSSecurityDispatcher.handleOutbound(WSSecurityDispatcher.java:304)
| at org.jboss.ws.wsse.WSSecurityHandler.handleOutboundSecurity(WSSecurityHandler.java:97)
| at org.jboss.ws.wsse.WSSecurityHandlerOutbound.handleRequest(WSSecurityHandlerOutbound.java:38)
| at org.jboss.ws.handler.HandlerWrapper.handleRequest(HandlerWrapper.java:121)
| at org.jboss.ws.handler.HandlerChainBaseImpl.handleRequest(HandlerChainBaseImpl.java:245)
| at org.jboss.ws.jaxrpc.CallImpl.callRequestHandlerChain(CallImpl.java:747)
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:650)
| ... 17 more
|
|
I have already checked I have bouncycastle installed in my jre.
Can anybody help me to solve it, or at least how to get a more detailed trace?
these are my artifacts:
|
| <application-client xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd" version="1.4">
| <service-ref>
| <display-name>WS_PROC</display-name>
| <service-ref-name>service/WS_PROC</service-ref-name>
| <service-interface>javax.xml.rpc.Service</service-interface>
| <wsdl-file>WEB-INF/wsdl/WS_PROC.wsdl</wsdl-file>
| <jaxrpc-mapping-file>
| WEB-INF/jaxrpc-mapping.xml
| </jaxrpc-mapping-file>
| <port-component-ref>
| <service-endpoint-interface>
| org.tempuri.WS_PROCSoap
| </service-endpoint-interface>
| </port-component-ref>
| </service-ref>
| </application-client>
|
| <jboss-client>
| <jndi-name>WS_PROC</jndi-name>
| <service-ref>
| <service-ref-name>service/WS_PROC</service-ref-name>
| <config-name>Standard Secure Client</config-name>
| </service-ref>
| </jboss-client>
|
| <jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
| <key-store-file>c:/keystore/jbossws.jks</key-store-file>
| <key-store-password>jbossws</key-store-password>
| <trust-store-file>C:/keystore/jbossws.truststore</trust-store-file>
| <trust-store-password>jbossws</trust-store-password>
| <config>
| <sign type="x509v3" alias="wsse"/>
| <requires>
| <signature/>
| </requires>
| </config>
| </jboss-ws-security>
And this is the code to test it
| public void testWS_PROCSoapWS_LPROCS() throws Exception {
| Context ctx = this.getInitialContext();
| Service service = (Service)ctx.lookup("java:comp/env/service/WS_PROC");
| WS_PROCSoap port=(WS_PROCSoap)service.getPort(WS_PROCSoap.class);
| WS_LPROCSResponse procedimientos=port.wS_LPROCS(new WS_LPROCS("PRUEBA"));
| assertNotNull(procedimientos);
| }
|
Thanks in advance for your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012562#4012562
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012562
19Â years, 2Â months
[JBoss Seam] - Re: Caching pages in browser
by lowecg2004
I assume you mean browser page caching. I came across this problem with an application that required a login to see customer transaction data. Essentially you could login, view financial data and then log out, after which hitting the back button would show browser cached pages from the previous session. Obviously this caching could potentially reveal sensitive data to a user other than the original customer.
Adding the following meta tags to all my pages (regardless of whether they contained forms, s:link, etc) prevented the browser from caching the pages:
<meta http-equiv="Expires" content="-1" />
| <meta http-equiv="Cache-Control" content="no-cache" />
| <meta http-equiv="Pragma" content="no-cache" />
This worked well and our application functioned normally after retro fitting the meta tags, however it did cause a problem for our client which may or may not be an issue for you. Our application made heavy use of the commandLink for navigation. This mechanism requires a HTTP post when the link is selected. The side effect of this is that whenever the user selects the browsers' back button, after adding the meta tags the browser has to request a fresh page from the server. Because the original page was generated as the result of a HTTP post, this causes the browser to issue a "Resend Posted information" warning (or something like that) every time the back button is used. This is ugly and is not particularly intuitive and was unacceptable to our client (understandably).
We got around this by replacing all commandLinks that were used purely for navigational purposes with s:link. s:link generates a regular HTML link that allows navigation using HTTP get which solves the browser message problem. One caveat to this solution is that if any navigation requires values from other components on the page or those values are to be saved for later you still have to use commandLink to submit the form data.
Regarding performance: in our case (in fact most cases), security requirements superseded performance requirements, so we had no choice but to turn off browser page caching. That said, you can still get good performance by adopting one or more of the following:
1. As mentioned in previous posts, if a page is particularly expensive to render then caching the expensive page fragments using s:cache is a simple and very effective strategy (e.g. a table bound to a datamodel that requires a complex database query).
2. Introducing appropriate caching policies for external page resources (css, js, images etc) can help to reduce unnecessary server requests and save bandwidth.
3. If your generated pages are large and your users? connections are slow you could add a compression filter to your application. I've used the following compression filter successfully in a Seam application which will cut HTML page sizes by 80% over the wire:
http://sourceforge.net/projects/pjl-comp-filter/
Hope this helps,
Chris.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012560#4012560
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012560
19Â years, 2Â months
[EJB 3.0] - FlushMode.MANUAL being ignored???
by JamesWoodward
Hi,
I recently purches the eBook "Java Persistence with Hibernate" and am working through the chapters.
Why is it that this code reports a flushMode of AUTO, when it should be MANUAL?
| @Stateful
| public class MySessionBean implements MySession {
|
| private static final Log log = LogFactory.getLog(MySessionBean.class);
|
| @PersistenceContext(type=PersistenceContextType.EXTENDED, properties=@PersistenceProperty(name="org.hibernate.flushMode", value="MANUAL"))
| private EntityManager entityManager;
|
| @EJB
| private CounterDAO counterDAO;
|
| public void test() {
| org.jboss.ejb3.entity.HibernateSession hs = (org.jboss.ejb3.entity.HibernateSession) entityManager;
| org.hibernate.Session session = hs.getHibernateSession();
| org.hibernate.FlushMode flushMode = session.getFlushMode();
| log.info(flushMode);
|
| for (int i = 0; i < 100; i++) {
| Integer value = counterDAO.increment(threadName);
| }
| }
|
| public void flush() {
| entityManager.flush();
| }
|
| @Remove
| public void destroy() {
| log.info("FtpSessionBean.destroy()");
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012550#4012550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012550
19Â years, 2Â months
[Installation, Configuration & Deployment] - application-client not starting
by aschulz
Hi,
I'm porting an application from orion to JBoss 4.0.5.
I have an application-client witch I want to deploy an run when jboss starts. In the docs I found that there must be a META-INF/application-client.xml and a META-INF/jboss-client.xml and that jndi.properties must contain j2ee.clientName=... and that META-INF/MANIFEST.MF must have a Main-Class attribut. I places jndi.properties into the root of the client jar.
Ok, I did that and JBoss ist deploying the client but the client is not started by it's main-method.
Here are my files:
Manifest.mf:
| Manifest-Version: 1.0
| Created-By: Ant 1.4.1
| Main-Class: de.solutionary.bps.orionclient.MainClass
|
jboss-client.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd" >
| <jboss-client>
| <jndi-name>orionclient</jndi-name>
| <ejb-ref>
| <ejb-ref-name>ejb/NeueNominierungenS</ejb-ref-name>
| <jndi-name>comp/env/ejb/NeueNominierungenS</jndi-name>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>ejb/BestandsBerechnerS</ejb-ref-name>
| <jndi-name>comp/env/ejb/BestandsBerechnerS</jndi-name>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>ejb/StammdatenUebernahmeS</ejb-ref-name>
| <jndi-name>comp/env/ejb/StammdatenUebernahmeS</jndi-name>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>ejb/StammdatenS</ejb-ref-name>
| <jndi-name>ccomp/env/ejb/StammdatenS</jndi-name>
| </ejb-ref>
| <resource-env-ref>
| <resource-env-ref-name>jdbc/bps</resource-env-ref-name>
| <jndi-name>java:jdbc/bps</jndi-name>
| </resource-env-ref>
| </jboss-client>
|
application-client.xml:
| <?xml version="1.0"?>
| <!--
| $Id: application-client.xml 4134 2006-03-27 08:55:27Z aschulz $
| -->
| <!--
| <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN" "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
| -->
| <application-client>
| <display-name>orionclient</display-name>
| <description>Autostart client fuer Aktivitaeten ab Serverstartup</description>
| <ejb-ref>
| <ejb-ref-name>ejb/NeueNominierungenS</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>de.solutionary.bps.session.interfaces.schnittstellen.NeueNominierungenSHome</home>
| <remote>de.solutionary.bps.session.interfaces.schnittstellen.NeueNominierungenS</remote>
| <ejb-link>schnittstellen-session-ejb.jar#NeueNominierungenS</ejb-link>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>ejb/StammdatenUebernahmeS</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>de.solutionary.bps.session.interfaces.schnittstellen.StammdatenUebernahmeSHome</home>
| <remote>de.solutionary.bps.session.interfaces.schnittstellen.StammdatenUebernahmeS</remote>
| <ejb-link>schnittstellen-session-ejb.jar#StammdatenUebernahmeS</ejb-link>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>ejb/BestandsBerechnerS</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>de.solutionary.bps.session.interfaces.bestandsfuehrung.BestandsBerechnerSHome</home>
| <remote>de.solutionary.bps.session.interfaces.bestandsfuehrung.BestandsBerechnerS</remote>
| <ejb-link>bestandsfuehrung-session-ejb.jar#BestandsBerechnerS</ejb-link>
| </ejb-ref>
| <ejb-ref>
| <ejb-ref-name>ejb/StammdatenS</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>de.solutionary.bps.session.interfaces.stammdaten.StammdatenSHome</home>
| <remote>de.solutionary.bps.session.interfaces.stammdaten.StammdatenS</remote>
| <ejb-link>stammdaten-session-ejb.jar#StammdatenS</ejb-link>
| </ejb-ref>
| <resource-env-ref>
| <resource-env-ref-name>jdbc/bps</resource-env-ref-name>
| <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
| </resource-env-ref>
|
| </application-client>
|
jndi.properties:
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming.client
| java.naming.provider.url=localhost
| #java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| #java.naming.provider.url=localhost:1099/bps
| #java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| j2ee.clientName=orionclient
|
When JBoss deploys it says:
| 2007-02-07 17:39:23,877 DEBUG (ClientDeployer.java:95) # Found a META-INF/application-client.xml file, di: org.jboss.deployment.DeploymentInfo@b1ee39e9 { url=file:/D:/working/tal_planung_1.1/jboss/server/default/tmp/deploy/tmp26865bps.ear-contents/orion-client.jar }
| deployer: null
| status: null
| state: CONSTRUCTED
| watch: file:/D:/working/tal_planung_1.1/jboss/server/default/tmp/deploy/tmp26865bps.ear-contents/orion-client.jar
| altDD: null
| lastDeployed: 0
| lastModified: 0
| mbeans:
| ...
| 2007-02-07 17:39:33,390 DEBUG (ClientDeployer.java:222) # Creating client ENC binding under: orionclient
| 2007-02-07 17:39:33,390 DEBUG (ClientDeployer.java:239) # Binding an EJBReference ejb/StammdatenS
| 2007-02-07 17:39:33,390 DEBUG (ClientDeployer.java:246) # Binding ejb/StammdatenS to ejb-link: stammdaten-session-ejb.jar#StammdatenS -> comp/env/ejb/StammdatenS
| 2007-02-07 17:39:33,390 DEBUG (ClientDeployer.java:253) # Link resolved to:comp/env/ejb/StammdatenS
| 2007-02-07 17:39:33,400 DEBUG (ClientDeployer.java:239) # Binding an EJBReference ejb/StammdatenUebernahmeS
| 2007-02-07 17:39:33,400 DEBUG (ClientDeployer.java:246) # Binding ejb/StammdatenUebernahmeS to ejb-link: schnittstellen-session-ejb.jar#StammdatenUebernahmeS -> comp/env/ejb/StammdatenUebernahmeS
| 2007-02-07 17:39:33,400 DEBUG (ClientDeployer.java:253) # Link resolved to:comp/env/ejb/StammdatenUebernahmeS
| 2007-02-07 17:39:33,400 DEBUG (ClientDeployer.java:239) # Binding an EJBReference ejb/BestandsBerechnerS
| 2007-02-07 17:39:33,410 DEBUG (ClientDeployer.java:246) # Binding ejb/BestandsBerechnerS to ejb-link: bestandsfuehrung-session-ejb.jar#BestandsBerechnerS -> comp/env/ejb/BestandsBerechnerS
| 2007-02-07 17:39:33,410 DEBUG (ClientDeployer.java:253) # Link resolved to:comp/env/ejb/BestandsBerechnerS
| 2007-02-07 17:39:33,410 DEBUG (ClientDeployer.java:239) # Binding an EJBReference ejb/NeueNominierungenS
| 2007-02-07 17:39:33,410 DEBUG (ClientDeployer.java:246) # Binding ejb/NeueNominierungenS to ejb-link: schnittstellen-session-ejb.jar#NeueNominierungenS -> comp/env/ejb/NeueNominierungenS
| 2007-02-07 17:39:33,410 DEBUG (ClientDeployer.java:253) # Link resolved to:comp/env/ejb/NeueNominierungenS
| 2007-02-07 17:39:33,420 DEBUG (ClientDeployer.java:317) # Binding env resource: jdbc/bps to JDNI as: java:jdbc/bps
| 2007-02-07 17:39:33,470 INFO (ClientDeployer.java:321) # Client ENC bound under: orionclient
|
Whats wrong with my deployment? Why is the main method of de.solutionary.bps.orionclient.MainClass never called?
Please can somebody help me?
Thanks in advance.
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012546#4012546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012546
19Â years, 2Â months
[JBoss Seam] - bijection value causing JSF Error. Misuse, or misunderstand
by james_haysï¼ mac.com
I'm getting the following error reported from JSF in certain situations. I have found a solution, but I wanted to dump out my code to the group to see if you guys have seen this issue and help me determine if this is an issue in seam, or if I'm just misusing or not understanding this particular concept.
What I have is a simple form application. This particular piece is a search form. I simply want to submit my form, have seam inject it into my bean component, which is an entity bean, and complete an action. Simple stuff. I'm not doing anything crazy or extreme here. Let me show you the code that does work and then I'll make a simple modification to show what doesn't work.
First, let's look at my Entity Bean.
| @Entity
| @Name("profileRecord")
| public class ProfileRecord implements Serializable {
|
| @Id
| @GeneratedValue
| private long id;
|
| private String workAuthorizationNumber;
| private String proposalNumber;
| }
|
This is a simple 3 field bean. I've removed the getters/setters from this posting.
My listener looks like this:
| @Name("search")
| @Stateless
| public class SearchAction implements Search
| {
| @Logger
| private Log log;
|
| @In(required=false)
| private ProfileRecord profileRecord;
|
| public String search()
| {
| log.info("Running Search");
| return null;
| }
| }
|
And, my xhtml.
| <h:form>
| <h2>Basic Search</h2>
| <div style="text-align: right;"><label>WA #:<h:inputText value="#{profileRecord.workAuthorizationNumber}" /></label></div>
| <div style="text-align: right;"><label>Proposal #:<h:inputText value="#{profileRecord.proposalNumber}" /></label></div>
| <div style="text-align: right;"><h:commandButton type="submit" value="Search" action="#{search.search}" /></div>
| <div style="text-align: right;"><a href="detailedSearch.seam">Detailed Search</a></div>
| </h:form>
|
This code works as expected. My issues arise when I change the field name in my action listener. My understanding is that I should be able to modify my action listener to have a differently named variable for profileRecord. I should be able to do that either by writing
| @In(required=false)
| private ProfileRecord searchRecord;
|
or
| @In(value="searchRecord", required=false)
| private ProfileRecord profileRecord;
|
And then changing my xhtml to
| <h:form>
| <h2>Basic Search</h2>
| <div style="text-align: right;"><label>WA #:<h:inputText value="#{searchRecord.workAuthorizationNumber}" /></label></div>
| <div style="text-align: right;"><label>Proposal #:<h:inputText value="#{searchRecord.proposalNumber}" /></label></div>
| <div style="text-align: right;"><h:commandButton type="submit" value="Search" action="#{search.search}" /></div>
| <div style="text-align: right;"><a href="detailedSearch.seam">Detailed Search</a></div>
| </h:form>
|
If I make any of those changes and deviate from my original example, I get the error stating.
anonymous wrote : value could not be converted to the expected type
I'm taking this as a JSF error and not a seam error based on a previous thread replied to by Gavin that stated that this particular error string was coming from JSF. I can't find that thread back at the moment though. Sorry.
Am I misunderstanding the purpose and the abilities of injection here? My understanding is that each injection or outjection (bijection) dumps these components in a type of component cloud that other components can pull from or put to. If I specify a value for a bijection annotation, that name is what is stored as the link to that component. If I don't specify a value, the field name is used as default. Which would lead me to believe that all three of my examples should work the same.
Please, help clarify my understanding here. I've searched the forums and Google and have had limited success in finding anything regarding this issue. I've also looked in the demos and have seen numerous times where the examples do what I'm doing and it has worked as expected, yet mine will not.
Thanks,
James
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012545#4012545
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012545
19Â years, 2Â months