[JBoss Seam] - s:fileUpload and Tomahawk extensionfilter
by baz
I do need some tomahawk components in my app(together with the required extension filter) What is the preferred configuration for this?
I am asking because i have a problem with this combination and s:fileUpload. I searched this forum and the jira for posts describing such an incombatibility (with no success).
Using Seam 1.2.0.Patch1
My problem is:
When i upload a file this leads to a little problem in the decode method from UIFileUpload
| private static final String TOMAHAWK_WRAPPER_CLASS = "org.apache.myfaces.webapp.filter.MultipartRequestWrapper";
|
| public void decode(FacesContext context)
| {
| super.decode(context);
|
| Object request = context.getExternalContext().getRequest();
|
| if (!(request instanceof MultipartRequest) &&
| request instanceof HttpServletRequestWrapper)
| {
| request = ((HttpServletRequestWrapper) request).getRequest();
| }
|
| if (!(request instanceof MultipartRequest) &&
| request.getClass().getName().equals(TOMAHAWK_WRAPPER_CLASS))
| {
|
I have debugged this and
the request that comes in is a MultipartRequestWrapper but also 'request instanceof HttpServletRequestWrapper' yields true.
So the if statements have to be swapped . If not, a MultipartRequestWrapper will not be handled properly.
My question: Is this because i have a configuration error in my web.xml or is this a real problem (and possible fixed)?
Ciao,
Carsten
BTW
My Web.xml declares the extension filter before seam filter.
| [...]
| <filter>
| <filter-name>extensionsFilter</filter-name>
| <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
| <init-param>
| <description>Set the size limit for uploaded files. Format: 10 - 10
| bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB</description>
| <param-name>uploadMaxFileSize</param-name>
| <param-value>100m</param-value>
| </init-param>
| <init-param>
| <description>Set the threshold size - files below this limit are
| stored in memory, files above this limit are stored on
| disk.
|
| Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB</description>
| <param-name>uploadThresholdSize</param-name>
| <param-value>100k</param-value>
| </init-param>
| </filter>
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
| </filter>
| <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
| <filter-mapping>
| <filter-name>extensionsFilter</filter-name>
| <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
| </filter-mapping>
| <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages-->
| <filter-mapping>
| <filter-name>extensionsFilter</filter-name>
| <servlet-name>Faces Servlet</servlet-name>
| <dispatcher>REQUEST</dispatcher>
| <dispatcher>FORWARD</dispatcher>
| <dispatcher>INCLUDE</dispatcher>
| </filter-mapping>
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <servlet-name>Faces Servlet</servlet-name>
| <dispatcher>REQUEST</dispatcher>
| <dispatcher>FORWARD</dispatcher>
| <dispatcher>INCLUDE</dispatcher>
| </filter-mapping>
| [...]
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028370#4028370
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028370
19Â years, 1Â month
[Remoting] - Cannot connect to socket on Fedora Core 6
by rob_blake
Hi all,
i'm struggling to connect to a socket on Fedora Core 6 using JBoss remoting.
I have a client on a Windows XP box that simply attempts to connect to the socket based Connector running on port 9999 of the Fedora box. Currently I am only getting CannotConnectExcecpton. The strange thing being that this works perfectly in reverse with the Windows XP box acting as the server, and the Fedora box running as the client.
Some info on the fedora box:
java -version
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode)
uname -r
2.6.18-1.2798.fc6
Firstly, here is my client code:
connectArgs = "/?clientMaxPoolSize=10&timeout=30000";
locator = new InvokerLocator(transport + "://" + hostname + ":" + port + connectArgs);
client = new Client(locator);
client.setSubsystem("executeCheck");
client.connect();
// commandName is simply a string. processResponse method simply echos any response
processResponse(client.invoke(commandName,commandArgs);
The followinig is the server code that runs on the Fedora box:
locator = new InvokerLocator(transport + "://" + hostname + ":" + port + "/?clientLeasePeriod=10000&timeout=120000"0;
connector = new Connector();
connector.setInvokerLocator(locator.getLocatorURI);
connector.create();
connector.addInvocationHandler("executeCheck",new AgentPluginInvocationHandler());
connector.start();
The above server code starts without issue on the Fedora box, but i cannot connect to it using the client code from the Windows machine, receiving the aforementioned CannotConnectException.
I have tried turning off SELinux and the firewall for Fedora, as well as the Windows Firewall.
I have also put together a small app that opened a ServerSocket on port 9999 and then exited once a connection was made. I was able to connect to this without issue from the Windows machine.
One other thing of note is that i can connect to the port if running 'telnet localhost 9999' from the Fedora machine.
As I say, i'm sure it's something small that I'm missing and I probably just need another set of eyes to point out what it is.
cheers
Rob
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028362#4028362
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028362
19Â years, 1Â month