Home > other >  How the SBT packaged configuration files?
How the SBT packaged configuration files?

Time:09-23

Dear Daniel, recently encountered such a problem, I use the SBT - after the assembly packaging program, submit the spark - submit, haven't found my profile,
Error message is this:
The Exception in the thread "main" Java. Lang. ExceptionInInitializerError
The at TopN. Finnished1 $. The main (finnished1 scala: 19)
The at TopN. Finnished1. Main (finnished1. Scala)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
The at org.apache.spark.deploy.SparkSubmit$.org $$$$$$runMain SparkSubmit deploy spark apache (SparkSubmit. Scala: 731)
The at org. Apache. Spark. Deploy. SparkSubmit $. DoRunMain $1 (181). SparkSubmit scala:
The at org. Apache. Spark. Deploy. SparkSubmit $. Submit (SparkSubmit. Scala: 206)
The at org. Apache. Spark. Deploy. SparkSubmit $. The main (SparkSubmit. Scala: 121)
The at org. Apache. Spark. Deploy. SparkSubmit. Main (SparkSubmit. Scala)
Under Caused by: Java. IO. FileNotFoundException: paramater. The properties (without the file or directory)
The at Java. IO. FileInputStream. Open0 (Native Method)
The at Java. IO. FileInputStream. Open (FileInputStream. Java: 195)
The at Java. IO. FileInputStream. & lt; Init> (a FileInputStream. Java: 138)
The at Java. IO. FileInputStream. & lt; Init> (a FileInputStream. Java: 93)
At the Client. RedisClient $. & lt; Init> (RedisClient. Scala: 11)
At the Client. RedisClient $. & lt; Clinit> (RedisClient. Scala)
. 11 more

Then I file structure is
The SRC
| - the main
| - sources
| - paramater. Properties
| the scala
| - client
| - TopN

Then I have a in the client's package of redis client, the code is:
The object RedisClient {
Val props=new Properties ()
Val: in InputStream=new BufferedInputStream (new FileInputStream (" paramater. Properties "))
Props. The load (in)
Val redisHost=props. GetProperty (" redis. Host ")
Val redisPort=props. GetProperty (" redis. Port "). ToInt
Val redisTimeout=props. GetProperty (" redis. A timeOut ".) toInt
Lazy val pool=new JedisPool (new JedisPoolConfig (), redisHost, redisPort, redisTimeout)
Lazy val hook=new Thread {
Override def run={
Println (" the Execute hook thread: "+ this)
Pool. Destroy ()
}
}

Sys. AddShutdownHook (hook. The run)
}
Excuse me, is my code, or a packing problem, how to solve???
  • Related