[JBossWS] - JBossWS-2.0.1 ignoring @SecurityDomain
by DeanoUK
Was using JBossWS out of the box with JBoss 4.2.1GA, but run into some issues - it was recommended to try the new JBossWS-2.0.1.
The @SecruityDomain was previously mapping to the correct SecruityDomain but is now defaulting to some other value.
| import org.jboss.wsf.spi.annotation.WebContext;
| import org.jboss.annotation.security.SecurityDomain;
|
| Stateless(name = "NewRegistrationsSession")
| @WebService(endpointInterface = "com.msp.ejb.csi.webservices.newregistrations.NewRegistrationsSession")
| @Remote(NewRegistrationsSession.class)
| @SecurityDomain("sys-server-login")
| @RolesAllowed({"Webservice"})
| @WebContext(contextRoot = "/webservices", urlPattern = "/*", authMethod = "BASIC",
| transportGuarantee = "NONE", secureWSDLAccess = false)
| public class NewRegistrationsSessionBean
| {
| //etc
| }
|
The SecurityDomain is set to 'sys-server-login' but it is actually using 'server-login' which is another SecurityDomain. It was previously working ok.
Any ideas why?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091123#4091123
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091123
18Â years, 6Â months
[JBoss Seam] - Stupid ajax4jsf filter when downloading files
by franck93
Hi,
I was trying to use a typical seam backing bean for handling a file download. So i used the many examples posted on this forum. sthg like :
| @Stateful
| @Scope(EVENT)
| @Name("editWebdoc")
| public class EditWebdocAction implements EditWebdoc {
| @In(required=true)
| private Client client;
|
|
| @In(required=false)
| private Webdoc webdoc;
|
| @In(value = "#{facesContext}")
| private FacesContext mFacesContext;
|
| ....
| public void getDocFichier(Webdoc webdoc) {
| if (webdoc == null) {
| return;
| }
| byte[] data = webdoc.getDocFicData();
| HttpServletResponse response = (HttpServletResponse) mFacesContext.getExternalContext().getResponse();
| response.setContentType("application/pdf");
| response.setContentLength(data.length);
| response.addHeader("Content-disposition", "attachment; filename=\"" + webdoc.getDocFicNom() + "\"");
|
| try {
| ServletOutputStream responseOutputStream = response.getOutputStream();
| responseOutputStream.write(webdoc.getDocFicData());
| responseOutputStream.flush();
| responseOutputStream.close();
| mFacesContext.responseComplete();
| response.flushBuffer();
| } catch (IOException ioe) {
| log.error("IOException lors de la restitution du document webdoc", ioe);
| }
|
AND
<s:fileUpload id="fichierPDF"
| data="#{webdoc.docFicData}"
| accept="application/PDF"
| contentType="#{editWebdoc.fichierContentType}"
| fileName="#{webdoc.docFicNom}"
| fileSize="#{editWebdoc.fichierTaille}" />
But i kept getting the following error :
|
| 17:35:40,872 ERROR [[Faces Servlet]] "Servlet.service()" pour la servlet Faces Servlet a généré une exception
| java.lang.NullPointerException
| at java.util.regex.Matcher.getTextLength(Matcher.java:1127)
| at java.util.regex.Matcher.reset(Matcher.java:284)
| at java.util.regex.Matcher.<init>(Matcher.java:205)
| at java.util.regex.Pattern.matcher(Pattern.java:879)
| at org.ajax4jsf.webapp.ParserConfig.getParser(ParserConfig.java:28)
| at org.ajax4jsf.webapp.ConfigurableXMLFilter.getParser(ConfigurableXMLFilter.java:109)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:259)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:150)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 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.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)
|
|
So i thought it was this stupid ajax4jsf filter and i switched the force-parser attribute to false hence ending up to this in components.xml :
|
| <web:ajax4jsf-filter force-parser="true"
| enable-cache="true"
| log4j-init-file="custom-log4j.xml"
| url-pattern="*.seam"/>
|
|
The pdf download now works, but of course the ajax validation w/ hibernate validator is not working in the other pages of my application.
Can't we have both ajax-hibernate validation AND download file functionnality within the same application?
Is there a way to bypass ajax filter for certain actions?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091122#4091122
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091122
18Â years, 6Â months
[Remoting] - ServerThread
by poyge394
Hi
I use jboss messaging 1.4.0.CR1.
I somtimes get this message in the log:
| 2007-10-03 09:42:47,977 ERROR [WorkerThread#12[10.36.7.203:51469]] [org.jboss.remoting.transport.socket.ServerThread] Worker thread initialization failure
| java.io.IOException: Can not read data for version 255. Supported versions: 1,2,22
| at org.jboss.remoting.transport.socket.ServerThread.versionedRead(ServerThread.java:660)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:530)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
|
|
|
any ideas what that can be ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091114#4091114
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091114
18Â years, 6Â months
[JBoss Seam] - How to initialize List of custom object by means of componen
by Jump
I have a stateful bean with a list of custom objects inside.
anonymous wrote :
| @Local
| public interface Toolbar {
|
| public List getAvailableProcesses();
| public void create();
| public void destroy();
|
| }
|
and implementation
anonymous wrote :
| @Stateful
| @Name("toolbarImpl")
| @Scope(ScopeType.SESSION)
| public class ToolbarImpl implements Toolbar {
|
| private List availableProcesses = new ArrayList();
|
|
| @DataModel
| public List getAvailableProcesses() {
| return availableProcesses;
| }
|
| public void setAvailableProcesses(List processes) {
| availableProcesses = processes;
| }
|
| @Create
| public void create() {
|
| }
|
| }
|
then I defined a schema in component_types.xsd
anonymous wrote :
| <?xml version="1.0" encoding="UTF-8"?>
| <xs:schema
| xmlns:xs="http://www.w3.org/2001/XMLSchema"
| elementFormDefault="qualified"
| targetNamespace="http://my"
| attributeFormDefault="unqualified">
|
| <xs:element name="toolbarImpl">
| <xs:complexType>
| <xs:sequence>
| <xs:element name="availableProcesses" minOccurs="0" maxOccurs="unbounded" type="processDefinition"/>
| </xs:sequence>
| </xs:complexType>
| </xs:element>
|
| <xs:complexType name="processDefinition">
| <xs:attribute name="processName"/>
| <xs:attribute name="description"/>
| <xs:attribute name="processIcon"/>
| </xs:complexType>
|
| </xs:schema>
|
and included that schema in my components.xml
anonymous wrote :
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| .........................
| xmlns:my="http://my" xsi:schemaLocation="
| ........................
| http://my component_types.xsd ">
|
| ...................................
|
| <my:toolbarImpl>
| <my:availableProcesses>
| <my:processDefinition my:processName="enrolment"
| my:description="enrolment"
| my:processIcon="img/icons/Text_Document.png"/>
| </my:availableProcesses>
| </my:toolbarImpl>
|
|
|
So, I've got no errors and empty availableProcesses. Why?
P.S. Server log
anonymous wrote :
| 2007-10-03 18:58:19,781 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to my.ToolbarImpl org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@193b604
| 2007-10-03 18:58:19,781 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to my.ToolbarImpl org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@193b604
| 2007-10-03 18:58:19,781 DEBUG [org.jboss.ejb3.Ejb3AnnotationHandler] found EJB3: ejbName=ToolbarImpl, class=my.ToolbarImpl, type=STATEFUL
| 2007-10-03 18:58:19,781 DEBUG [org.jboss.ejb3.ProxyDeployer] no declared remote bindings for : ToolbarImpl
|
anonymous wrote :
| 2007-10-03 18:58:20,843 DEBUG [org.jboss.ejb3.EJBContainer] Initialising interceptors for ToolbarImpl...
| 2007-10-03 18:58:20,843 DEBUG [org.jboss.ejb3.EJBContainer] Default interceptors: [InterceptorInfo{class=class org.jboss.seam.ejb.SeamInterceptor}]
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091112#4091112
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091112
18Â years, 6Â months
[JBoss Seam] - Response.addCookie() not working in event model
by monkeyden
Could someone tell me why this code wouldn't write the cookie once a Seam event is raised? Appears to be something odd with the way the response is being handled. Is there something that resets the response when we enter the Seam event model?
@Observer("org.jboss.seam.postAuthenticate")
| public void processRememberMe(){
| User user = (User)Component.getInstance("user", false);
| UserAccountBase userAccnt = (UserAccountBase) Contexts.getSessionContext().get("userAccount");
| FacesContext ctx = FacesContext.getCurrentInstance();
| String hash = encrypt(user.getUserName() + "." + user.getUserPassword());
| Cookie cookie = new Cookie("userKey", hash);
| cookie.setPath("/");
| cookie.setMaxAge(31536000);
| HttpServletResponse res = (HttpServletResponse)ctx.getExternalContext().getResponse();
| res.addCookie(cookie);
| userBO.addLoginCookie(hash, userAccnt.getUserKey());
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091108#4091108
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091108
18Â years, 6Â months