Jboss 7 vs Jboss 4 - jboss

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.

Related

get started with wildfly confusing

Can anyone suggest a good tutorial how to get started with a JEE application using WildFly server?
I am little confused right now cause at first I decided to start with an official website of the wildfly.
I found some guide links in there and seems like a half of pages are not found or missed.
For example, they have a Getting Started Developing Applications Guide link, when I go there there is another one link which leads to the github page and returns 404 page.
Ok then, i wen to github page with documentation and found following section which describes a list of quickstarts.
So as it says
Quickstarts with tutorials in the Get Started Developing Applications are noted with two asterisks ( ** ) following the quickstart name.
But again if you go to this link it is not found as well and so on.
To be honest I am kind of tired of this confused documentation so I am looking for a best approach how to get my JEE application up and running using WildFly as a server container.
So any suggestions would be really appreciated! Thanks in advance.
If you want to get started with Java EE then have a look at the Java EE 7 tutorial.
If you're looking to just start WildFly so that you can deploy an application you simple download the zip, extract it and use either bin/standalone.sh or bin\standalone.bat to start it. You can get further information about getting started with WildFly here.
The quickstarts are good examples of some simple applications that can be deployed. The README is pretty descriptive on how the quickstarts themselves work, but isn't meant to be a Java EE 7 tutorial.

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.

Accessing JBoss 5 EJB3.0 from JBoss 7.1 EJB3.1

I have a bunch of services (EJBs, remotem stateless) running on JB-AS 5.1.0. Now I have a new AS7.1 on which I develop new Services (JEE6, EJB, CDI, ...)
I want to access the AS5.1 Services via remote JNDI.
Has anyone done this before and can help? I need my JEE6-Beans to have access to the AS5.1 client-jars, so I am trying to add them to ear/lib or create a module containing the jars, but so far without luck ...
The best solutions I have seen so far can be found here. You can follow this forum for more information.
Please post your findings here so others can help / benefit.
Good luck!

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.