[JBoss Seam] - Re: Two EARs with shared EJB/WAR
by aleeuwen
"nickarls" wrote : It's a long shot since one would think that normally one ear couldn't possible have effect on the other but experience shows otherwise as you have experienced...
Yeah I came across that page as well and have indeed put that jboss-app.xml in both of my ears with different 'unique' values. Reading my own post again and your response I realize that I didn't make myself all that clear:
What I meant was that the jboss-app.xml seems to work like a charm for the 'scoping' of the classes so that one EAR doesn't interfere with the other. However as soon as I use that jboss-app.xml in one of the ears I get an exception when the WAR is loaded: java.lang.NoClassDefFoundError: org/w3c/dom/Document when trying to initialize bpm (see earlier post).
So now I have the situation:
1. I don't use jboss-app.xml -> I can't have two EARs
2. I use jboss-app.xml -> I can have two EARs but one of them doesn't start.
Thanks so far for your time :-) and I still hope you or someone else has some pointers...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123222#4123222
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123222
18 years, 4 months
[JBossWS] - Re: Accessing USERNAME/PASSWORD_PROPERTY from Web Service cl
by mjhammel
While finding the username wasn't as hard as first thought, it looks like finding the PASSWORD is. It doesn't seem to be in the HttpServletContext anywhere, nor can I find it in the MessageContext anywhere.
This piece of code:
/* Find out who the user is saying they are in the HTTP session. */
| MessageContext msgContext = wsContext.getMessageContext();
| HttpServletRequest servletRequest = (HttpServletRequest) msgContext.get(MessageContext.SERVLET_REQUEST);
| String username = servletRequest.getRemoteUser();
|
| Enumeration hdrs = servletRequest.getHeaderNames();
| for (; hdrs.hasMoreElements() ;)
| System.out.println("Header: " + hdrs.nextElement());
|
| String pathInfo = servletRequest.getPathInfo();
| String queryStr = servletRequest.getQueryString();
| String requestURI = servletRequest.getRequestURI();
| StringBuffer requestURL = servletRequest.getRequestURL();
| Principal p = servletRequest.getUserPrincipal();
| String sessionID = servletRequest.getRequestedSessionId();
|
| System.out.println("Path Info: " + pathInfo);
| System.out.println("Query String: " + queryStr);
| System.out.println("Request URI : " + requestURI);
| System.out.println("Request URL : " + requestURL.toString());
| System.out.println("Principal : " + p.toString());
| System.out.println("Session ID : " + sessionID);
|
| HttpSession session = servletRequest.getSession();
| Enumeration attrs = session.getAttributeNames();
| for (; attrs.hasMoreElements() ;)
| System.out.println("Session Attribute: " + attrs.nextElement());
produces the following output, which doesn't show any sign of the password property:
14:49:57,472 INFO [STDOUT] Header: authorization
| 14:49:57,472 INFO [STDOUT] Header: soapaction
| 14:49:57,472 INFO [STDOUT] Header: content-type
| 14:49:57,472 INFO [STDOUT] Header: jboss-remoting-version
| 14:49:57,472 INFO [STDOUT] Header: user-agent
| 14:49:57,472 INFO [STDOUT] Header: host
| 14:49:57,472 INFO [STDOUT] Header: accept
| 14:49:57,472 INFO [STDOUT] Header: connection
| 14:49:57,472 INFO [STDOUT] Header: content-length
| 14:49:57,475 INFO [STDOUT] Path Info: null
| 14:49:57,475 INFO [STDOUT] Query String: null
| 14:49:57,476 INFO [STDOUT] Request URI : /Crunch/comp/SubscriberServices
| 14:49:57,476 INFO [STDOUT] Request URL : https://localhost:8443/Crunch/comp/SubscriberServices
| 14:49:57,476 INFO [STDOUT] Principal : admin
| 14:49:57,476 INFO [STDOUT] Session ID : null
|
Note that there doesn't appear to be anything in the HttpSession either, which is probably correct though I'm not sure of that at the moment.
Does anyone know where the PASSWORD_PROPERTY set by the client is hiding when it gets to the Web Services class?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123219#4123219
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123219
18 years, 4 months
[JBoss jBPM] - accessing jbpm from multiple web application
by apdo
We are upgrading from a old jbpm version to the latest one (3.2).
We are also modifying the way we will integrate jbpm to our application.
on the same web server, we plan to have one web site by business process. All these web site will share the same jbpm backend. The reason is that we want to allow users to developpe there own business processes to integrate to our application and we think that it is the more flexible way to do it.
has proposed in http://jboss.org/index.html?module=bb&op=viewtopic&t=126433.
I start a standalone jbpm.
To do this, I create a MBean and bind JbpmConfiguration in JNDI.
I have create a BPMEngine.sar folder with the following structure
BPMEngine.sar
-lib
|--jboss-el.jar
|--jbpm-jpdl.jar
|--jbpmService.jar (include the mbean used to register JbpmConfiguration in a mbean)
-META-INF
|--jboss-service.xml (use to genister the mbean)
|--jboss-app.xml
-hibernate.cfg.xml
-jbpm.cfg.xml
jbpmServie.jar only contains a MBean where the code use to bind the JbpmConfiguration is
private void rebind() throws NamingException {
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
InitialContext rootCtx = new InitialContext();
Name fullName = rootCtx.getNameParser("").parse(jndiName);
System.out.println("fullName=" + fullName);
NonSerializableFactory.rebind(fullName, jbpmConfiguration, true);
}
1) is JNDI still the way to share jbpm among multiple web application?
I look into the jmxconsole and I saw an entry in the jndiview for my JbpmConfiguration.
Then, for my web app (a ear deploy on the same jboss server) that have to use the standalone jbpm I have registered a object that inherit from seam Jbpm. I have overright the startup method to set the jndiname.
the following class is use to connected to the binded Jbpmconfiguration in JNDI
@Scope(ScopeType.APPLICATION)
@BypassInterceptors
@Startup
@Name("org.jboss.seam.bpm.jbpm")
@Install(precedence=FRAMEWORK)
public class SolabsJbpm extends Jbpm {
private static final LogProvider log = Logging.getLogProvider(SolabsJbpm.class);
private JbpmConfiguration jbpmConfiguration;
@Create @Override
public void startup() throws Exception
{
super.startup();
setJbpmConfigurationJndiName("jbpm/Jbpmconfiguration");
Init.instance().setJbpmInstalled(true);
}
}
however I got the following exception:
Caused by: java.lang.ClassCastException: org.jbpm.JbpmConfiguration cannot be cast to org.jbpm.JbpmConfiguration
at org.jboss.seam.bpm.Jbpm.initJbpmConfiguration(Jbpm.java:108)
at org.jboss.seam.bpm.Jbpm.getJbpmConfiguration(Jbpm.java:93)
at org.jboss.seam.example.todo.SolabsProcessDefinitionBean.findProcessDefinitionListToStart(SolabsProcessDefinitionBean.java:46)
... 134 more
2) Do somebody know how to make the lookup in jndi work for JbpmConfiguration?
to test If my method to bind object in jndi work, I try to bind a String object and I was able to get it using a lookup. however it doestn't work with JbpmConfiguration.
I have also tested adding a call to PortableRemoteObject.narrow and I was still getting an exception:
Caused by: java.lang.ClassCastException
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at org.jboss.seam.example.todo.SolabsJbpm.initJbpmConfiguration(SolabsJbpm.java:72)
at org.jboss.seam.example.todo.SolabsJbpm.getJbpmConfiguration(SolabsJbpm.java:54)
at org.jboss.seam.example.todo.SolabsProcessDefinitionBean.findProcessDefinitionListToStart(SolabsProcessDefinitionBean.java:46)
... 130 more
Caused by: java.lang.ClassCastException: Class org.jbpm.JbpmConfiguration is not a valid remote interface
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:225)
... 134 more
An Phong Do
solabs.com
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123218#4123218
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123218
18 years, 4 months
[Beginners Corner] - Loading Applets
by TnyH
Hi, I'm rather new at this....and am currently taking steps in learning how to use JBoss, anyway my question is...
I'm trying to place an applet program within an existing JBoss server application. To do so I placed the applet class files (and JAR on subsuquent tests) into existing folders within the application,
namely localhost/program/images/, the class file (lets call it app.class) is within this folder, however I am having trouble getting the applet to run.
Instead I get an error that reads:
ClassFormatException: Incompatible Magic Number 1008807213
Which I belive means that the class file being provide is not legit.
1008807213 translates to: "<!--", so it appears that I'm getting some xml/html instead.
I was wondering if anyone knew where I should start to add this applet to an existing project?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123215#4123215
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123215
18 years, 4 months
[JBoss Seam] - Re: Beginner: Bind SelectOneMenu to @onetoone entity object
by Interista
Hi,
new problem when trying to use the convertEntity tag,
Page:
| <h:selectOneMenu value="#{category.parentCategory}">
| <s:selectItems var="categoryItem" value="#{categoryController.allCategories}" label="#{categoryItem.categoryName}" noSelectionLabel="Parent"/>
| <s:convertEntity/>
| </h:selectOneMenu>
|
Entity has implemented equals() and hashCode()
Exception:
| 22:33:26,625 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| java.lang.NullPointerException
| at org.jboss.seam.ui.converter.EntityConverterStore.getEntityManager(EntityConverterStore.java:81)
| at org.jboss.seam.ui.converter.EntityConverterStore.put(EntityConverterStore.java:60)
| 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:597)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
| at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
| at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
| at org.jboss.seam.ui.converter.EntityConverterStore_$$_javassist_0.put(EntityConverterStore_$$_javassist_0.java)
| at org.jboss.seam.ui.converter.EntityConverter.getAsString(EntityConverter.java:67)
| at org.jboss.seam.ui.converter.PrioritizableConverter.getAsString(PrioritizableConverter.java:67)
| at org.jboss.seam.ui.converter.ConverterChain.getAsString(ConverterChain.java:123)
| at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:469)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:502)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:757)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:811)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| 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.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| 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:157)
| 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:619)
|
Controller:
| @Stateless
| @Name("categoryController")
| @Scope(ScopeType.SESSION)
| public class CategoryControllerImpl implements CategoryController {
| @PersistenceContext(unitName = "database")
| private EntityManager entityManager;
| private List<Category> allCategories;
| @Out()
| public List<Category> getAllCategories() {
| return entityManager.createQuery("select c FROM Category c").getResultList();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123213#4123213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123213
18 years, 4 months