[Installation, Configuration & Deployment] - UTF encoding in address field
by WatchCat
I have some problem. It not fatal, but i don't known how to eliminate it.
Jboss 4.0.5 GA ( with tomcat ).
Tomcat connector was configured this way:
| <Connector port="80" address="${jboss.bind.address}"
| maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
| emptySessionPath="true"
| useBodyEncodingForURI="true"
| URIEncoding="UTF-8"
| enableLookups="false" redirectPort="8443" acceptCount="100"
| connectionTimeout="20000" disableUploadTimeout="true"/>
|
And in ROOT.war i place some test jsp-file (testenc.jsp, UTF-8 codepage)
| <%@ page import="java.net.URLEncoder" %>
| <%@ page import="java.util.Enumeration"%>
| <%@ page contentType="text/html;charset=UTF-8" %>
| <html>
| <head>
| <title>testenc.jsp page</title></head>
| <meta http-equiv="pragma" content="no-cache" />
| <!meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
| <body>
| <%=request.getCharacterEncoding()%>
| <table>
| <% Enumeration pnms = request.getParameterNames();
| while (pnms.hasMoreElements()) {
| Object o = pnms.nextElement();
| String[] v = request.getParameterValues(o.toString());
| StringBuffer sb = new StringBuffer();
| for (int i = 0; i < v.length; i++) sb.append(v).append("|");
| %><tr><td><%=o.toString()%></td><td><%=sb.toString()%></td><td><%=request.getParameter(o.toString())%></td></tr><% }%>
| </table>
| <a href="testenc.jsp?param=<%=URLEncoder.encode("???????", "UTF-8")%>">???????</a><br/>
| </body>
| </html>
|
In bowser page showing normally, and reference working fine.
But if i manually type "/testenc.jsp?param=???????" in url-field then browser recode Russian symbols in form:
/testenc.jsp?param=%D0%F3%F1%F1%EA%E8%E9 (Windows-1251?)
instead of:
/testenc.jsp?param=%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9
although with wikipedia.org browser works correctly.
Sorry for my English. :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994382#3994382
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994382
19 years, 7 months
[JBoss Seam] - Re: Seam debug page with ICEfaces
by MarkCollette
Hmm, some random musings from me, about your question ... :)
I'm not aware of any other way of telling Facelets where to get at a resource, besides via the ResourceResolver. The thing is, I'm not sure that ResourceResolvers should be automagically configured anyway, since the web app developer would probably want to control the sequence of the chain of delegation.
And the problem with the SeamDebugPhaseListener approach is that anyone using their own ViewHandler, not just ICEfaces with its ViewHandlers, may have problems. And what if content is being rendered to some non-HTML front-end? Then they might not be able to access the debug page anyway with the existing approach.
Is there some way of faces-config.xml saving away some state somewhere, that the Facelets DefaultResourceResolver could then retrieve, that would then tell it how to find your debug.xhtml file? Alternatively, maybe your PhaseListener could programatically call some static method in Facelets, that could tell the DefaultResourceResolver about a Seam delegate that can find the debug.xhtml file. I guess that's more of a question for the Facelets Dev newsgroup, but maybe you'd have some clout with them to have that done?
Oh, and I should probably mention, that what I've described here in this thread won't actually make the debug page work with the ICEfaces 1.5.1 release, but should make the next release work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994379#3994379
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994379
19 years, 7 months
[JBossCache] - Tutorial not working
by vs008
When trying the tutorial
file:///B:/tools/JBossCache-1.4.1.BETA/docs/tutorial/en/html/index.html
The tutorial says:
1.
On the first window for the GUI, type sh build.sh to see the available commands. To run the GUI, type sh build.sh run.demo .
This is the error I get:
JBossCache-1.4.0.SP1 1266>build.sh run.demo
java.lang.InstantiationException: org.apache.tools.ant.Main
at java.lang.Class.newInstance(I)Ljava.lang.Object;(Unknown Source)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:195)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
2. runShellDemo.sh, the screen does not shows up. I am running onLinux with Exceed.
java -cp $CP $ARGS $JAVA_OPTS -Djboss.aop.aoppath=$AOP_PATH bsh.Console &
When I remove the ampersand, the beanshell shows up.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994368#3994368
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994368
19 years, 7 months
[JNDI/Naming/Network] - Re: java.lang.ClassNotFoundException: org.jnp.interfaces.Nam
by bulloncito
Similar problem, however, I'm using portlets, running things inside the same JVM and everything runs inside the same app, however, in some places my app uses
TransactionManager tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager") ;
... wich runs nice and smooth, while some other places, INSIDE THE VERY SAME APPLICATION, with the very same identical code, print this error:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org/jnp/interfaces/NamingContextFactory]
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:175)
| at portlets.performers.ActionPerformer.flushPersistence(Unknown Source)
| at portlets.performers.ActionPerformer.finalize(Unknown Source)
| at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
| at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
| at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
| at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
| Caused by: java.lang.ClassNotFoundException: org/jnp/interfaces/NamingContextFactory
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Class.java:247)
| at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
| ... 9 more
... weird, huh ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994359#3994359
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994359
19 years, 7 months
[JBoss AOP] - Using a custom ClassLoader with JBoss AOP in Standalone Mode
by ttarhan
Hello,
I am having trouble making JBoss AOP (standalone) use my custom class loader. To keep the example simple, let's say I have a ClassLoader called CustomClassLoader which loads classes from a source other than the class path.
Now, assume we have these two classes
class A {
B someVariable;
}
class B {
A someVariable;
}
When my CustomClassLoader loads Class A and passes the class's byte[] to transform() OR if I use -javaagent and my CustomClassLoader simply calls defineClass, the AOP library tries to resolve the reference to Class B from within Class A. The problem is that it doesn't use my CustomClassLoader to do this -- it searches the classpath all on its own. I've tried changing the threadContextClassLoader, I've tried registering my classloader with the aspect manager. No matter what I do, the AOP framework uses its own class loader.
Any help on forcing the aspecting framework to use my own classloader to resolve references would be greatly appreciated.
I am using JBoss AOP 1.5.2.GA with JDK 1.5.
Thanks,
Tolga Tarhan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994355#3994355
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994355
19 years, 7 months
[JBoss Portal] - ClassCastException when extending JBossPortlet
by mat.lowery
Environment:
JBoss Portal/AS Version: Downloaded JBoss Portal + JBoss AS 2.4
OS Platform: Windows XP
Java: 1.4.2_12
Problem:
Extending JBossPortlet (using CatalogPortlet as a guide) yields a ClassCastException when render is called.
PortletContainer.invokeRender() is calling JBossPortlet.render(RenderRequest, RenderResponse) with arguments of type RenderRequestImpl and RenderResponseImpl. JBossPortlet then attempts to cast those arguments to JBossRenderRequest and JBossRenderResponse which results in the exception.
I'm sure I'm doing something stupid. Can anyone enlighten me?
Note that my code (a subclass of JBossPortlet) never gets called.
Stack Trace:
| java.lang.ClassCastException
| at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:384)
| at org.jboss.portal.portlet.container.PortletContainer.invokeRender(PortletContainer.java:519)
| ...
|
portlet.xml:
| <portlet>
| <portlet-name>PentahoMenuPortlet</portlet-name>
| <portlet-class>
| org.pentaho.ui.portlet.PentahoMenuPortlet
| </portlet-class>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>PentahoMenuPortlet</title>
| </portlet-info>
| </portlet>
|
portlet-instances.xml:
| <deployment>
| <instance>
| <instance-id>PentahoMenuInstance</instance-id>
| <portlet-ref>PentahoMenuPortlet</portlet-ref>
| </instance>
| </deployment>
|
default-object.xml:
| <deployments>
| <deployment>
| <parent-ref>default</parent-ref>
| <if-exists>overwrite</if-exists>
| <page>
| <page-name>Pentaho</page-name>
| <window>
| <window-name>NavigationPortletWindow</window-name>
| <instance-ref>NavigationPortletInstance</instance-ref>
| <region>navigation</region>
| <height>0</height>
| <properties>
| <property>
| <name>theme.windowRendererId</name>
| <value>emptyRenderer</value>
| </property>
| <property>
| <name>theme.decorationRendererId</name>
| <value>emptyRenderer</value>
| </property>
| <property>
| <name>theme.portletRendererId</name>
| <value>emptyRenderer</value>
| </property>
| </properties>
| </window>
| <window>
| <window-name>PentahoNewsWindow</window-name>
| <instance-ref>PentahoNewsInstance</instance-ref>
| <region>center</region>
| <height>0</height>
| </window>
| <window>
| <window-name>PentahoMenuWindow</window-name>
| <instance-ref>PentahoMenuInstance</instance-ref>
| <region>left</region>
| <height>0</height>
| </window>
| ...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994353#3994353
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994353
19 years, 7 months
[JBoss Seam] - Seam debug page with ICEfaces
by MarkCollette
Hi, I work at ICEsoft, on both Facelets and Seam integration. I ran into an issue with the Seam debug screen, as it works with ICEfaces. Basically, none of the stock JSF components were rendering properly, because org.jboss.seam.debug.jsf.SeamDebugPhaseListener diretly uses Facelets, without using the ViewHandler mechanisms, which ICEfaces relies upon.
I think that the easiest approach will be to make a Seam com.sun.facelets.impl.ResourceResolver that knows how to get at the debug.xhtml file, and just use the existing facelets.RESOURCE_RESOLVER parameter to access it. No phase listener would be necessary, and the existing ViewHandler mechanisms would operate as usual to show the debug screen.
Some sort of chaining of ResourceResolvers should be done, so that apps with an existing ResourceResolver will work. My preference would be for Facelets core to alter its use of the facelets.RESOURCE_RESOLVER parameter, to treat it as an ordered list of ResourceResolvers, much like how the facelets.LIBRARIES and facelets.DECORATORS parameters work.
In the immediate term, to simplify my proof of concept code, I will add a second parameter called seam.RESOURCE_RESOLVER which org.jboss.seam.debug.jsf.SeamDebugResourceResolver will delegate to.
So, to recap, here are some configuration examples:
Current way, with a custom ResourceResolver:
web.xml
<context-param>
| <param-name>facelets.RESOURCE_RESOLVER</param-name>
| <param-value>com.mycompany.CustomResourceResolver</param-value>
| </context-param>
|
Short-term solution, with Seam debug ResourceResolver, and no other custom ResourceResolver:
web.xml
<context-param>
| <param-name>facelets.RESOURCE_RESOLVER</param-name>
| <param-value>org.jboss.seam.debug.jsf.SeamDebugResourceResolver</param-value>
| </context-param>
|
Short-term solution, with Seam debug ResourceResolver, and a custom
ResourceResolver:
web.xml
<context-param>
| <param-name>facelets.RESOURCE_RESOLVER</param-name>
| <param-value>org.jboss.seam.debug.jsf.SeamDebugResourceResolver</param-value>
| </context-param>
| <context-param>
| <param-name>seam.RESOURCE_RESOLVER</param-name>
| <param-value>com.mycompany.CustomResourceResolver</param-value>
| </context-param>
|
Potential long-term solution, with Seam debug ResourceResolver, and a custom ResourceResolver, chained:
web.xml
<context-param>
| <param-name>facelets.RESOURCE_RESOLVER</param-name>
|
| <param-value>org.jboss.seam.debug.jsf.SeamDebugResourceResolver;com.mycompany.CustomResourceResolver</param-value>
| </context-param>
|
To try out the proof-of-concept method (short-term), do the following:
1. Disable the SeamDebugPhaseListener by commenting out the lifecycle
phase-listener block in src\debug\META-INF\faces-config.xml
2. Copy and paste the following Java source code, and save it to src\debug\org\jboss\seam\debug\jsf\SeamDebugResourceResolver.java
3. Tell the web app about SeamDebugResourceResolver. I added the following
block to both examples\dvdstore\resources\WEB-INF\web.xml and examples\hibernate\resources\WEB-INF\web.xml
<context-param>
| <param-name>facelets.RESOURCE_RESOLVER</param-name>
| <param-value>org.jboss.seam.debug.jsf.SeamDebugResourceResolver</param-value>
| </context-param>
|
4. Rebuild Seam so that the change to the phase-listener will take effect.
5. Build and deploy the web apps
##############################
SeamDebugResourceResolver.java
##############################
package org.jboss.seam.debug.jsf;
|
| import java.io.IOException;
| import java.net.URL;
|
| import javax.faces.context.FacesContext;
| import org.jboss.seam.core.Init;
|
| import com.sun.facelets.impl.ResourceResolver;
| import com.sun.facelets.impl.DefaultResourceResolver;
|
| /**
| * Intercepts any request for a path like /debug.xxx and renders
| * the Seam debug page using facelets.
| *
| * @author Mark Collette
| */
| public class SeamDebugResourceResolver implements ResourceResolver
| {
| private final static String PARAM_RESOURCE_RESOLVER = "seam.RESOURCE_RESOLVER";
|
| private ResourceResolver delegate;
|
| public SeamDebugResourceResolver()
| {
| delegate = buildDelegateResourceResolver();
| }
|
| public URL resolveUrl(String path)
| {
| System.out.println("SeamDebugResourceResolver.resolveUrl() path: " + path);
| if ( path!=null && path.startsWith("/debug.") && Init.instance().isDebug() )
| {
| URL url = SeamDebugResourceResolver.class.getClassLoader().getResource("META-INF/debug.xhtml");
| System.out.println("SeamDebugResourceResolver.resolveUrl() url: " + url);
| return url;
| }
| return delegate.resolveUrl(path);
| }
|
| private ResourceResolver buildDelegateResourceResolver()
| {
| FacesContext ctx = FacesContext.getCurrentInstance();
|
| ResourceResolver resourceResolver = null;
| String paramResourceResolver =
| ctx.getExternalContext().getInitParameter(PARAM_RESOURCE_RESOLVER);
| if( paramResourceResolver != null && paramResourceResolver.length() > 0 )
| {
| try
| {
| Class resourceResolverClass = Class.forName(
| paramResourceResolver,
| true,
| Thread.currentThread().getContextClassLoader());
| resourceResolver = (ResourceResolver) resourceResolverClass.newInstance();
| }
| catch(Exception e)
| {
| throw new RuntimeException("Problem initializing Seam delegate ResourceResolver: " + paramResourceResolver, e);
| }
| }
| if( resourceResolver == null )
| resourceResolver = new DefaultResourceResolver();
| return resourceResolver;
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994352#3994352
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994352
19 years, 7 months
[JBoss Seam] - Re: No page context active - ICEFACES
by costeen21
I'm using 1.1.0.GA is now giving me a similiar problem.
16:39:22,717 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
java.lang.NullPointerException
at org.jboss.seam.contexts.ServerConversationContext.flush(ServerConversationContext.java:210)
at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:348)
at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:248)
at org.jboss.seam.jsf.AbstractSeamPhaseListener.afterRender(AbstractSeamPhaseListener.java:232)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:89)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:306)
at com.icesoft.faces.webapp.xmlhttp.FileUploadServlet.execute(FileUploadServlet.java:85)
at com.icesoft.faces.component.inputfile.FileUploadServlet.SaveFile(FileUploadServlet.java:233)
at com.icesoft.faces.component.inputfile.FileUploadServlet.processMultipartContent(FileUploadServlet.java:161)
at com.icesoft.faces.component.inputfile.FileUploadServlet.doPost(FileUploadServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994349#3994349
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994349
19 years, 7 months
[Beginners Corner] - Connection Pooling java.sql.Connection?
by deadend5001
I am trying to connection pool a AS400 JDBC Connection. Have been trying to find a good tutorial but have yet to find one.
Basically right now for each user I am creating a connection (example below). I would like to get a pool of these types of connections that expands when necissary, and contracts say after 30 minutes.
| public static java.sql.Connection getApplicationSecurityConnection() {
| String description = "Connection to the Application Security Database";
| //String driver = "com.inet.tds.TdsDriver";
| //String protocol = "inetdae";
| //String serverDNS = "localhost";
| //String port = "1433";
| //String instance = "";
| //String database = "APP_SECURITY";
| //String user = "security";
| //String password = "ssSetjESN5sgve6jQdNM8BTra";
|
| String driver = "com.ibm.as400.access.AS400JDBCDriver";
| String protocol = "";
| String serverDNS = "";
| String port = "";
| String instance = "";
| String database = "";
| String user = "CPSERVER";
| String password = "CPPROFILE";
|
|
|
| java.sql.Connection conn = null;
| try {
| // make sure DriverManager can load proper class to establish connection
| Class.forName(driver);
| String URL = "jdbc:" + protocol + ":" + serverDNS;
| Properties DBProperties = new Properties();
| if (!port.equals("")){
| DBProperties.setProperty("port",port);
| }
| if (!instance.equals("")){
| DBProperties.setProperty("instance",instance);
| }
| if (!database.equals("")){
| DBProperties.setProperty("database",database);
| }
| if (!user.equals("")){
| DBProperties.setProperty("user",user);
| }
| if (!password.equals("")){
| DBProperties.setProperty("password",password);
| }
| if(!getApplicationName().equals("")){
| DBProperties.setProperty("appname",getApplicationName());
| }
| conn = DriverManager.getConnection(URL,DBProperties);
| if (conn == null){
| throw new Exception("getDATAConnection(String, String): Unspecified error occured.");
| }
| } catch (Exception e) {
| System.out.println("\n\n*******************************************************");
| System.out.println("CONNECTION ERROR!!!!");
| System.out.println("DESCRIPTION: " + description);
| System.out.println("ERROR: " + e.getMessage());
| System.out.println("\n\n*******************************************************");
| e.printStackTrace();
| }
| return conn;
| }
any help us MUCH appreciated
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994347#3994347
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994347
19 years, 7 months
[JNDI/Naming/Network] - Listing EJB and services
by danieldestro
Hi all,
We are starting in this new SOA world in the company. Our services are implemented as Statless Session Beans (EJB) and are deployed in separate JARs for each different business module/service. We are using Java 5 and JBoss 4.0.3-SP1 and EJB 2.1.
I need to list all this services in a web page (jsp), just to monitor all the services that are deploy in that particular JBoss instance. For admin purpose.
First of all, not every EJB is a service. Only some of them are intended to be as such. So, we decided to use the @SOAService annotation created by us, just to identify it as a service in our environment as a service.
Then I will list every ejb deployed in our environment and verify if the class is annotated with @SOAService. If so, I´ll show it in the jsp monitor page.
I am having difficulty to find documentation concerning on how to list all the EJBs and do this verification.
This page http://jboss.org/wiki/Wiki.jsp?page=DisplayTheJDNITreeWithTheJMXConsole shows the jmx-console fpr what I want. I tried to do exactly the same as they do there to retrieve the information I want. But no luck at all.
Where can I find more info about what I want to do?
Or, if there is a simpler better solution than mine, please, let me know. I´d be very glad.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994346#3994346
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994346
19 years, 7 months
[Management, JMX/JBoss] - Listing EJB and services
by danieldestro
Hi all,
We are starting in this new SOA world in the company. Our services are implemented as Statless Session Beans (EJB) and are deployed in separate JARs for each different business module/service. We are using Java 5 and JBoss 4.0.3-SP1 and EJB 2.1.
I need to list all this services in a web page (jsp), just to monitor all the services that are deploy in that particular JBoss instance. For admin purpose.
First of all, not every EJB is a service. Only some of them are intended to be as such. So, we decided to use the @SOAService annotation created by us, just to identify it as a service in our environment as a service.
Then I will list every ejb deployed in our environment and verify if the class is annotated with @SOAService. If so, I´ll show it in the jsp monitor page.
I am having difficulty to find documentation concerning on how to list all the EJBs and do this verification.
This page http://jboss.org/wiki/Wiki.jsp?page=DisplayTheJDNITreeWithTheJMXConsole shows the jmx-console fpr what I want. I tried to do exactly the same as they do there to retrieve the information I want. But no luck at all.
Where can I find more info about what I want to do?
Or, if there is a simpler better solution than mine, please, let me know. I´d be very glad.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994345#3994345
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994345
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by lightbulb432
Thanks for the clarification. Here are a couple more questions I have in addition to my previous posting:
1)
Let me clarify if I have a correct understanding of annotations and lifecycle based on the past several posts. Perhaps somebody could clarify, correct or add additional info to what I describe below:
Stateful Session Bean:
A conversation begins when an action is called by a JSF view on a method marked @Begin. The conversation ends upon timeout or when a method marked @End is called.
In either case of an ended conversation, Seam calls the @Destroy method, in which the developer puts ????? code. Because that same method is required to be marked @Remove by Seam, the bean is to be discarded. Before the bean is actually discarded, though, the @PreDestroy method is called.
Stateless Session Bean:
A conversation begins when an action is called by a JSF view on a method marked @Begin. The conversation ends upon timeout or when a method marked @End is called.
In either case of an ended conversation, Seam calls the @Destroy method, in which the developer puts ????? code. Because SLSBs can't have @Remove methods, this is where I get confused for SLSBs.
2)
When we say "Seam calls the @Destroy method", what exactly is "Seam" in that context? Is it through that SeamInterceptor or some kind of SeamPhaseListener thing that we put into the Seam configuration files? How does Seam actually sit on top of JSF to do what it does? (I tried to do the debug from FacesServlet onwards, but seam-gen didn't bring include any source code in the final build so I'm tracking them down for all the JARs one-by-one. Is including the source code a worthwhile suggestion for seam-gen?)
3)
Must @Begin and @End methods be defined on the same bean class (e.g. RegisterBean), or can a @Begin method in one bean start a conversation that is ended by an @End method in another bean (e.g. MaintainRegistrationBean)? I tried it out but can't tell for sure if it's supposed to work that way or not...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994342#3994342
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994342
19 years, 7 months
[Clustering/JBoss] - Re: Clustering local interfaces.
by bstansberry@jboss.com
I'll preface this all by saying you're going to have to try it out; I'm pretty sure most of our unit tests involve EJBs with remote interfaces.
Clustering an EJB does the following for you:
1) On the client side:
Client gets a smart proxy that automatically tracks cluster topology, load balances calls around the cluster, and can fail over to another server if it detects certain kinds of failures during a call.
(Note the client can be inside the appserver with the beans; 'client' is any code that access the beans and makes calls on them.)
2) On the server side:
For beans with state, keeps state in sync between servers. For SFSBs that means replicating state. For entities, that means invalidating local caches if an entity is changed on another server. (For EJB3 entities it currently means replicating state; this may move to an invalidation model or to a choice.)
OK, with all that spelled out, now to answer your question...
The client-side benefits don't apply if you have no remote interface, since without it a client can only interact with a bean in the same jvm.
The server side benefits do apply. For example, if the 'client' is a servlet contacting an SFSB, if you store an EJBHandle in the session and replicate the session, if the user fails over to another server, the EJBHandle can be used to retrieve the SFSB.
SLSBs have no state, so there is no benefit to marking an SLSB with no remote interface as clustered.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994339#3994339
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994339
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by ccanning
@Destroy - Designates a destroy method that is called when a context ends and the component is being disposed. (Seam annotation)
@Remove - Applied to a business method of a stateful session bean class. Indicates that the stateful session bean is to be removed by the container after completion of the method. (EJB annotation)
If your SFSB lives beyond the seam context and you require cleanup, then this may be different from the EJB remove method which after a successful call indicates to the container that the bean can effectively be removed from the system. It is also recommended that resource cleanup, be done in the @PreDestroy method which is called before the @Remove method is called.
Hope this provides a little more clarity.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994332#3994332
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994332
19 years, 7 months
[JBoss Messaging] - sp2 upgrade failure
by nbreau
We just upgraded our jboss server to 1.0.1sp2 and are getting the following error when our application is trying to connect to jboss:
If anyone could let me know what jar i need to add to my application that would be great. We're already including jboss-messaging-client.jar but the class still isnt found.
ERROR [main] - Failed to config client side AOP
org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for locator - InvokerLocator [socket://192.168.2.181:4457/?clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.server.remoting.JMSWireFormat&serializationtype=jboss&socket.check_connection=false&unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat]
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:323)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:125)
at org.jboss.remoting.Client.invoke(Client.java:589)
at org.jboss.remoting.Client.invoke(Client.java:581)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.invoke(ClientConnectionFactoryDelegate.java:199)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$getClientAOPConfig_8697532701842707646.invokeNext(ClientConnectionFactoryDelegate$getClientAOPConfig_8697532701842707646.java)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPConfig(ClientConnectionFactoryDelegate.java)
at org.jboss.jms.client.JBossConnectionFactory.ensureAOPConfigLoaded(JBossConnectionFactory.java:233)
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:196)
at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:96)
at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:91)
at com.company.xyz.exploration.services.mq.AsyncLinkDiscoveryMQConsumer.connect(AsyncLinkDiscoveryMQConsumer.java:89)
at com.company.xyz.exploration.services.mq.AsyncLinkDiscoveryMQConsumer.start(AsyncLinkDiscoveryMQConsumer.java:62)
at com.company.xyz.exploration.Explore.main(Explore.java:21)
Caused by: java.lang.ClassNotFoundException: org.jboss.jms.client.remoting.ClientSocketWrapper
at org.jboss.remoting.loading.ClassByteClassLoader.findClass(ClassByteClassLoader.java:372)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.remoting.transport.socket.SocketClientInvoker.createClientSocket(SocketClientInvoker.java:145)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:699)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:319)
... 13 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994331#3994331
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994331
19 years, 7 months