Need sample jboss-web.xml for jboss-6.4.8 version - jboss

We have recently upgraded our application from JBoss 5 to JBoss 6.4.8 version.
In JBoss 5 version, We were using the jboss-web.xml which has following attributes defined
<security-domain flushOnSessionInvalidation="true"/>
<use-session-cookies>true</use-session-cookies>
The same jboss-web.xml is not working with jboss 6 version.I need the sample jboss-web.xml and also wants to know how we can set the above attributes in the jboss 6 version.Any help on this will be greatly appreciated.

Have a look at $JBOSS_HOME/docs/schema/ there should be all deployment descriptors available as xsd. And yes flushOnSessionInvalidation no longer is part of jboss-web.xml. But i think they fixed it with EAP Versions 7.0.8.CR1, 7.0.8.GA. Have a look at JBEAP-11895
As for your problem have a look at this answer.
In the comments section of WFLY-3221 is also an example.

Related

Migration from JBoss 4 to JBoss 6. What to concider?

I'm trying to deploy my application in JBoss AS 6. Currently it is deployed in JBoss version 4.
So what are the things I need to consider when doing this?
Any help will be highly appreciated. Thanks.
You're talking about two major versions change, so, expect a lot of things to happen. Some steps that might be helpful:
Make an inventory of everything that is JBoss-specific in your project: deployment descriptors being the most common examples, but you might also be implementing some specific classes for your own use, or things like that
Make an inventory of the Java EE APIs that you are using. For instance, JPA 1.0, JSP 1.1 and so on. With those, compare with the APIs that are available for AS 6. I guess that most of your work will be centered here.
You might also want to take note of changes in the Java version (AS 4 was released during the days of Java SE 5, IIRC).
Finally, you might want to take a look at the Windup project, which is a tool that can help you migrate your applications to JBoss AS. Note, however, that it will not give you a comprehensive list of everything you need to do, but will certainly give you good hints.
One last comment: you might want to consider migrating to JBoss EAP 6, which is JBoss AS 7, or even migrating to Wildfly 8 (the successor of JBoss AS 7).

Determining version of jboss programmatically between jboss 5 and 7

I'm trying to find the best way to grammatically determine if my program is running on Jboss 5 or Jboss 7 (eap-6.1). The ways I've been finding so far are jboss 5 or jboss 7 specific, which doesn't work because the code has to work in both. Tried both solutions from here: How do I programmatically obtain the version in JBoss AS 5.1? and they didn't work. One complained about org.jboss.Main not existing in jboss 7, the other complained aobut not finidng "jmx/rmi/RMIAdaptor".
The only way I can see is to do Class.forName to look for "org.jboss.Version" (should be found if jboss 5) and if that fails, do Class.forName "org.jboss.util.xml.catalog.Version" (jboss 7). But that seems like a terrible idea.
The reason I need to know if the war is running on jboss 5 or 7 is because there are some custom files that are located in different places in both. So it's like "if jboss 5, execute this piece of code, if jboss 7 execute the other.
Ok i just saw what the problem is.
I would suggest you to think about design issues/refactoring of your software.
If you want to provide your software within different environments, seperate your logic from
technology dependencies.
Build facedes and interfaces to meet environmental requironments.
In my oppionen thats much better as to think we must support all integration platforms and support all there versions. This is completely impossible.
So decouple your business logic and offer specific interfaces. These interfaces (adapters) are much simplier to implement and to maintain.
Hope it helps.
UPDATE DUE TO COMMENT.
I think a solution is for servers 4 to 6 is to use
the MBean Server of JBoss to lookup the registered web application
which is associated to the deployed WarFile.
I suggest first to lookup the registered MBean of the web application manually using the JBoss jmx-console. The name of the WebApplication should be found under the capital "web" or "web-deployment" within the jmx-console.
If you found that name you can implement an own jmx based lookup mechanism
to check for that name.
Here is an Tutorial: pretty old but i think it gives you an idea how to do.
There must be more tutorials for this problem:
http://www.theserverside.com/news/1364648/Using-JMX-to-Manage-Web-Applications
Within JBoss 7 i just can give you the hint that its architecture is based on OSGI. So to lookup for other services you should have a look to this mechanism.
In any case you don't have direct access to the file system and the deployment directory
from an application which is deployed within a JEE container, except of
using the mechanisms provided by the container. JNDI Lookup, JMX ManagedBean mechanism, Java Connector Archicture (JCA) (makes no sense in your case)
It's not an answer just an suggestions since the implementations are completely different
One way could be to use the "interceptors" which are executed during bootstrap and before any ejb invocation and there you have access to the invocation context in other words ejb container.
I can't give you any example but this would be an access point to start.
Another accesspoint is to check for system wide JMX Beans by looking through the
Adminstratore console of the JBoss Server.
You can inject JMX Bean state into your application through the Context Mechansim.
Take a look from Version 4 to 6 at the JMX Managed Bean mechanism. The JMX Achitecture is the main concept of JBoss 3 to 6, so at this point you can influence and maintain the JBoss behaviour.
Aditionally i think you have differences from 4 to 6.x version and 7.0 because since
7 it's a completely new architecture. Since 7.0 the JMX architecture doens't exists anymore.

Jboss 7 vs Jboss 4

I found this great tutorial for JAAS with JBoss, but the problem is that it is an older version. In this tutorial to define application authentication policy at JBoss you need to use "login-config.xml" in this directory -> D:\jboss-4.2.3.GA\server\mmazharhassan.com\conf\login-config.xml which doesn't exist in version 7. The writer is describing also this file "mazhar-ds.xml" in this directory -> D:\jboss-4.2.3.GA\server\mmazharhassan.com\deploy\
mazhar-ds.xml.
I would like to ask you what is the difference in newer version or how do I implement this Java Authentication and Authorization Service in JBoss 7 because i can't find any good tutorial for the version 7 (or where do I find all these files).
EDIT:
I'm sorry maybe for stupid questions, but I'm complete beginner in this.. :(
You can implement a JAAS Module in the same way you did it in JBoss 4, but the configuration of it is different.
What you probably should look at, is the http://docs.jboss.org/teiid/7.2.0.Final/developer-guide/en-US/html/custom_login_modules.html
Especially, the DatabaseLoginModule might be interesting for you.

Is possible deploy applications developed with GWT 2.x on Jboss 4?

I want to know if is possible deploy GWT 2.x applications on server with support for the servlet spec 2.4 like JBoss 4.
I have reviewed the official documentation but apparently there is no dependences. So my questions are:
Is possible?
Is needed workarounds?
Any has some previous experience?
Yes It is possible. You can deploy GWT applicaions to any external web server like Tomcat, Jboss etc. Your question is bit wide in context. So, better look at some tutorials.
This tutorial will help you more. I have not gone into details of this but seems good.

Is there a way to integrate CommonJ WorkManager with JBoss 5.1

I did find a Jboss Commonj Service on sourceforge, but that appears to be for JBoss 4x.
Any pointers would be great..
Found that the following also works for JBoss 5 as well.
link