[JBoss Seam] - Re: can't get it working: exception redirection
by fguerzoni
Here is my web.xml
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
<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>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<filter-name>Seam Exception Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
<filter-name>Seam Redirect Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
<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>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
Hope it helps!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049251#4049251
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049251
18 years, 10 months
[Management, JMX/JBoss] - Re: Local JNDI lookup in local JMX bean?
by nappinc
"nappinc" wrote :
| The JNDIView MBean shows that my service-ref is not published under the java: or global JNDI contexts. Is there any way that I can do that, in addition to publishing it under the local java:comp/env context?
|
I assume from the lack of replies that this isn't possible?
"nappinc" wrote :
| Alternatively I guess I'll have to revert to J2SE-style Service invocation, which seems bizarre and excessive given all this code is in the same .war file... ;(
I'm trying this now, using the J2SE Dynamic Proxy style, and am struggling to get it to work in a JMX context in JBoss.
My web service client code is as follows:
| URL wsdl = servletContext.getResource("/WEB-INF/wsdl/gms.wsdl");
|
| // debug the contents of the URL
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(
| wsdl, new QName("..namespace..", "GMS"));
| GMSPort gms = (GMSPort) service.getPort(
| new QName("..namespace..", "GMSPort"), GMSPort.class);
|
However this fails with:
| java.io.FileNotFoundException
| at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:297)
| at java.net.URL.openStream(URL.java:1007)
| at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.getDocument(WSDLDefinitionsFactory.java:181)
| ... 44 more
|
Note that the URL (wsdl.toExternalForm()) is jndi:/localhost/pegasus/WEB-INF/wsdl/gms.wsdl, and a little debug code in the JMX bean is able to open this URL as an InputStream and output all the WSDL file's contents.
If I simply create a JAX-RPC Service instance without providing the wsdl URL, I get a "Unable to obtain Service Meta Data" error.
Can anyone suggest an alternative, preferably one that doesn't require hard-coding file locations on the app server?
This is using JBoss 4.0.4, with JBossWS 1.0.3GA and a version of JBossXB 1.0.0 CR6 (with JBoss patch JBAS-3581).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049249#4049249
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049249
18 years, 10 months
[JBoss jBPM] - Process definition instanciation (java call)
by Wash
Hi Guys !
We are trying to start a new jBPM process instance from java code, is there any sample code to perform it properly? We are able to send a notification for an suspended instance, but when we try to create an instance, then we don't have a jobId which must be specified.
As we know a JobID is normally related to a pending task and not for a creation.
Our code looks like:
InitialContext ic = new InitialContext();
| QueueConnectionFactory qcf = (QueueConnectionFactory) ic.lookup("XAConnectionFactory");
| qc = qcf.createQueueConnection();
| qc.start();
| session = qc.createQueueSession(true, QueueSession.AUTO_ACKNOWLEDGE);
| Queue queue = (Queue) ic.lookup("queue/JbpmCommandQueue");
| QueueSender sender = session.createSender(queue);
|
| //ObjectMessage msg = session.createObjectMessage();
| ObjectMessage om = session.createObjectMessage();
|
| HashMap<String, Object> map = new HashMap<String, Object>();
| map.put("long99", new Long(99));
| map.put("stringABC", "ABC");
| map.put("boolean", new Boolean(false));
| om.setObject(map);
|
| org.jbpm.command.NewProcessInstanceCommand newProcessInstanceCmd = new org.jbpm.command.NewProcessInstanceCommand();
|
| newProcessInstanceCmd.setActorId("ernie");
| newProcessInstanceCmd.setCreateStartTask(true);
| newProcessInstanceCmd.setProcessId(38L);
| newProcessInstanceCmd.setProcessName("ProcessName");
| newProcessInstanceCmd.setVariables(map);
|
| om.setObject(newProcessInstanceCmd);
| //om.setLongProperty("jobId", 286L);
| sender.send(om);
| sender.close();
| session.commit();
Wash
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049245#4049245
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049245
18 years, 10 months
[JBoss Seam] - ManyToMany with EntityManager in flush mode manual
by torsty
Hi, I have got a question in regard to (bidirectional) ManyToMany relations. I have two classes (Job and Skill) that are linked by ManyToMany Association (Skill has the mappedBy attribute). I executed the following code:
| // insert new Skill (wrapped in transaction)
| Skill hibernate = new Skill( "Hibernate" );
| Skill struts = new Skill( "Struts" );
| this.getEm().persist( hibernate );
| this.getEm().persist( struts );
|
| // insert new Job (separte transaction - skill already commited)
| //--- fetch the already saved Skill
| Skill hibernateSkill = ( Skill ) this.getEm().createQuery( "from Skill skill where skill.name= :name ")
| .setParameter( "name", "Hibernate" )
| .getSingleResult();
|
| //insert new Job and link to skill (wrapped in transaction)
| Job webDeveloper = new Job( "Web Developer");
| webDeveloper.getSkills().add( hibernateSkill );
| hibernateSkill.getJobs().add( webDeveloper );
| this.getEm().persist(webDeveloper);
|
The insert works fine, when I inject the EntityManager in my Seam conversational Component with @PersistenceContext( type=EXTENDED). The problem occurs when I inject the EntityManager with @In(value="entityManager") and begin the conversation with @Begin(flushMode=FlushModeType.MANUAL ). Then only the Job entity is inserted, but no association to Skill. When updating an already persisted job (just adding a new Skill to the association) everything works fine. The Problem with @PersistenceContext EntityManager is, that the Associations get updated immediaty, when a new Skill is added to a managed Job entity without having to manually persist the job entity. I don't want that behaviour. That's why I would like to use flushMode manual (only works with Seam EntityManager).
I could use a work around, but can anyone explain to me why no associations are inserted when persisting an unmanaged (i.e. new) job entity with the Seam EntityManager (@In annotation) and flush mode manual?
Or am I doing something wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049244#4049244
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049244
18 years, 10 months