Welcome!

Blog Feed Post

Is Eclipse Faster than Netbeans for Arquillian Testing on a Remote GlassFish Server?

The following is a description of what I needed to do and how I felt about it to determine if Eclipse is any faster than NetBeans. I am a long time user of both IDEs and I admit to favouring NetBeans. Last year I used Eclipse at Dawson College to teach web development with JSF and JPA using Arquillian on TomEE. This year I am using NetBeans and GlassFish. This blog can also be subtitled:

How to Get a NetBeans Maven Project Running on Eclipse

I am working on a problem concerning the time it takes to test a web application on a remote Glassfish server using Arquillian and NetBeans. In doing my due diligence by searching on Google I occasionally come across the unhelpful answer that suggests I should use Eclipse. I have used Eclipse for years but I prefer NetBeans in the classroom. Nevertheless I decided to run my test with Eclipse.

The first step was to download the latest version, Luna 4.4.2. As has always been the case, Subversion is not supported without a plug-in. In the past I used Subclipse from Tigris. The Google search showed me that Subversive is now the ‘official’ plugin for Subversion. It even had a drag and drop icon for installation. I dragged and dropped and this happened:

Image01

WTF? As I have no idea if this is significant or not I answered Yes. Something installed.

Using File->Import I did have a Subversion choice but when I selected it I had to choose which connector to use. I picked the most recent for Windows 64bit. When I tried to access the repository it failed. Being a long time Eclipse user I knew what to do. I closed Eclipse and started it up again. Now I could connect to the repository and I selected the project.

Eclipse does not know what to do with a Maven project. I thought the answer was obvious, open it as a project. Instead I am confronted with four choices, the last of which is to open it as a project. With this done the project downloaded from the repository and an invalid project appeared in the workspace. This I expected. I right clicked on the project and selected Maven->Convert to Maven Project. The next step is to right mouse click again and select Maven->Update Project.

When it finished the update it declared that my pom.xml had two invalid sections. These were generated by NetBeans so I just commented them out. It also did not like my beans.xml file so I just deleted everything in it and saved it as an empty file because it only needed to be there to turn on CDI. My first attempt at compiling failed because Eclipse defaulted to the JRE folder but that was an easy fix. Then success, I had a war.

The next problem is that Eclipse does not know GlassFish. It does allow you to select an alternate server for which the plugin will be installed but GlassFish is not on the list. So back to Google and I found GlassFish Tools for Luna. It showed support for 4.0 and 3.1 but I suspected 4.1 will be fine. It also had an install icon and so I dragged it over and installed it.

Ok, let’s go! I go to the Servers tab just below the edit window and I can now add GlassFish. I fill everything else in and then when it comes time to add the project to the server I get the ‘cannot bridge runtimes’.

A stack overflow site suggested a solution, http://bit.ly/1aLA30Q. I did as instructed and added a line to the asenv.bat file but no change. I then took a different tack and went to the workspace properties and selected the server there. I could do this without any problems. My first attempt at running my code failed because it could not find the domain. Back into the Server properties and I pointed GlassFish to the same domain (domainA rather than domain1) that I used in NetBeans. In the Server tab below the editing window I added GlassFish and started it successfully. Hooray!

Spoke too soon. While I was about to Run on Server, a dialog box popped up informing me that GlassFish took too long to start and therefore did not start. Despite this I still went ahead and did a Run on Server. The result was that it started GlassFish again but hung for a few minutes before it displayed the following dialog.

Image02

Next I pointed GlassFish to its original domain1. I received all new errors and they referred to domainA. So it’s back to close Eclipse and restart Eclipse. It started up with an error about deploying the project. I deleted the server and put it back. This was probably all I needed to do rather than restart Eclipse because the new server I put back had the correct domain.

I looked at my display and I got excited. It showed that GlassFish had started! Now for a Run on Server. This appeared.

Image03

I figured this one out quickly. NetBeans deploys the MySQL driver to the server but Eclipse does not. So I copied mysql-connector-java-5.1.23-bin.jar into the domain’s lib folder. I restarted GlassFish and tried again. This is what I got.

Image04

Close Eclipse and start Eclipse. No Change.

I decided that I needed to know if the problem was the war file. Within Eclipse I opened the GlassFish admin application and manually deployed the application that was in the target folder of the project. GlassFish allowed me to point the server at the folder in project’s target folder that contained the compiled code. I could also point at the war file. What I noticed in both cases was that the name of the application did not match the project name.

  • Project was called JPAGlassFish03.
  • When pointing to the folder it became JPAGlassFish03-0.0.
  • When pointing to the war it, called JPAGlassFish03-0.0.1-SNAPSHOT

The good news was that once deployed though the domain console I could access the application through the browser using the deployed name. The admin console also allowed me to change the name of the application to whatever I wanted.

Oh, wait a minute. By renaming the context and application it no longer shows up in the list of applications in the admin display. It appears in a branch below Applications but by not being on the Applications screen there is no way to get rid of it. False alarm, I just needed to click on the Deploy button and the application appeared in the list and so I undeployed it.

Back at Eclipse it continued to fail with “the deploy is failing” error. I noticed that the project was showing as deployed. So I removed it by right clicking on it and did one more Run on Server. It finally worked. Conclusion, after adding the missing mysql jar I needed to remove the project from the server. Finally I can try Arquillian.

Conclusion

The Arquillian tests ran without any issues. The first run took 54 seconds and the second run took 1 min and 28 seconds doing the same test. This is almost exactly the same performance as on NetBeans. Therefore Eclipse does NOT run Arquillian tests on a remote server any faster or slower than NetBeans.

It only took two and a half hours to come to this conclusion. Part of this time was spent writing this blog.

The solution to the time problem? Ignore the best practice of always testing on a remote server in a classroom situation and test with the embedded Glassfish server. Tests take less than 20 seconds.

Remote Server:

Running com.kenfogel.test.FishActionBeanTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, 
Time elapsed: 84.87 sec - in com.kenfogel.test.FishActionBeanTest

Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

[INFO] -----------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------------------
[INFO] Total time: 01:28 min
[INFO] Finished at: 2015-03-04T12:52:23-05:00
[INFO] Final Memory: 10M/245M
[INFO] -----------------------------------------------------------

Embedded Server

Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

[INFO] -----------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------------------
[INFO] Total time: 15.230 s
[INFO] Finished at: 2015-03-04T12:53:56-05:00
[INFO] Final Memory: 10M/245M
[INFO] -----------------------------------------------------------

Read the original blog entry...

More Stories By Ken Fogel

In 1980 I bought for myself the most wonderful toy of the day, the Apple ][+. Obsession followed quickly and by 1983 I was writing software for small and medium sized businesses in Montreal for both the Apple and the IBM PC under the company name Omnibus Systems. In the evenings I taught continuing education courses that demystified the computer to the first generation of workers who found themselves with their typewriter on the scrap heap and a PC with WordStar taking its place.

In 1990 I was invited to join the faculty at Dawson College in the Computer Science Technology program. When I joined the program the primary language was COBOL and my responsibility was to teach small systems languages such as BASIC and C/C++.

Today I am now the chairperson and program coordinator of the Computer Science Technology program at Dawson. The program's primary language is Java and the focus is on enterprise programming.

I like to write about the every day problems my students and I face in using various languages and platforms to get the job done. And from time to time I stray from the path and write about what I plan to do, what I actually get around to doing, and what I imagine I am doing.

@omniprof

Latest Stories
Microsoft Azure Container Services can be used for container deployment in a variety of ways including support for Orchestrators like Kubernetes, Docker Swarm and Mesos. However, the abstraction for app development that support application self-healing, scaling and so on may not be at the right level. Helm and Draft makes this a lot easier. In this primarily demo-driven session at @DevOpsSummit at 21st Cloud Expo, Raghavan "Rags" Srinivas, a Cloud Solutions Architect/Evangelist at Microsoft, wi...
Containers are rapidly finding their way into enterprise data centers, but change is difficult. How do enterprises transform their architecture with technologies like containers without losing the reliable components of their current solutions? In his session at @DevOpsSummit at 21st Cloud Expo, Tony Campbell, Director, Educational Services at CoreOS, will explore the challenges organizations are facing today as they move to containers and go over how Kubernetes applications can deploy with lega...
SYS-CON Events announced today that Avere Systems, a leading provider of hybrid cloud enablement solutions, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere Systems was created by file systems experts determined to reinvent storage by changing the way enterprises thought about and bought storage resources. With decades of experience behind the company’s founders, Avere got its ...
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. ANSeeN are the measurement electronics maker for X-ray and Gamma-ray and Neutron measurement equipment such as spectrometers, pulse shape analyzer, and CdTe-FPD. For more information, visit http://anseen.com/.
Today most companies are adopting or evaluating container technology - Docker in particular - to speed up application deployment, drive down cost, ease management and make application delivery more flexible overall. As with most new architectures, this dream takes significant work to become a reality. Even when you do get your application componentized enough and packaged properly, there are still challenges for DevOps teams to making the shift to continuous delivery and achieving that reducti...
As you move to the cloud, your network should be efficient, secure, and easy to manage. An enterprise adopting a hybrid or public cloud needs systems and tools that provide: Agility: ability to deliver applications and services faster, even in complex hybrid environments Easier manageability: enable reliable connectivity with complete oversight as the data center network evolves Greater efficiency: eliminate wasted effort while reducing errors and optimize asset utilization Security: imple...
High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
SYS-CON Events announced today that CAST Software will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CAST was founded more than 25 years ago to make the invisible visible. Built around the idea that even the best analytics on the market still leave blind spots for technical teams looking to deliver better software and prevent outages, CAST provides the software intelligence that matter ...
SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
DevOps at Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to w...
When it comes to cloud computing, the ability to turn massive amounts of compute cores on and off on demand sounds attractive to IT staff, who need to manage peaks and valleys in user activity. With cloud bursting, the majority of the data can stay on premises while tapping into compute from public cloud providers, reducing risk and minimizing need to move large files. In his session at 18th Cloud Expo, Scott Jeschonek, Director of Product Management at Avere Systems, discussed the IT and busine...
As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...