Running akka with runnable jar

前端 未结 1 1538
-上瘾入骨i
-上瘾入骨i 2020-12-20 23:47

I\'m trying to implement akka in java maven project with NetBeans. It runs fine when i run it from NetBeans but when I run the runnable jar from NetBeans, it generate error.

1条回答
  •  悲&欢浪女
    2020-12-21 00:36

    There is a warning about running Akka from a "fat jar" at http://doc.akka.io/docs/akka/snapshot/general/configuration.html. The issue is that there are multiple reference.conf configuration files, and the default behaviour of the Maven assembly or shade plugins is to overwrite earlier instances of the configuration file with later instances.

    To fix this, the suggested approach is to use the Maven shade plugin to generate your executable jar and configure it to append all resource.conf files into a single file instead of overwriting. The suggested Maven shade plugin configuration looks like:

    
     org.apache.maven.plugins
     maven-shade-plugin
     1.5
     
      
       package
       
        shade
       
       
        true
        allinone
        
         
          *:*
         
        
        
          
           reference.conf
          
          
           
            akka.Main
           
          
        
       
      
     
    
    

    0 讨论(0)
提交回复
热议问题