午後イチはきしださんのセッションへ。前半はJavaエンジニア養成読本Image may be NSFW. Clik here to view.で書かれていた話+αという感じで、丸レクとか知らなかったお話も聞けました(^^)後半はフリーランスから会社員になられた背景や経緯をお話されていて、なるほど…と非常に興味深かったです。
GW中、久しぶりにCore JavaServer FacesImage may be NSFW. Clik here to view.の本を改めて読み返していたのですが、RESTful Navigation and Bookmarkable URLsの章で「pretty URLs」という表現があることに気づきました。
PrettyFaces is an OpenSource URL-rewriting library with enhanced support for JavaServer Faces – JSF 1.1, 1.2 and 2.0 – enabling creation of bookmark-able, pretty URLs. PrettyFaces solves the “RESTful URL” problem elegantly, including features such as: page-load actions, seamless integration with faces navigation, dynamic view-id assignment, managed parameter parsing, and configuration-free compatibility with other web frameworks.
EJB(Stateless以外にEJBTimerなんかも使ってるようです)やJPA,JAX-RSも使って、ガチなJava EE構成っぽいです。セキュリティはJASPIC(Java Authentication Service Provider Interface for Containers)、ただしJASPIC自身はlow-levelなので、higher levelなのは作る手間もあったようで、それがモチベーションとなってJava EE 8 securityのExpert Groupに参加されてるそうです。って、書くとさらっとしてるけど、すごいなぁ(^^;;
Java EE is incredible fast. The website itself is now doing over 120k views a month and as mentioned above is running on a single server basically, which is not even that powerful.
とのことで
@kikutaro_ちょうどそのパフォーマンスのところに 120k views a month とありますね。1 日平均 4 k PV ? ですかね。サーバ 1 台でさばいてるみたいですね
You occasionally hear that JSF is supposedly not suited for public web sites, since it would be slow and using a lot of memory. We found however that this is absolutely not the case.
About one month ago, I participated Japanese Salesforce event. It was called "Salesforce Summer".eventjp.salesforce.com
At the event, I saw Heroku demonstration. This is the reason why I started to use Heroku.After the event, I checked Heroku site and found good Java tutorial. In the tutorial, the sample Java web application used Spark.
I thought that ... if I use Payara Micro, is it possible to deploy Java EE application to Heroku ?
Finally, it could. Here is procedures.
Getting Started with Java on Heroku
Firstly, I started "Getting Started with Java on Heroku". The tutorial is very polite, so it's easy to do. Image may be NSFW. Clik here to view.
Installing Toolbelt (for Windows on my environment)
heroku login
After that, I cloned "java-getting-started" from github.
I used the same project, it means I used "java-getting-started" project cloned from GitHub.
It's kind of cheat I think. Normally, it had better create as new project.
java -classpath force-wsc-35.2.0-uber.jar com.sforce.ws.tools.wsdlc wsdl.xml sfdc-enterprise-lib.jar
[WSC][wsdlc.main:71]Generating Java files from schema ...
[WSC][wsdlc.main:71]Generated 633 java files.
java.io.FileNotFoundException: C:\Program Files\Java\jre1.8.0_60\lib\tools.jar (
指定されたファイルが見つかりません。)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.sforce.ws.codegen.ToolsJarClassLoader.<init>(ToolsJarClassLoader.
java:52)
at com.sforce.ws.codegen.Compiler.findCompilerInToolsJar(Compiler.java:6
9)
at com.sforce.ws.codegen.Compiler.<init>(Compiler.java:57)
at com.sforce.ws.codegen.Generator.compileTypes(Generator.java:132)
at com.sforce.ws.tools.wsdlc.run(wsdlc.java:117)
at com.sforce.ws.tools.wsdlc.run(wsdlc.java:149)
at com.sforce.ws.tools.wsdlc.main(wsdlc.java:71)
Error: Unable to find compiler. Make sure that tools.jar is in your classpath: j
ava.io.FileNotFoundException: C:\Program Files\Java\jre1.8.0_60\lib\tools.jar (
指定されたファイルが見つかりません。)
ということで、JDK7で実行しました。
java -classpath force-wsc-35.2.0-uber.jar com.sforce.ws.tools.wsdlc wsdl.xml sfdc-enterprise-lib.jar
[WSC][wsdlc.main:71]Generating Java files from schema ...
[WSC][wsdlc.main:71]Generated 633 java files.
[WSC][wsdlc.main:71]Compiling to target 1.6...
警告:[options] ブートストラップ・クラスパスが-source 1.6と一緒に設定されていませ
ん
警告1個
[WSC][wsdlc.main:71]Compiled 636 java files.
[WSC][wsdlc.main:71]Generating jar file ... sfdc-enterprise-lib.jar
[WSC][wsdlc.main:71]Generated jar file sfdc-enterprise-lib.jar
続けて、はすぬまさんのPayara Microの話を聴きに行きました。この時間枠もどのセッションにするか悩みに悩んだのですが(^^;…やっぱりGlassFish・Payaraに関する情報を少しでも得たいなと。そういう意味ではGlassFish User Groupの会長であるはすぬまさんの話を聴くのが一番だなーと(^^)
Exception in thread "main" java.lang.IllegalStateException: No 'webapp' director
y found in the projects resources folder. Please add it to your resources even i
f it will be empty so that the servlet server can bind to it. If you have added
it and still see this error please make sure you have at least one file/class in
your projects as some IDEs don't build the project if its empty
at com.kumuluz.ee.EeApplication.checkRequirements(EeApplication.java:75)
at com.kumuluz.ee.EeApplication.initialize(EeApplication.java:48)
at com.kumuluz.ee.EeApplication.(EeApplication.java:27)
at com.kumuluz.ee.EeApplication.main(EeApplication.java:39)
空のフォルダだけでも、とあるのですが、自分の手元では何かファイルがないとコピーしてくれなかったので、とりあえず適当にhtmlだけ置いてました。 Image may be NSFW. Clik here to view.