Adam Bien's Weblog

Enterprise Nashorn--Free Article

The Enterprise Nashorn article presents Nashorn features beyond standard (ECMAScript-262 Edition 5.1) JavaScript capabilities. From embedding in Java code and Bean Validation, to operating system task automation, hot deployment and implementation of Java interfaces with JavaScript.

See also Playing With Nashorn screencast.

Feedback is, as always, highly appreciated.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Summer Workshops: From Java EE 7 Bootstrap and Effective Java EE 7 to Java EE 7 Architectures

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

March's Airhacks Live Event Shifts to Tuesday

Caused by the massive amount of easter eggs, the March Airhacks Live event is going to shift one day from Monday 6 P.M. CET to Tuesday, 7th April 2015, 6 P.M. CET (subscribe).

This time you get one day more to prepare lots of questions.

Also checkout past episodes--lots of questions were already answered.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Summer Workshops: From Java EE 7 Bootstrap and Effective Java EE 7 to Java EE 7 Architectures

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Playing With Nashorn Scripting Features

Nashorn is shipped with Java 8 and can be used as a system scripting language with seamless Java integration.

One of the killer features is the IDE support. In contrary to batch files or shell scripts, Nashorn is JavaScript (ECMA-262, edition 5.1) and is supported in the IDE with syntax highlighting, code-completion and direct integration with Java ecosystem. Even executable native system scripts can be easily debugged:

Static Page Generator (SPG) is another example of executable Nashorn script example.

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

See you at Java EE Workshops at Munich Airport, Terminal 2, particularly at HTML 5 for Java Developers or Virtual Dedicated Workshops / consulting


Summer Workshops: From Java EE 7 Bootstrap and Effective Java EE 7 to Java EE 7 Architectures

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Installing Oracle JDBC-Driver On Wildfly / JBoss

  1. Download the driver: ojdbc[VERSION].jar
  2. Create subfolders [WILDFLY_HOME]/modules/system/layers/base/com/oracle/main/
  3. Copy the downloaded ojdbc[VERSION].jar into the freshly created folder
  4. Create a file module.xml, in the same folder as above, with the contents:
    
    <module xmlns="urn:jboss:module:1.1" name="com.oracle">
      <resources>
        <resource-root path="ojdbc[VERSION].jar"/>
      </resources>
      <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
      </dependencies>
    </module>
    
    
  5. In the configuration file standalone.xml add the entry:
    
    <driver name="oracle" module="com.oracle">
     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    </driver>
    
    
    within the <drivers> tag.
  6. Add a datasource definition within the <datasources> tag (next to ExampleDS):
    
    <datasource jndi-name="java:/[NAME]" pool-name="OracleDS" enabled="true">
     <connection-url>jdbc:oracle:thin:@[HOST_NAME]:1521:[SID]</connection-url>
      <driver>oracle[has to match the driver name]</driver>
      <pool>
       <min-pool-size>1</min-pool-size>
       <max-pool-size>5</max-pool-size>
       <prefill>true</prefill>
      </pool>
      <security>
       <user-name>[USER]</user-name>
       <password>[PWD]</password>
      </security>
    </datasource>
    
    

Now enjoy the simplicity of Java EE :-)

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Summer Workshops: From Java EE 7 Bootstrap and Effective Java EE 7 to Java EE 7 Architectures

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

A Java EE Startup: Fashion with Stylight

Interview with Anselm Bauer, STYLIGHT co-founder, passionate Java EE developer and airhacks.com alumni:

Anselm, please briefly introduce yourself

Hi, I’m Anselm, co-founder of STYLIGHT and computer scientist. I live in the best city in the world, Munich, and I have the chance to work in the best team I imaginable. I am a passionate musician, love sports, and nature.

What is stylight.com and how did it start?

STYLIGHT is the place to discover and shop fashion you love from the best online stores. I founded the company together with three friends in 2008 as students. Currently STYLIGHT employs over 150 people across three offices (Munich, London, and New York).

You’re a co-founder and your development skills are impressive, how important is it for management to technically understand the developers?

The founders of STYLIGHT have backgrounds in economics, electrical engineering, business administration, and computer science. We know that success is only possible when all disciplines work together to reach their goals, that is why appreciation is one of our three core values. We don’t have an engineering department anymore at STYLIGHT, but instead have cross-functional teams, in which engineers work together with marketing, design, sales etc.

How many developers are working on the application?

We have about 30 developers currently working at STYLIGHT. They are distributed over multiple teams along our value chain to create cross-functional teams with the maximum of autonomy and flexibility.

The UI is completely rendered on the server, why?

To guarantee a great experience and performance across all browsers, devices and networks we currently render most of the UI on the server. In addition, most search engines are still not doing a good job at crawling one page applications yet. We like the concept and use it for internal tools, though, together with JS frameworks like Angular.

How many users per day visit the website? What were the peak transactions / second value?

Over six million people visit STYLIGHT every month and find their favourite fashion items. We normally see huge peaks during our TV campaigns.

Which hardware / infrastructure are you using?

Parts of our infrastructure are hosted at a local provider in Munich but the majority of servers are at AWS. We currently migrate all of our infrastructure to AWS to be more flexible and use their great services. We love docker for local development environments as well as for our production deploys.

Is Java EE fast enough for a popular website?

A lot of popular websites use the power of the JVM even if the don’t use Java as a language. We use Java EE features mainly for our business logic where it relieves us from thinking about things like transactions, concurrency etc. Since a lot of our content is a static catalog we can cache a lot of our pages.

Your started straight with the Java EE stack. Was it a good decision?

I think the Java EE stack today is not comparable to the J2EE technologies that were around when we started, and are actually much better than the reputation it has. Back then the amount of boilerplate code was much higher and a script language stack like RoR would have done the trick as well. Today I am glad to use the power of the JVM and the features of Java EE.

Is Java EE productive enough for a startup?

The learning curve is still steeper and we are still fighting against long compile cycles, so for rapid prototyping I may chose something else. In the long run, I think we benefitted from the robustness.

The monitoring capabilities of your system were impressive. What is monitored? Does monitoring pay off?

We monitor servers and applications with several tools and metrics. We use, for example, datadog for general server monitoring, loggly for exceptions, requests, load times etc, and new relic for everything else. Monitoring definitely pays off in finding errors and bottlenecks but also opportunities for refactoring.

We met for the first time at airhacks.com. Have you got any ideas for simplification during the workshops?

Definitely. I got a lot of food for thought, especially regarding the testing of Java EE applications and simple patterns like the Entity Control Boundary Pattern.

You recently migrated to Java 8, Java EE 7. How hard was the migration?

We migrated to Java 8, Java EE 7 and are running on the new Wildfly application server. The migration was fairly easy, we did not have to change more than a hundred lines of code.

How much code could you delete during the migration?

We are deleting code iteratively, to avoid a big bang release. But especially for features like asynchronous behaviour we were able to delete a lot of code.

Did you had the chance to chat with other airhacks attendees? If yes, what was the most interesting project / application / problem?

It’s always interesting to see companies from totally different industries like stock exchange and logistics and how they deal with their problems.

If you could start over, would you choose Java EE again?

That is a very difficult question, since it depends very much on the domain I would start something. Although I like working with Java EE, I’m still a computer scientist and I would maybe choose something else, only out of curiosity.

I'm constantly asked by my clients, whether I know any Java EE developers. Are you also looking for passionate Java EE hackers?

Definitely, we currently have open positions for Java EE developers, specialists for RESTful APIs and search technologies on our jobs page http://www.stylight.com/Jobs/.

Anselm, thank you for the interview!


Summer Workshops: From Java EE 7 Bootstrap and Effective Java EE 7 to Java EE 7 Architectures

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

The Porcupine Spy v0.0.4 and Porcupine v0.0.4 Released

Version 0.0.4 of porcupine is available:


<dependency>
	<groupId>com.airhacks</groupId>
	<artifactId>porcupine</artifactId>
	<version>0.0.4</version>
	<scope>compile</scope>
</dependency>

This version comes with minor bug fixes and improvements and a single major feature: the minQueueCapacity statistic. It is the "lowest watermark" of the queue capacity and an early indicator of thread pool overloading / upcoming rejections.

The new attribute is available from method Statistics#getMinQueueCapacity()

porcupine-spy was also released with the same version:


<dependency>
	<groupId>com.airhacks</groupId>
	<artifactId>porcupine-spy</artifactId>
	<version>0.0.4</version>
	<scope>compile</scope>
</dependency>

You can use the above dependency instead of the regular porcupine. The porcupine-spy extension injects automatically the statistics to the HTTP headers of all JAX-RS resources.

All requests are going to be extended with the x-porcupine-statistics-[THREADPOOL_NAME] HTTP header:


x-porcupine-statistics-light: {"pipelineName":"light","activeThreadCount":1,
"completedTaskCount":1,"corePoolSize":8,"currentThreadPoolSize":2,"largestThreadPoolSize":2,"maximumPoolSize":16,
"rejectedTasks":0,"remainingQueueCapacity":100,"minQueueCapacity":100,"totalNumberOfTasks":2}
Content-Type: text/plain
Date: Wed, 18 Mar 2015 07:50:20 GMT

Porcupine comes without any additional external dependencies and fully relies on Java EE 7 / Java 8 what makes it lean. Both JARs together are only 20kB.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting


Summer Workshops: From Java EE 7 Bootstrap and Effective Java EE 7 to Java EE 7 Architectures

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

A Java EE Startup: 200 Schools on safsms.com

An interview with Faiz Bashir (@faizbash), Java EE entrepreneur and almost an airhacker.

Faiz, could you please introduce yourself? How did you started with Java / Java EE?

As FlexiSAF’s CEO, I am responsible for FlexiSAF’s day-to-day-operations, as well as leading the company’s product development and technology strategy. I co-founded FlexiSAF and has been the CEO since 2009 when the company began its full operations. I am ambitious and enthusiastic in improving the quality of education using technology.

I started learning Java in 2000 using Java How to Program by Deitel & Deitel which was given to me by my Uncle, Eng. Aziz. Since then I never looked back again. It was in 2008 that I started paying attention to Java EE. All my projects are now Java based. I am Sun Certified Professional with the following certifications: Sun Certified Business Component Developer, Sun Certified Developer for Java Web services, Sun Certified Web Component Developer and Sun Certified Java Programmer.

How Java is doing in Nigeria? Are there any meetups, JUGs etc.?

Based on my interaction with developers in Nigeria, I think people shy away from Java. They feel the learning curve is very steep. However, I think big enterprises use Java EE but I am not sure of the market share between Java EE and .Net. With technologies like Android however, Java is gaining more popularity. There is JUG in Abuja since 2011 which is being headed by my Friend Bulama Yusuf. However there hasn't been a meetup for sometime now. There are JUGs in 2 other cities in Nigeria (Lagos and Port Harcourt). Bulama informed me that they have been communicating with Oracle Nigeria to organise a nationwide conference but that has been slow.

Could you please briefly introduce your application?

We have a number of applications for schools, but the most popular one is SAF School Management Software (SAFSMS). It is a web-based application for managing school's processes and students' records. Currently over 200 schools are using SAFSMS. It is completely based on Java EE on the server side and Google Web Toolkit on the client side. We are now working on a cloud version for SAFSMS which is going to be Software as a Service (Saas)

Many are thinking, Java EE is not appropriate for startups. What is your opinion about that?

I think it is a very wrong opinion because I have seen startups that use other technologies and eventually find it difficult to scale and have to migrate to Java EE. Java EE is really straight forward and takes care of the so many complexities ordinarily you have to worry about.

Which Java EE / SE versions are you currently using?

We use Java EE 7 for our current projects. We still use Java SE 7 but will soon migrate to 8.

Is there anything to simplify in you code base (legacy interfaces, superfluous patterns etc.)?

I think there's nothing really to simplify because all our code base is post J2EE1.4. We keep everything simple.

What tools, servers, IDEs, operating systems are you using?

Most of us are Linux guys, we use Ubuntu. But a few of our designers use Windows. We were using Mercurial for SCM but recently migrated to GIT. I think I prefer GIT's branching model to Mercurial's. We now use Gradle for our build tool. Netbeans is our preferred IDE. GWT is our preferred UI tool and we also recently adopted GWTP as the framework for our GWT. We have also adopted Arquillian for our unit tests and use Arquillian Drone for integration tests. We use Docker to encapsulate the full stack that our applications need to make them portable. We haven't really done full CI but are considering Jenkins for that now. Amazon EC2 is our preferred cloud computing platform.All our applications are deployed on Glassfish, however we are thinking of following Arun Gupta (to Wildfly).

Any lessons learned?

I think the most important lesson I learned is to always use tools and automate whatever needs to be automated. It will greatly cut down the cost of running your business and obviously increase revenue.

If you had the chance to start-over. Would you choose Java EE again?

I will choose Java EE always without any hesitation

Where can readers find more about your system. Do you have any links, resources to share?

www.safsms.com

Faiz, thank you for the interview!


Summer Workshops: From Java EE 7 Bootstrap and Effective Java EE 7 to Java EE 7 Architectures

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

realworldpatterns.com
...the last 150 posts
...the last 10 comments
License