[Management, JMX/JBoss] - Re: Shutting down JBOSS hangs..
by genman
I've had trouble on my machine with the firewall software. None of the internal RMI ports worked...
"main" prio=1 tid=0x0000000040115cd0 nid=0x7091 runnable [0x0000007fbfffb000..0x0000007fbfffd1a0]
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
- locked <0x0000002adf5c2520> (a java.net.SocksSocketImpl)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.(Socket.java:365)
at java.net.Socket.(Socket.java:178)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
is where it was stuck
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988058#3988058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988058
19Â years, 5Â months
[JBoss Seam] - Seam FileUpload Problem
by yj4jboss
Hello,
I am trying to get the Seam File Upload example (from the wiki) working but i am stuck on one point!!
My configs are as follows:
My web.xml
|
| <?xml version="1.0" ?>
| <web-app 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/web-app_2_4.xsd"
| version="2.4">
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <listener>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
|
|
| <!-- -->
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <!-- tomahawk samples -->
| <context-param>
| <description>This parameter tells MyFaces if javascript code should be allowed in the
| rendered HTML output.
| If javascript is allowed, command_link anchors will have javascript code
| that submits the corresponding form.
| If javascript is not allowed, the state saving info and nested parameters
| will be added as url parameters.
| Default: "true"</description>
| <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
| <param-value>true</param-value>
| </context-param>
| <context-param>
| <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
| <param-value>false</param-value>
| </context-param>
| <context-param>
| <description>If true, rendered HTML code will be formatted, so that it is "human readable".
| i.e. additional line separators and whitespace will be written, that do not
| influence the HTML code.
| Default: "true"</description>
| <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
| <param-value>true</param-value>
| </context-param>
| <context-param>
| <description>If true, a javascript function will be rendered that is able to restore the
| former vertical scroll on every request. Convenient feature if you have pages
| with long lists and you do not want the browser page to always jump to the top
| if you trigger a link or button action that stays on the same page.
| Default: "false"</description>
| <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <description>
| Validate managed beans, navigation rules and ensure that forms are not nested.
| </description>
| <param-name>org.apache.myfaces.VALIDATE</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <description>A class implementing the
| org.apache.myfaces.shared.renderkit.html.util.AddResource
| interface. It is responsible to
| place scripts and css on the right position in your HTML document.
| Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
| Follow the description on the MyFaces-Wiki-Performance page to enable
| StreamingAddResource instead of DefaultAddResource if you want to
| gain performance.
| </description>
| <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
| <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
| <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
| </context-param>
|
| <context-param>
| <description>
| A very common problem in configuring MyFaces-web-applications
| is that the Extensions-Filter is not configured at all
| or improperly configured. This parameter will check for a properly
| configured Extensions-Filter if it is needed by the web-app.
| In most cases this check will work just fine, there might be cases
| where an internal forward will bypass the Extensions-Filter and the check
| will not work. If this is the case, you can disable the check by setting
| this parameter to false.
| </description>
| <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
| <param-value>true</param-value>
| </context-param>
| <!-- -->
|
| <!-- tomahawk -->
| <context-param>
| <param-name>facelets.LIBRARIES</param-name>
| <param-value>/WEB-INF/tomahawk.taglib.xml;/WEB-INF/enforcement.taglib.xml</param-value>
| </context-param>
| <!-- end tomahawk -->
|
|
| <filter>
| <filter-name>Seam Exception Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
| </filter>
|
| <filter>
| <filter-name>Seam Redirect Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
| </filter>
|
| <!-- tomahawk -->
| <filter>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
| <init-param>
| <param-name>maxFileSize</param-name>
| <param-value>20m</param-value>
| <description>Set the size limit for uploaded files.
| Format: 10 - 10 bytes
| 10k - 10 KB
| 10m - 10 MB
| 1g - 1 GB
| </description>
| </init-param>
|
| <init-param>
| <param-name>uploadThresholdSize</param-name>
| <param-value>10k</param-value>
| <!--
| <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>
| -->
| </init-param>
|
|
| <init-param>
| <param-name>uploadRepositoryPath</param-name>
| <param-value>/files</param-value>
| <description>Set the path where the intermediary files will be stored.
| </description>
| </init-param>
|
| </filter>
| <!-- end tomahawk -->
|
|
|
|
| <!-- Ajax4jsf -->
| <filter>
| <display-name>Ajax4jsf Filter</display-name>
| <filter-name>ajax4jsf</filter-name>
| <filter-class>org.ajax4jsf.Filter</filter-class>
| </filter>
| <filter-mapping>
| <filter-name>ajax4jsf</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
|
| <context-param>
| <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
| <param-value>com.sun.facelets.FaceletViewHandler</param-value>
| </context-param>
|
|
|
| <filter-mapping>
| <filter-name>Seam Exception Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <filter-mapping>
| <filter-name>Seam Redirect Filter</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
| <!-- tomahawk -->
| <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
| <servlet-name>Faces Servlet</servlet-name>
| </filter-mapping>
|
| <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
| </filter-mapping>
| <!-- end tomahawk -->
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <!-- tomahawk -->
| <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <url-pattern>*.jsf</url-pattern>
| </filter-mapping> <!-- end tomahawk -->
|
|
|
|
|
| <!-- JAAS Configurations -->
|
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>All resources</web-resource-name>
| <description>Protects all resources</description>
| <url-pattern>/</url-pattern>
| </web-resource-collection>
|
| <auth-constraint>
| <role-name>User</role-name>
| <role-name>Administrator</role-name>
| </auth-constraint>
|
| </security-constraint>
|
| <login-config>
| <auth-method>FORM</auth-method>
| <form-login-config>
| <form-login-page>/login.seam</form-login-page>
| <form-error-page>/login_errors.seam</form-error-page>
|
| </form-login-config>
| </login-config>
|
|
| <security-role>
| <role-name>Administrator</role-name>
| </security-role>
|
| <security-role>
| <role-name>User</role-name>
| </security-role>
|
|
|
| </web-app>
|
|
|
|
My UploadBackingBean :
| package accountingAudit.upload;
|
| import org.apache.myfaces.custom.fileupload.UploadedFile;
| import org.hibernate.validator.NotNull;
| import org.jboss.seam.annotations.Name;
|
| @Name("uploadBean")
| public class UploadBackingBean {
|
| private UploadedFile file;
|
| public void setFile(UploadedFile file) {
| this.file = file;
|
| }
|
| @NotNull
| public UploadedFile getFile() {
| return this.file;
| }
|
| }
|
The SLSB
| package accountingAudit.upload;
|
| import javax.annotation.PostConstruct;
| import javax.ejb.Local;
| import javax.ejb.Stateless;
| import javax.faces.application.FacesMessage;
| import javax.faces.context.FacesContext;
| import javax.interceptor.Interceptors;
|
| import org.apache.myfaces.custom.fileupload.UploadedFile;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.ejb.SeamInterceptor;
| import org.jboss.seam.log.Log;
|
|
| @Local
| public interface UploadAction{
|
| public String upload();
|
| @Stateless
| @Name("upload")
| @Interceptors(SeamInterceptor.class)
| public class UploadActionBean implements UploadAction {
|
| @Logger
| private Log log;
|
|
| @In
| private UploadBackingBean uploadBean;
|
| @In
| private FacesContext facesContext;
|
| public String upload() {
| log.debug("upload()");
|
| UploadedFile file = uploadBean.getFile();
|
| log.debug("Uploading File");
|
| log.debug(file.getName());
|
| facesContext.addMessage(null, new FacesMessage("File Uploaded !! "
| + file.getName()));
|
| return "success";
| }
|
| }
| }
|
My XHTML file is as follows:
|
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:si="http://sourceforge.net/projects/easysi"
| xmlns:t="http://myfaces.apache.org/tomahawk"
|
| xmlns:enforcement="http://www.enforcement.com/jsf">
|
| <body>
|
| <ui:composition template="template.xhtml">
|
| <ui:define name="container">
| <f:view>
| <h:form enctype="multipart/form-data">
| <t:inputFileUpload storage="file" value="#{uploadBean.file}"/>
| <h:commandButton value="Submit" action="#{upload.upload}"/>
| <h:messages/>
| </h:form>
| </f:view>
| </ui:define>
|
| </ui:composition>
| </body>
| </html>
|
|
My WAR file contains the directory "files" where i want to store my uploaded files. As such the following tomahawk config in my web.xml
| <init-param>
| <param-name>uploadRepositoryPath</param-name>
| <param-value>/files</param-value>
| <description>Set the path where the intermediary files will be stored.
| </description>
| </init-param>
|
However, i get the following error message in my logs when i try to upload a file:
|
| org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. \files\upload_00000000.tmp (The system cannot find the path specified)
|
Can anyone suggest what could me wrong in the above configs ??
Regards,
Jankee Yogesh
http://www.m-itc.net
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988055#3988055
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988055
19Â years, 5Â months
[Messaging, JMS & JBossMQ] - iI am getting CommunicationException while looking for Con
by phanisekhar
I am trying to connect to testQueue which comes default with jboss messgaing , but I am getting the following exception
javax.naming.CommunicationException: Failed to retrieve stub from server (server address)
[Root exception is java.io.StreamCorruptedException: unexpected block data]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:12
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1382)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
my server and application are running on same machine
I have mentioned the following properties in my ApplicationResources pr operties file
jmsProviderUrl = jnp\://localhost\:1099
jmsPrefixes = org.jboss.naming:org.jnp.interfaces
jmsContextFactory = org.jnp.interfaces.NamingContextFactory
my lookupcode is
ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
Hashtable hst = new Hashtable();
hst.put(Context.INITIAL_CONTEXT_FACTORY,bundle.getString("jmsContextFactory"));
hst.put(Context.URL_PKG_PREFIXES,bundle.getString("jmsPrefixes"));
hst.put(Context.PROVIDER_URL,bundle.getString("jmsProviderUrl"));
Context context = new InitialContext(hst);
Iam getting the above error when the following line is executed
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) context.lookup("ConnectionFactory");
//remaining code is
String queueName = "queue/testQueue";
Queue queue = (Queue) context.lookup(queueName);
do I need to change in
connection-factories-service.xml
or
destinations-service.xml
or let me know where do I need to change.
help is highly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988053#3988053
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988053
19Â years, 5Â months
[EJB 3.0] - Re: Are References to Sessionbeans threadsafe?
by ALRubinger
So the question is: Are RMI Stubs in JNDI Thread-safe; may they be accessed concurrently?
The EJB Spec, 4.7.11, has this to say about Non-reentrant Instances in Session Beans:
anonymous wrote : The container must ensure that only one thread can be executing an instance at any time. If a client
| request arrives for an instance while the instance is executing another request, the container may throw
| the javax.ejb.ConcurrentAccessException to the second client[24]. If the EJB 2.1 client
| view is used, the container may throw the java.rmi.RemoteException to the second request if
| the client is a remote client, or the javax.ejb.EJBException if the client is a local client.[25]
...which is in relation to the "instance", the implementation residing on the server, not the stub you're storing as an instance variable in your servlet.
So, if your Session bean below is Stateful, this ensures that every call from that stub will be invoked on the same instance. Meaning that every request passing through that servlet will execute in the same session (which you probably don't want anyway), and that if two users access it concurrently, an exception will be thrown.
Couldn't find a clear answer regarding the thread safety of stateless session stubs. If the container does the job of invoking each call on a unique instance without allowing 2 threads in the same instance at the same time, I can see why this would be a valid design choice.
Anyone know? Cool to cache the local stubs of a SLSB in a multithreaded environment?
As an aside...if an exception is encountered, System.exit()? Bring down your whole server if one request encounters an error?
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988048#3988048
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988048
19Â years, 5Â months