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
It is ironic, but perhaps not unexpected, that many organizations who want the benefits of using an Agile approach to deliver software use a waterfall approach to adopting Agile practices: they form plans, they set milestones, and they measure progress by how many teams they have engaged. Old habits die hard, but like most waterfall software projects, most waterfall-style Agile adoption efforts fail to produce the results desired. The problem is that to get the results they want, they have to ch...
Cloud Expo, Inc. has announced today that Andi Mann and Aruna Ravichandran have been named Co-Chairs of @DevOpsSummit at Cloud Expo Silicon Valley which will take place Oct. 31-Nov. 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. "DevOps is at the intersection of technology and business-optimizing tools, organizations and processes to bring measurable improvements in productivity and profitability," said Aruna Ravichandran, vice president, DevOps product and solutions marketing...
We build IoT infrastructure products - when you have to integrate different devices, different systems and cloud you have to build an application to do that but we eliminate the need to build an application. Our products can integrate any device, any system, any cloud regardless of protocol," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA
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.
The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), provided an overview of various initiatives to certify the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldwide re...
Wooed by the promise of faster innovation, lower TCO, and greater agility, businesses of every shape and size have embraced the cloud at every layer of the IT stack – from apps to file sharing to infrastructure. The typical organization currently uses more than a dozen sanctioned cloud apps and will shift more than half of all workloads to the cloud by 2018. Such cloud investments have delivered measurable benefits. But they’ve also resulted in some unintended side-effects: complexity and risk. ...
"Loom is applying artificial intelligence and machine learning into the entire log analysis process, from start to finish and at the end you will get a human touch,” explained Sabo Taylor Diab, Vice President, Marketing at Loom Systems, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"We are a monitoring company. We work with Salesforce, BBC, and quite a few other big logos. We basically provide monitoring for them, structure for their cloud services and we fit into the DevOps world" explained David Gildeh, Co-founder and CEO of Outlyer, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
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.
21st International Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Me...
SYS-CON Events announced today that Enzu will exhibit at SYS-CON's 21st Int\ernational Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to focus on the core of their ...
In 2014, Amazon announced a new form of compute called Lambda. We didn't know it at the time, but this represented a fundamental shift in what we expect from cloud computing. Now, all of the major cloud computing vendors want to take part in this disruptive technology. In his session at 20th Cloud Expo, Doug Vanderweide, an instructor at Linux Academy, discussed why major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform are all trying to sidestep VMs and containers wit...
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...
Internet of @ThingsExpo, 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 Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...