Want a FREE WebSphere Eclipse IDE and development server with that?


UPDATE: We’ve posted some Java EE 6 development courses that use WebSphere and Eclipse to highlight this capability.  The best place to find these classes is in the WebSphere 8.0 Programming category.

UPDATE: If you are also interested in Spring tools for WebSphere development you might check out a related blog post – How about a FREE set of WebSphere and Spring Eclipse Development Tools?

UPDATE: Currently the versions of the Eclipse and WebSphere downloads are different than those detailed here.  The same process still works though and the important part is that if you want to run a WebSphere server from Eclipse (one of the main reasons to perform this setup) the Eclipse instance has to point to the IBM JVM. This is easiest to do by pointing it to the IBM JVM installed with the ‘WebSphere for Developers’ as outlined in this post.  Post questions if you have any as I try to keep up with the comments on this post.

ORIGINAL POST:

For the longest time the biggest complaint we’ve heard from developers who use WebSphere is “We can’t just use Eclipse!”.  In fact, the fact that the only “official” development support IBM would provide for WebSphere was Rational Application Developer created an entire market for MyEclipse Blue of people that didn’t want to pay for RAD but developed for WebSphere.  Even MyEclipse Blue is not free though, it is just cheaper than RAD.

So to solve this problem you do not know how many WebSphere shops I’ve seen that:

  • Do development with Eclipse
  • Manually add Java EE/WebSphere JARs to the classpath
  • Try to automate the process of exporting an EAR and deploying to WebSphere the best they can

Well now it is MUCH EASIER!  IBM has just released FREE Eclipse plugins to deploy/start/stop WebSphere v7.0 and v8.0 servers from the Eclipse ‘Servers’ view.  I bet you aren’t used to hearing IBM and “free” in the same sentence!  These are only available for WebSphere Application Server v7.0 & v8.0 (no WebSphere 6.1, WebSphere Portal or Process Server) but these are some of the most common WebSphere environments right now and in the near future.

All of this is done with the “WebSphere Application Server Developer Tools for Eclipse” in the “WASdev” community on IBM Developerworks.  Although you might see a lot of discussion about the WAS 8.5 “Liberty” profile which is an early program of some other exciting things they are doing, the WAS Developer Tools for Eclipse is something you can use NOW.

Setup Steps

Although you can certainly get some more info on how to use these new tools from the official announcement and the WASdev downloads page, I figure I would take it one step further and give you a complete set of instructions along with some screenshots for doing this on Windows.  It is really easy to do.

First of all I am going to assume for now that you are only using this for WebSphere v7.0 or v8.0 and not the “early program” (or Alpha) WAS 8.5 Liberty edition.  The reason this is important is the version of Eclipse to use.  For WAS 7 & 8 you will use Eclipse Helios.

UPDATE: It has been pointed out that there are 32-bit and 64-bit versions of both Eclipse and WebSphere.  The type you use for both has to be the same.  I would suggest the 32-bit since for development you don’t really need the expanded memory addresses of the 64-bit.  If for some reason you are using different architectures for the two products and getting an error probably the easiest way to fix it is to get the Eclipse version that matches the WebSphere you have installed.

  • First you will need to have a Java installation just like any other Eclipse environment even though we will just use it for the updates.  Later we will link Eclipse to the JVM installed with your local WebSphere server (this will be important).  You can get the Java download here although make sure it is not a ‘Java SE 7’ download as the Eclipse we will start with wouldn’t support that.
  • Next, go get the Helios release of the Eclipse for Java EE Developers.
  • Unzip the Eclipse download into an empty directory where you want Eclipse software to run from.  Even after we update with WebSphere tools it will run from this directory.
  • Run the ‘eclipse.exe’ file in the root of where you extracted Eclipse and open Eclipse in an empty “workspace” directory.  We won’t be creating projects yet but we still need to open a workspace to run the updates we need.
  • Make sure you are able to connect to the internet from within Eclipse.  If you have a proxy configuration this might mean going into the Eclipse preferences (Window –> Preferences) and the ‘General –> Network Connections’ section to setup network details.  A lot of times though Eclipse might be able to pick up your native internet settings so I would try this only if you have problems in the next steps.
  • Close the preferences if you had them open.
  • Once Eclipse opens, select ‘Help –> Check for Updates’ and wait for the update sites to be contacted.
  • Leave the default selected to update ‘Eclipse IDE for Java EE Developers’ and click the Next button.

image

  • Click the Next button again to confirm the update.
  • Accept the license terms and click the Finish button.
  • Once the installation of updates is complete, click the Restart Now button.
  • When prompted, open to the same workspace as before.
  • From the running Eclipse, select Help –> Eclipse Marketplace.
  • On the dialog that appears, leave Eclipse Marketplace selected and click the Next button.
  • On the Search tab that appears, fill in ‘WebSphere’ into the box and click the Find button.

image

  • Select the WebSphere v7.0 or v8.0 tools depending on which you want and click the Install button next to the one you want.  Note that the WebSphere v7.0 tools have an 8.0.4 in the text description but this is just the version of the Eclipse plugins.  If you want to do both you can, just select one and continue and then repeat the process after restarting Eclipse after the first set of tools is installed.

image

  • Leave the option to install your chosen tool version and click the Next button.

image

  • Accept the license terms and click the Finish button.
  • If prompted about installing unsigned content click the OK button to continue the installation.
  • Once the installation of updates is complete, click the Restart Now button.
  • When prompted, open to the same workspace as before.
  • After Eclipse opens, exit from Eclipse.

So that’s all you need right?  Not quite.  Besides the Eclipse tools you will also need a local WebSphere 7 or 8 test server. I know some of you are saying “darn, I knew this couldn’t be completely free!” Fear not! I promised the development environment would be completely free and it is because IBM has offered for a while now the WebSphere Application Server for Developers product, a COMPLETELY FREE version of WAS for development that is NOT a trial or expiring edition and is built from the same codebase as the production versions. The best link I’ve found to go straight to the WAS for Developers downloads is here.  For those of you with IBM Passport Advantage download abilities there is also a ‘WebSphere Application Server for Developers – Eclipse Tools Edition’ which has all of this but there is also a lot of stuff you probably don’t need.

We will also need to link the Eclipse environment to the Java JVM installed with the WebSphere server.  If you don’t do this you won’t be able to define a WebSphere server in Eclipse as the WebSphere Developer Tools will check that you are using an IBM JVM.

So just a few more steps and we will be set!

  • After downloading WebSphere Application Server for Developers from the link above or here go ahead and install it.  This will differ slightly depending on the version so it isn’t detailed here but should be pretty straightforward.  I always suggest NOT installing under the Windows ‘Program Files’ directories as on Windows Vista and above I have seen cases where Windows won’t let you save WebSphere configuration files so your configuration changes are mysteriously “lost”.
  • Once you have WAS installed make sure you have a “profile” configured.  This is the configuration that will serve as your test server.  You can run the ‘Profile Management Tool’ if a profile isn’t created during installation.  If you run the Profile Management Tool I always like to select the “Advanced” profile creation because you can use the “development template” for better development performance, make sure the server uses the default ports and NOT have the server run as a Windows service.  No matter how it is created know the name of the profile that you will use.
  • After WAS for Developers is installed go to the directory where you unzipped Eclipse.  Find the ‘eclipse.ini’ file and open it with a text editor.  The extension may be hidden and just list the file type as ‘Configuration Settings’.

image

  • Once you have the file open, add the following lines to the start of the file, substituting for <WAS Install Root> the directory you installed WAS at.  In the screenshot below my <WAS Install Root> was ‘C:\IBM\WebSphere\AppServer’.  Save the file when it is like below.  Make sure when you save it the file extension is not changed.

-vm
<WAS Install Root>\java\jre\bin\javaw.exe

image

UPDATE: As suggested in the comments, another way to alter the JVM used to start Eclipse is to add the ‘-vm <Path to JVM>’ syntax to the ‘Target’ property of a desktop shortcut that is used to launch Eclipse.  Setting the value in the ‘eclipse.ini’ file is to set the default and the command line option overrides this.  Your approach will probably depend on if you develop WebSphere and non-WebSphere projects with the same Eclipse install.

  • Once you have modified and saved the ‘eclipse.ini’ file, open Eclipse again to the same workspace.
  • Close the ‘Welcome’ page if it appears and find the ‘Servers’ view along the bottom.  This should open by default in the ‘Java EE’ perspective that should also be the default.
  • Right click in an empty area and select ‘New –> Server

image

  • Expand IBM and select your version of WAS and click the Next button.  This is where you would have errors if you hadn’t started Eclipse with the IBM JVM.

image

  • Since this is the first WebSphere server you defined, hit the Browse button and find the root directory of the WebSphere installation.
  • Once you have the WebSphere installation directory click the Next button.
  • On the next page make sure the correct profile name is listed in the drop-down.  Also make sure to supply security settings if you enabled security when the profile was created.
  • Once your settings are configured click the Finish button.
  • Start deploying projects from your workspace by right clicking the WebSphere server and selecting ‘Add and Remove..’, start and stop the server, even open the WebSphere Admin Console by going into the ‘Administration’ menu when right clicking!  In short, do all the things you’ve ever wanted to do to deploy and test on WebSphere from Eclipse!

image

Conclusion

So now you have a way to do WebSphere development with completely free tools without having to deploy remotely, hack the project classpath, come up with Ant scripts just to export and deploy, etc.  Obviously this opens up a whole new realm of possibilities for WebSphere development.  You will have much more freedom to construct the development environment that suits your project best but still make sure you are testing against WebSphere.

Since this is obviously a thing we know our own clients have been looking to do for quite a long time we plan on using this in several areas.  We will likely release a few Java EE training classes that use Eclipse and WebSphere 7.0 just to prove this is a completely capable development environment and let people get familiar with it.  We will also start using this quite heavily in the Java EE 6 on WebSphere 8.0 courses that will be posted soon.  We will also use this in our Spring 3 classes since one of our unique offerings has always been offering Spring development training on WebSphere.  Look for another blog post soon about the best development environment to use for Spring development for WebSphere.

So start dancing in the streets, we can finally develop and test WebSphere applications on “regular” Eclipse!

  1. #1 by Farida Damani on January 6, 2012 - 3:26 pm

    Thank you so much. Article is very helpful.

  2. #2 by Udo Gebbeken on January 24, 2012 - 5:54 pm

    Hi Stuart, thanks for this solution. But: setting the jvm inside eclispe.ini using eclipse helios sr 2 dont work. maybe windows environment variables causes this. after a while i found: setting the jvm as eclipse-startup-parameter in the command line works fine.
    greetings
    udo

  3. #3 by Stuart Smith on January 24, 2012 - 6:23 pm

    I had not tried with a “default” Java JRE installed so perhaps if you had that something might get in the way.

    Overall though the eclipse.ini file should override the “default” JVM in Windows. Perhaps there was something in the syntax you had that was not quite right? If you want to post the whole text of the command line syntax you used that might help people if they have the same trouble.

    I think the good thing though is the WebSphere Eclipse plugins check this and won’t let you define a WebSphere server if you don’t have the IBM JVM in use. This helps catch the problem if Eclipse starts accidentally with another JVM.

  4. #4 by Udo Gebbeken on February 5, 2012 - 8:56 am

    In this case, the command-line is very simple and works fine:
    C:\eclipse\eclipse.exe -vm C:\IBM\WebSphere\AppServer\java\jre\bin\javaw.exe
    At work, I use different links for working with different workspaces. There I use a few more command-line-Parameters. I think, this generally is a good way to affect the eclipse startup.

  5. #5 by Stuart Smith on February 5, 2012 - 3:32 pm

    That is a good idea as well. I guess if you use Eclipse for some WebSphere projects and some other projects, the command line is the better approach.
    You are also likely using different workspaces as well so adding the ‘-data’ option along with the full path to the workspace would be useful also. I have different desktop shortcuts for that and can easily see applying the same logic to different VM startup parameters.

  6. #6 by Elmo R on February 9, 2012 - 9:49 am

    Is there a way that I can print this page (or a print css version)? When I attempt to do so, I just get 1 page printed out. Firefox 3.6.26/Linux

  7. #7 by Stuart Smith on February 12, 2012 - 12:24 am

    I’m not sure why it isn’t printing out right for you. If you aren’t already try to click the title of the post so you only see that on the page. Other than that you might need to copy and paste into a word processing program like Open Office to try.

  8. #8 by Adrian R on March 24, 2012 - 5:55 pm

    Nice Stuart thanks for this update, I have had the same experience with clients wanting to avoid using RAD (for cost reasons) and use Eclipse instead but deploy to WAS. This was a useful posting that I will share with students in future classes.

  9. #9 by Stuart Smith on March 25, 2012 - 12:01 pm

    I am about to release the first class we will have that uses Eclipse for WebSphere. This will actually be WA2014 Core Spring 3 Using Eclipse and WebSphere which includes Spring 3 Eclipse tools also. We had tried releasing a Spring 3 class using RAD and Spring tools and RAD just wasn’t very stable. I am going to write a post comparing the experience because doing Spring 3 development with Eclipse for WebSphere has been great.

  10. #10 by Ed on April 9, 2012 - 1:59 pm

    How do you deploy a war/ear within eclipse using the WebSphere plugin? I can start, stop, bring up the admin console within Helios but when I click on Add and Remove the project do not show up.

  11. #11 by Stuart Smith on April 10, 2012 - 12:29 am

    You would need to have a “Dynamic Web Project” created in the Eclipse workspace to be able to deploy. With WebSphere you also often need to have an EAR project which includes the web project as WebSphere will only show EAR projects in the Add/Remove dialog.

    The instructions in the post are mainly about installing the Eclipse plugin and the WebSphere for Developers software so you can create projects in Eclipse and be able to deploy them to WebSphere. Nothing really about creating the projects is unique to WebSphere which is why it wasn’t mentioned.

  12. #12 by Ed on April 10, 2012 - 1:31 pm

    Please allow me to clarify my question. I have a dynamic web project and an ear project created in Eclipse. Both are managed by maven m2 eclipse plugin. WAS 8 developer edition is installed and appears under Servers. The project builds without errors and now I wish to deploy the war or ear to WebSphere within Eclipse. If the ear does not show up in Add/Remove dialog then how to you deploy to the server? If you manually have to install the ear via the admin console can you still start the server in debug mode? Thanks in advance for your help.

  13. #13 by Stuart Smith on April 10, 2012 - 11:04 pm

    I think the issue is likely with using Maven. Perhaps something about the way Maven is working with the project that is indicating that it can’t be deployed to WebSphere.

    Often the Maven plugin may alter the JDK version that is used on the project. I know that the WebSphere plugin doesn’t like it if the project is not using the IBM JDK. Perhaps this is where the issue is.

    Unfortunately right now the Maven plugin and the regular Eclipse build tools don’t coexist great. It would be great if the Maven plugin integrated with the Eclipse build process better instead of trying to completely take over. Maybe now that m2e is an official Eclipse project this will improve but I don’t know if it will help right now.

  14. #14 by James Rourke on May 2, 2012 - 10:52 am

    I’m following your setup document. There is not much on the actual installation of the Websphere Application Server for Developers. Question – when I do install of this product, should I be using the IBM installation manager?

  15. #15 by Stuart Smith on May 2, 2012 - 11:37 am

    There is not much detail on the install of WAS for Developers because you just follow the standard path to install.

    You do use the IBM Installation Manager (if you are using the 8.0 version or later) because that is the way it is installed. This is a change to installation method introduced in WAS 8.0.

  16. #16 by James Rourke on May 2, 2012 - 2:49 pm

    I downloaded the Websphere Application Server for Developers from the IBM site, using the link in your document. This resulted in 4 zip files being downloaded. I also downloaded the Installation Manager which resulted in IBMIM_win32 application being downloaded. This is probably an IBM installation procedure question, but how do I get the Installation Manger to use the 4 zip files downloaded to install the WAS server? Can anyone help me out?

  17. #17 by Stuart Smith on May 2, 2012 - 6:23 pm

    Typically the files you download are unzipped in the same root location and create their own subfolder for each file that was downloaded. You should be able to look in the WebSphere 8.0 InfoCenter to find more details for how to install. Since this blog post was more about using Eclipse I wanted to focus on that (it’s already long enough). I will try to post a blog post on WAS 8.0 installation using Installation Manager in a few weeks since that is a new feature of WAS 8.0.

  18. #18 by James Rourke on May 4, 2012 - 10:38 am

    Thanks for the reply… I was able to download WAS 7 which resulted in download files where I can see the launcher.exe file – It would be great if you could post the WAS 8 installation because finding your way around the IBM sites can be difficult if you don’t do it often… Thanks again

  19. #19 by James Rourke on May 4, 2012 - 4:57 pm

    I got WAS for developer V7 installed OK – using the IBM install FirstSteps it seemed to start/stop ok… Now when I modify the eclipse.ini file to point at the IBM jre at -vm C:\apps\ibm\WebSphere\AppServer\java\bin\javaw.exe and start eclipse it thinks for a short while then returns a panel

    Java was started but return exit code=13

    Ever see this?

    Also, I installed it on a Windows 7 Home Prem machine. I did get an unknown op sys during the WAS install but the server did start/stop in the IBM First Steps… The WAS logs shows Windows Vista in the messages…

    Whatever help would be appreciated..
    Thanks

  20. #20 by James Rourke on May 4, 2012 - 5:40 pm

    I’ve done some additional reseach and according to some other posts it appears that the jre in websphere v7 is not the same type 32bit -vs- 64bit…

  21. #21 by Stuart Smith on May 5, 2012 - 2:41 pm

    I’ve added a note at the start of the setup step to make sure to use the same type (32-bit or 64-bit). Thanks for pointing this out as I was returning from the IBM Impact 2012 conference and wasn’t able to look into this.

  22. #22 by James Rourke on May 7, 2012 - 10:54 am

    The IBM installation manager can be confusing… when you initially download it, it will be configured to download the Websphere App Server for Developers but it shows a list of “FIXES”.. my initial was that I thought that it was attempting to just perform maintenance on an already installed package. But it will download the software.

  23. #23 by James Rourke on May 9, 2012 - 1:52 pm

    Last question promise — I got both WAS v7 and v8 running. Do you know where I would go to get any updates to the v7 product. Again, very difficult to get any answers from the IBM web site.

  24. #24 by Stuart Smith on May 9, 2012 - 2:45 pm

    James Rourke :

    Last question promise — I got both WAS v7 and v8 running. Do you know where I would go to get any updates to the v7 product. Again, very difficult to get any answers from the IBM web site.

    You can go here to get a list of all fixes and links to download fixpacks for WAS 7.0:
    http://www-01.ibm.com/support/docview.wss?uid=swg27014463

    In general just search for “WebSphere Application Server x.x fixpacks” and look for the “Fix List” link that is coming from ibm.com/support.

  25. #25 by Techman on September 29, 2012 - 2:52 am

    Thanks for sharing.

    I have tried to install WAS 7.0 plugin into my eclipse Indigo. Then it auto select the feature and continue the installation.

    But in progress, it usually prompt up repository not find and terminate my installation. ( I do not have any proxy setting and I am sure my eclipse can install any other plugin into it).

    Would you please help? Many thanks.

  26. #26 by Stuart Smith on October 2, 2012 - 1:44 am

    The directions in this blog post might be a little out of date with WAS 7.0 and the version of Eclipse you are trying to use. Probably the best thing to do is to use the official WASDev download page for the official download/install instructions:

    You can also use the forum for the WAS Eclipse tools as that will have responses that might have more experience with the versions you are using. My original blog post was mainly to make people aware of this capability and perhaps when we use an updated version I will post an updated post with the setup again.

  27. #27 by Marco Lee on November 22, 2012 - 1:15 am

    Draged webSphere application server v7 and Installed WebSphere Application Server Developer Tools in eclipse Juno of 32bit running on windows Enterprise 7(PC), the WAS 7 is 64bit ruuning on windows server 2008 in remote server(Server).

    when to creat was 7 server in eclipse via WDT, can’t creat profiles error prompted, i check the error log, missing so many jars in error log file. who can give me some advices for it? Thanks a lot.
    btw, when copy from laptop to pc, some error occured as file name is too long and exced 256 charaters.

  28. #28 by Stuart Smith on November 22, 2012 - 11:04 pm

    If I understand correctly you are trying to define a link to a remote WebSphere server. I’m assuming this means that you don’t have WebSphere installed locally.

    A key part of the setup of the WebSphere Developer Tools for Eclipse is that Eclipse needs to be started with the IBM JDK. This is done in the blog post by installing a local WebSphere test server first and then pointing Eclipse to it.

    Without being started by an IBM JDK, the WebSphere Eclipse tools won’t let you define a server in the ‘Servers’ view.

  29. #29 by Paco on December 19, 2012 - 7:02 pm

    How do I configure an Oracle database in Eclipse using WAS

  30. #30 by Stuart Smith on December 19, 2012 - 7:19 pm

    There are a few different things you could do depending on what you mean by “in Eclipse using WAS”. I can’t detail them here but perhaps I can get you pointed in the right direction.

    Eclipse has a few different “Data” perspectives where you could configure a connection to an Oracle database from Eclipse. This doesn’t involve WAS at all. You configure the JDBC driver for Oracle in Eclipse and then setup a connection to the database. You could do things like run SQL commands against a database and sample the schema structure and data contents. If this is what you mean look for info on the database “perspectives” in Eclipse.

    If you mean setting up a database connection in WAS to Oracle, that doesn’t really involve Eclipse at all. All you need to do is open the WAS Admin Console (usually http://localhost:9060/ibm/console) and go to the ‘Resources -> JDBC’ section. Setup a “JDBC Provider” and Data Source with details about the Oracle JDBC drivers and database. Look in the WAS InfoCenter for more info on how to do this. The WAS plug-ins for Eclipse may also add a shortcut way to get to the Admin Console if you right click the server and select ‘Administration -> Run Admin Console’ (or something similar). This is not required to be used though.

  31. #31 by jackson on May 1, 2013 - 3:30 pm

    Thanks for this blog. Do you have another blog for “the best development environment to use for Spring development for WebSphere.” or do you know where I can find an article talks about his topic?

  32. #32 by Stuart Smith on May 2, 2013 - 2:52 am

    As it turns out I have been wanting to blog about my experimentation with Spring, WebSphere and Eclipse for some time!

    Your comment convinced me to write about it here:
    http://blog.webagesolutions.com/archives/866

  33. #33 by jackson on May 13, 2013 - 11:35 am

    Stuart Smith :
    As it turns out I have been wanting to blog about my experimentation with Spring, WebSphere and Eclipse for some time!
    Your comment convinced me to write about it here:
    http://blog.webagesolutions.com/archives/866

    Thank you so much!

  34. #34 by Shrinivas on October 9, 2013 - 3:28 am

    Hi, I have configured Eclipse and websphere server. I need to do some redevelopment on an existing application but the application is already installed on the IBM AppServer. How can I import this installed application on my IDE to start the redevelopment ?

  35. #35 by Shrinivas on October 16, 2013 - 9:27 am

    Hello i figured out the import part.
    I am facing another problem though. I am getting the following error :
    Authentication failed when using LTPA. The exception is CWWIM4512E The password match failed.
    How do i set username and password for the server ?

  36. #36 by Stuart Smith on October 21, 2013 - 10:57 am

    You can’t import directly from the server but you can import a ‘.ear’ (enterprise archive) file that was installed onto the server. The ‘.ear’ file must include source code though for you to be able to modify the code in Eclipse.

  37. #37 by Stuart Smith on October 21, 2013 - 11:04 am

    I’m assuming here that you have a standalone server for development because it is a little different when using a “Network Deployment cell” with Deployment Manager, Node Agent(s), etc. There are also a few different ways to interpret the problem you are describing so I’ll try to explain both.

    1. If you are asking about how to set the username and password for the server as part of the server configuration, that is usually done initially when you first create the profile, assuming you enable administrative security during the profile creation. Profile creation is only done once though so to change the user/password after the server profile exists you must be able to login to the administrative console or authenticate using WebSphere scripting.

    2. If you are asking how does Eclipse know what the username/password for the server is, this is part of the server information in Eclipse that you can edit by double-clicking the server definition in the ‘Servers’ Eclipse view. There is a ‘Security’ section of this configuration and this does not change the actual username/password on the server but instead sets how Eclipse connects to a secured WAS server to do things like deployments.

  38. #38 by Shrinivas on October 22, 2013 - 2:41 am

    Thanks a lot Stuart. Your solution helped me configure the WAS server in my IDE. Have you ever worked on LoginFilter class ?
    I am following the below tutorial by IBM to customize my login page.

    http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftsec_pofolo.html

    I made changes in the web.xml file and created a new LoginFilter.java class as mentioned in the document since i need to do some pre-authentication processing. But for some reason the filter class isn’t getting called. Can it be because I have copied only these two files in the already deployed project ? Do i need to copy any other file as well ? I even restarted the application deployed on the WAS server after I copied the files.

  39. #39 by Stuart Smith on October 24, 2013 - 5:56 pm

    I’ve not used a filter to do anything prior to the form-based authentication as described in the InfoCenter link you gave. If the few suggestions I have don’t work I would try the general WebSphere Application Server forum on IBM developerworks or something like StackOverflow.

    The first thing I think you should do is make sure if you are publishing the changes you have made to the server correctly. The phrase “I have copied only these two files” indicates to me that you might not be doing the deployment correctly from the code in Eclipse.

    When using Eclipse to develop code for a server defined in the ‘Servers’ view, the correct way to update the server is to right click the server and select ‘Publish’ (with the server running). This does a number of things:

    1. Compile Java code into .class files
    2. Package a version of the application for deployment (most often .ear file)
    3. Deploy the updated version of the application, replacing the previous version

    If you try to copy things manually into the files of the application used on the server you may not be copying or replacing the correct files. So I would try to make sure you have done the ‘Publish’ from the ‘Servers’ view of Eclipse first to make sure you are updating the application properly.

    It is also possible to have Eclipse export your project as an .ear file and deploy/update through the WebSphere administration console. But since in an earlier question you were asking about how to let Eclipse know the proper way to authenticate to WebSphere administration and that seems to be fixed now, the ‘Publish’ option is MUCH easier and does basically the same thing as manually going into the WAS admin console.

    If you know it is using an updated version of the application and you are publishing updates correctly (if the filter still doesn’t work perhaps there’s something else you could change to prove this) then the next option is that the filter configuration is not correct to properly configure the filter.

    Looking back at your question I realized that you never mentioned any of the changes that would be needed to enable form-based authentication in the first place. These are in the InfoCenter at that same link you provided and the topic is titled ‘customizing web application login’. This topic mentions files like login.html and error.jsp which you didn’t mention. If you don’t have form login authentication enabled nothing you do for a filter will matter. It is important to realize that this is for enabling and customizing form login on your own applications and not the WAS Admin Console.

    One thing I noticed is that there is a flat out error in the web.xml sample code given in the InfoCenter. It has:

    <filter id="Filter_1">
    .....
    </filter-id>

    This is incorrect for the closing tag and it should be:

    <filter id="Filter_1">
    .....
    </filter>

    I also didn’t like that the example had the filter class in the “default” package (no package statement at the start of the class) instead of being in some package. This makes the <filter-class> look to be just a simple value of the class name when it should be the fully qualified class name including the package. So if you have your filter class in a Java package (which ideally it should be but not required) the example in the InfoCenter would not be correct to configure it. I’m not sure if you would get an error if it knew to look for a filter but couldn’t find it or if it would ignore it.

    You should also check that the <filter-name> values match in both parts of the filter configuration and that the <url-pattern> is correct as these are other ways that your configuration could be not getting picked up properly.

  40. #40 by A B on November 26, 2013 - 12:38 pm

    Are all the options from WAS BASE not availabel with Developers version. e,g, Server Configuration Backup/Restore from GUI or Enable Universal Test Environment etc.?

  41. #41 by Stuart Smith on November 26, 2013 - 1:17 pm

    I’m assuming you are talking about what you can do from the ‘Servers’ view.

    The options available in the ‘Servers’ view are driven more by the Eclipse plug-ins and not what edition of WAS you are linked to as a server. Having said that, the specific items you mention may be in the RAD tools but perhaps not in the free Eclipse tools although the other major tools (run on server, open admin console, etc) are there.

    So if you are going from a RAD/WAS Base setup to an Eclipse/WAS Developers setup, the difference will be more from the switch from RAD to Eclipse than the WebSphere edition.

    Unfortunately I don’t have a setup of the most recent WebSphere plug-ins for Eclipse so I can’t double check if the tools you mention are there or not.

(will not be published)
*