gpt4 book ai didi

java - Azure容器实例(Windows)是否支持访问表存储

转载 作者:太空宇宙 更新时间:2023-11-04 09:39:38 26 4
gpt4 key购买 nike

我有一个运行 spring-boot 应用程序的容器实例 (Windows),该应用程序从 spring-boot CommandLineRunner 中访问 azure 表存储。容器在本地运行良好(Docker/Win10 Pro)。

当我部署到容器实例时,在尝试从表中检索 DynamicTableEntity 时会引发 StorageException。与存储帐户和表的连接似乎成功,但检索操作失败。 Tomcat 服务器正在运行且响应良好(我捕获异常并准备由管理请求的 servlet 返回的基本错误信息)。我无法找到有关在容器中使用 Java Azure 存储库的任何示例或明确的声明,因此我想知道是否有任何限制或必要时的解决方法。

下面是指示异常抛出位置的日志。带有“CommandLineRunner”的日志条目是由我的代码生成的。我的应用程序中的第 397 行是我尝试从表中检索 DynamicTableEntity 的行(日志中的 14 行)。在此之前,连接字符串的解析没有错误,并且生成对表的引用也没有错误。虽然没有显示,但我很满意partitionKey和RowKey是正确的(异常(exception)是因为该表不存在 - 但它确实存在,并且在容器本地运行时可以访问)。第562行是spring-boot CommandLineRunner的入口点。

    **2019-05-13 00:57:44.632  INFO 3060 --- [           main] a.c.n.sbtest.demo.DemoApplication        : CommandLineRunner: Engine Intialization Ready (status: 0)**
2019-05-13 00:57:44.670 INFO 3060 --- [ main] a.c.n.sbtest.demo.DemoApplication : CommandLineRunner: Deployment table <Deployments> accessible
2019-05-13 00:57:44.687 INFO 3060 --- [ main] a.c.n.sbtest.demo.DemoApplication : CommandLineRunner: User <e7c6163e-8c06-4146-b0e4-78fec93e6cce> Container accessible
2019-05-13 01:00:17.755 INFO 3060 --- [nio-8080-exec-7] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-05-13 01:00:17.755 INFO 3060 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2019-05-13 01:00:17.768 INFO 3060 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Completed initialization in 13 ms
com.microsoft.azure.storage.StorageException:
at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:87)
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:209)
at com.microsoft.azure.storage.table.QueryTableOperation.performRetrieve(QueryTableOperation.java:178)
at com.microsoft.azure.storage.table.TableOperation.execute(TableOperation.java:694)
at com.microsoft.azure.storage.table.CloudTable.execute(CloudTable.java:529)
at com.microsoft.azure.storage.table.CloudTable.execute(CloudTable.java:496)
at **ai.com.neuralstudio.sbtest.demo.DemoApplication.lambda$commandLineRunner$0(DemoApplication.java:562)**
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:813)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:797)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at **ai.com.neuralstudio.sbtest.demo.DemoApplication.main(DemoApplication.java:397)**
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.net.UnknownHostException: neuralstudiotest002.table.core.windows.net
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:115)
... 19 more
2019-05-13 01:00:29.420 ERROR 3060 --- [ main] a.c.n.sbtest.demo.DemoApplication : CommandLineRunner: StorageException com.microsoft.azure.storage.StorageException: (status: -3)

如果您对可能发生的情况有任何见解,我将不胜感激。 jack

更新:虽然最近的 Windows 容器镜像的根本问题尚未解决,但 jakaruna-MSFT 在另一个论坛中回应并指出旧镜像存在问题

mcr.microsoft.com/windows/servercore:1607-KB4505052-amd64

会起作用,而且确实如此。根本问题显然与 DNS 服务有关,并且在转换到更新的图像时被破坏或被忽略。想必微软会抽出时间来修复后面的图像,无论有没有解释。

最佳答案

请参阅上面的更新。虽然最近的 Windows 容器镜像的根本问题尚未解决,但 jakaruna-MSFT 在另一个论坛中回应并指出旧镜像 mcr.microsoft.com/windows/servercore:1607-KB4505052-amd64

会起作用,而且确实如此。根本问题显然与 DNS 服务有关,并且在转换到更新的图像时被破坏或被忽略。想必微软会抽出时间来修复后面的图像,无论有没有解释。

关于java - Azure容器实例(Windows)是否支持访问表存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56119284/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com