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
​Blockchain, also known as Distributed Ledger Technology (DLT), can be used for more than just crypto currencies. This presentation discusses how blockchain and the Internet of Things (IOT) can be used for several supply chain management and logistics use cases. Real world examples that utilize the open source project Hyperledger will be discussed.
This session describes how Professional Services organisations can deliver within Technology-as-a-Service (IaaS) constructs, in private and public enterprise cloud scenarios. See how professional services can be packaged and funded by IaaS cash flows, based upon consumption of technology services. Learn how significant, IT infrastructure transformations can be funded through OPEX spending models with multi-year As-a-Services based contracts. Understand how the automation of repeatable services c...
Gym Solutions is a software as a service (SaaS) solution purpose-built to service the fitness industry, with over 1000 clients servicing over 2 million gym members across 40 countries making Perfect Gym Solutions one of the largest and fastest growing SaaS applications in the fitness industry. Their platform is a comprehensive package of modern modular products for the management of fitness clubs, sports facilities and gyms an end- to end solution, revolutionising the way that gyms are managed. ...
The Blockchain Benchmark asks and answers the questions many people want to know about the state of Blockchain: What are the biggest barriers? What was your motivation to get involved? When will it mainstream? Who are the true influencers? What are its top use cases? Who will win over the next 5 years? How will the future unfold? And 20+ other valuable questions.
There's no doubt that blockchain technology is a powerful tool for the enterprise, but bringing it mainstream has not been without challenges. As VP of Technology at 8base, Andrei is working to make developing a blockchain application accessible to anyone. With better tools, entrepreneurs and developers can work together to quickly and effectively launch applications that integrate smart contracts and blockchain technology. This will ultimately accelerate blockchain adoption on a global scale.
As the fourth industrial revolution continues to march forward, key questions remain related to the protection of software, cloud, AI, and automation intellectual property. Recent developments in Supreme Court and lower court case law will be reviewed to explain the intricacies of what inventions are eligible for patent protection, how copyright law may be used to protect application programming interfaces (APIs), and the extent to which trademark and trade secret law may have expanded relev...
SAP is the world leader in enterprise applications in terms of software and software-related service revenue. Based on market capitalization, we are the world's third largest independent software manufacturer. Harness the power of your data and accelerate trusted outcome-driven innovation by developing intelligent and live solutions for real-time decisions and actions on a single data copy. Support next-generation transactional and analytical processing with a broad set of advanced analytics - r...
In addition to 22 Keynotes and General Sessions, attend all FinTechEXPO Blockchain "education sessions" plus 40 in two tracks: (1) Enterprise Cloud (2) Digital Transformation. PRICE EXPIRES AUGUST 31, 2018. Ticket prices: ($295-Aug 31) ($395-Oct 31) ($495-Nov 12) ($995-Walk-in) Does NOT include lunch.
Provide an overview of the capabilities of Azure Stack allowing you or your customers to adopt truly consistent Hybrid Cloud capabilities to deliver greater productivity in your cloud world. Ultan Kinahan is on a member of the Global Black Belt team at Microsoft with a focus on Azure Stack Hybrid Cloud. Ultan has been in the Azure team since the beginning, Has held roles in Engineering, Sales and now consults with both small to medium size business and the worlds largest organizations on how to ...
Blockchain is a new buzzword that promises to revolutionize the way we manage data. If the data is stored in a blockchain there is no need for a middleman - the distributed database is stored on multiple and there is no need to have a centralized server that will ensure that the transactions can be trusted. The best way to understand how a blockchain works is to build one. During this presentation, we'll start with covering the basics (hash, nounce, block, smart contracts) and then we'll create ...
Early Bird Registration Discount Expires on August 31, 2018 Conference Registration Link ▸ HERE. Pick from all 200 sessions in all 10 tracks, plus 22 Keynotes & General Sessions! Lunch is served two days. EXPIRES AUGUST 31, 2018. Ticket prices: ($1,295-Aug 31) ($1,495-Oct 31) ($1,995-Nov 12) ($2,500-Walk-in)
Big Data Federation, Inc. develops and applies artificial intelligence to predict financial and economic events that matter. The company uncovers patterns and precise drivers of performance and outcomes with the aid of machine-learning algorithms, big data, and fundamental analysis. Their products are deployed by some of the world's largest financial institutions.
DevOpsSUMMIT at CloudEXPO will expand the DevOps community, enable a wide sharing of knowledge, and educate delegates and technology providers alike. Recent research has shown that DevOps dramatically reduces development time, the amount of enterprise IT professionals put out fires, and support time generally. Time spent on infrastructure development is significantly increased, and DevOps practitioners report more software releases and higher quality. Sponsors of DevOpsSUMMIT at CloudEXPO will b...
Today we introduced our New York & Silicon Valley combo sponsorship and exhibit opportunities with unmatched pre and post-show promotion. At CloudEXPO | DevOpsSUMMIT | DXWorldEXPO NY & CA, Digital Transformation (DX) is a major focus with the introduction of DXWorldEXPO within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...