FAQ

ActFramework 的性能如何

TechEmpower Benchmark 是公认的 Web 技术栈性能测试项目. 点击 此处 查看 ActFramework 和其他 JVM 全栈框架在 TechEmpower Benchmark 测试中的比较

我启动示例应用看到”App not found”报错是怎么回事

我使用Intellij IDEA加载了示例项目然后我运行”HelloWorld”程序的时候得到下面的错误堆栈:

  1. Exception in thread "main" org.osgl.exception.UnexpectedException: App not found. Please make sure your app start directory is correct
  2. at act.Act.start(Act.java:307)
  3. at act.Act.startApp(Act.java:269)
  4. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  5. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  6. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  7. at java.lang.reflect.Method.invoke(Method.java:498)
  8. at act.boot.app.RunApp.start(RunApp.java:64)
  9. at act.Act.start(Act.java:610)
  10. at demo.helloworld.HelloWorldApp.main(HelloWorldApp.java:24)
  11. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  12. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  13. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  14. at java.lang.reflect.Method.invoke(Method.java:498)
  15. at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
解决办法

你需要在IDEA的Run配置里面正确地设置”工作目录(working directory)”:
image

我不能构建示例程序, 下载依赖的时候提示出错

我在控制台上发现类似下面的警告信息

  1. [WARN] The POM for io.undertow:undertow-core:jar:1.4.11.Final is invalid, transitive dependencies (if any) will not be available
解决办法

可能是你的网络的问题. 也许切换到阿里云的maven服务器可以解决这个问题. 另外你可能需要删除本地maven repository缓存的相关的库,再重新运行mvn clean compile一次, 就上面的错误警告来讲,你需要删除和undertow还有jboss xnio相关的本地缓存:

  1. rm -rf ~/.m2/repository/io/undertow/ && rm -rf ~/.m2/repository/org/jboss/xnio

我在控制台上看到这种出错信息java.security.InvalidKeyException: Illegal key size, 是怎么回事?

  1. 13:01:06.851 [XNIO-1 task-17] ERROR a.a.u.AppCrypto - Cannot encrypt/decrypt! Please download Java Crypto Extension pack from Oracle: http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html
  2. 13:01:06.851 [XNIO-1 task-17] ERROR a.h.b.c.RequestHandlerProxy - Error handling request
  3. org.osgl.exception.UnexpectedException: java.security.InvalidKeyException: Illegal key size
  4. at org.osgl.util.E.unexpected(E.java:100)
  5. at org.osgl.util.Crypto.encryptAES(Crypto.java:183)
  6. at act.app.util.AppCrypto.encrypt(AppCrypto.java:71)
  7. at act.app.App.encrypt(App.java:659)
  8. at act.util.SessionManager$CookieResolver.dissolveIntoCookieContent(SessionManager.java:321)
  9. at act.util.SessionManager$CookieResolver.dissolveSession(SessionManager.java:217)
  10. at act.util.SessionManager.dissolveSession(SessionManager.java:78)
  11. at act.app.ActionContext.dissolveSession(ActionContext.java:849)
  12. at act.app.ActionContext.dissolve(ActionContext.java:697)
  13. at act.handler.builtin.controller.RequestHandlerProxy.onResult(RequestHandlerProxy.java:241)
  14. at act.handler.builtin.controller.RequestHandlerProxy.handle(RequestHandlerProxy.java:177)
  15. at act.handler.DelegateRequestHandler.handle(DelegateRequestHandler.java:27)
  16. at act.route.Router$ContextualHandler.handle(Router.java:935)
  17. at act.xio.NetworkHandler$1.run(NetworkHandler.java:78)
  18. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  19. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  20. at java.lang.Thread.run(Thread.java:745)
  21. Caused by: java.security.InvalidKeyException: Illegal key size
  22. at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1034)
  23. at javax.crypto.Cipher.implInit(Cipher.java:800)
  24. at javax.crypto.Cipher.chooseProvider(Cipher.java:859)
  25. at javax.crypto.Cipher.init(Cipher.java:1370)
  26. at javax.crypto.Cipher.init(Cipher.java:1301)
  27. at org.osgl.util.Crypto.encryptAES(Crypto.java:174)
  28. ... 15 common frames omitted

解决办法

你需要按照 JCE (Java Cryptography Extension). 搜索 jce java 然后找到并点击前往 oracle 网站的链接. 根据说明下载安装该软件