我有一个自由的docker容器,女巫似乎启动得很好,但是当我尝试通过浏览器进入时,服务器无法访问。 我使用IBM Sample1.war进行测试,以确保它不是war文件。我的问题是日志文件看起来不错:
[AUDIT ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.2/lafiles/en.html
[AUDIT ] CWWKG0093A: Processing configuration drop-ins resource: /opt/ibm/wlp/usr/servers/defaultServer/configDropins/defaults/keystore.xml
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/Sample1/
[AUDIT ] CWWKZ0001I: Application Sample1 started in 0.394 seconds.
[AUDIT ] CWWKF0012I: The server installed the following features: [servlet-3.1].
[AUDIT ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
这里是docker文件:
FROM websphere-liberty:kernel
COPY server.xml /config/
COPY build/libs/Sample1.war /config/dropins/
RUN installUtility install --acceptLicense defaultServer
我不知道如何调试而不会出现任何错误。 谢谢
这是我的Server.xml:
<server description="default servlet engine">
<!-- Enable features -->
<featureManager>
<feature>servlet-3.1</feature>
</featureManager>
<httpEndpoint host="localhost" httpPort="9080" httpsPort="9443"
id="defaultHttpEndpoint" />
答案 0 :(得分:2)
您的服务器似乎没有错误运行,并且已经以Web根目录/ Sample1部署了Sample1 war
如上所述,您需要的是:
aes
确保使用端口映射运行docker,例如
server.xml
打开浏览器并输入url(我猜您正在运行Sample1演示,其中包含SimpleServlet)
http://the-ip/Sample1/SimpleServlet或https://the-ip/Sample1/SimpleServlet
上面告诉我们,我们使用端口80和443(标准端口,无需在url中指定它们),-ip取决于您运行本地docker容器还是远程。如果运行本地,请输入ip / localhost。
我还建议下载IBM Web developer tools for eclipse,它使您可以在IDE环境中非常轻松地管理服务器。
具有一些好的链接: