我如何让 AmazonDynamoDB Local 的用户为我工作。尽管提供了所有配置信息,但我在服务器端和客户端超时时遇到错误。
服务器
C:\Program Files (x86)\Java\jre7\bin>java -Djava.library.path=. -jar C:\Users\XXX\XXX\DynamoDB\dynamodb_loca
l_2013-09-12\DynamoDBLocal.jar --port 8888
2013-10-09 11:15:44.346:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
2013-10-09 11:15:44.413:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8888
Oct 09, 2013 11:15:55 AM com.almworks.sqlite4java.Internal log
INFO: [sqlite] DB[1]: instantiated [XXXXXXXXXXXXXXXXX_us-east-1.db]
Oct 09, 2013 11:15:55 AM com.almworks.sqlite4java.Internal log
WARNING: [sqlite] cannot open DB[1]: com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.Unsa
tisfiedLinkError: no sqlite4java-win32-x86 in java.library.path
Oct 09, 2013 11:15:55 AM com.almworks.sqlite4java.Internal log
SEVERE: [sqlite] SQLiteQueue[AKIAIZR4RBNLFYSQQKAQ_us-east-1.db]: error running job queue
com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError: no sqlite4java-win3
2-x86 in java.library.path
at com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:97)
at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1314)
at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:258)
at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:269)
at com.almworks.sqlite4java.SQLiteQueue.openConnection(SQLiteQueue.java:464)
at com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:641)
at com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623)
at com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77)
at com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205)
at java.lang.Thread.run(Unknown Source)
原因:java.lang.UnsatisfiedLinkError: no sqlite4java-win32-x86 in java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang. System.loadLibrary(Unknown Source) at com.almworks.sqlite4java.Internal.tryLoadFromSystemPath(Internal.java:349) at com.almworks.sqlite4java.Internal.loadLibraryX(Internal.java:124) at com.almworks.sqlite4java.SQLite。 loadLibrary(SQLite.java:95) ... 还有 9 个
Oct 09, 2013 11:15:55 AM com.almworks.sqlite4java.Internal log
WARNING: [sqlite] SQLiteQueue[XXXXXXXXXXXXXXXX_us-east-1.db]: stopped abnormally, reincarnating in 3000ms
客户
class Program
{
private static AmazonDynamoDBClient client;
static void Main(string[] args)
{
CreateClient();
CreateTablesUploadSampleItems(client);
}
private static void CreateClient()
{
var config = new AmazonDynamoDBConfig();
config.ServiceURL = System.Configuration.ConfigurationManager.AppSettings["ServiceURL"];
var accessKey = System.Configuration.ConfigurationManager.AppSettings["AWSAccessKey"];
var secretAccessKey = System.Configuration.ConfigurationManager.AppSettings["AWSSecretKey"];
client = new AmazonDynamoDBClient(accessKey, secretAccessKey, config);
}
}