关于Glassfish服务器如何使用IntelliJ调试器运行的细节? [英] Specifics on How Glassfish Server is Run with IntelliJ Debugger?

查看:113
本文介绍了关于Glassfish服务器如何使用IntelliJ调试器运行的细节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇IntelliJ调试器如何使用我的glassfish服务器的domain.xml并在请求时报告网页。

I'm curious as to how the IntelliJ debugger uses the domain.xml of my glassfish server and reports a webpage when requested.

具体来说,我有一个IntelliJ名为 blobGame 的项目,它使用Glassfish服务器在部署工件.war和.ear时打开名为blobGame的网页。

Specifically, I have an IntelliJ project called blobGame that uses a Glassfish server that opens a webpage called blobGame when the artifacts .war and .ear are deployed.

首先,如何是否部署了这些工件?当我部署它们时,我必须将localhost的URL设为 http:// localhost:60836 / blobGame_war_exploded localhost:60836 / blobGame 无法正常工作,即使我在调试配置中更改了它 - 这是我的调试器信息

Firstly, how are these artifacts deployed? When I deploy them, I MUST have the URL of the localhost be http://localhost:60836/blobGame_war_exploded, and localhost:60836/blobGame DOES NOT WORK, even if I change it in the debug configuration - here is my debugger info

这是为什么?为什么url必须是 / blobGame_war_exploded?它甚至不能是 / blobGame_ear_exploded ,因为我在domain.xml中也看到了。

Why is this? Why does the url have to be /blobGame_war_exploded? It cannot even be /blobGame_ear_exploded, as I see that also in the domain.xml.

以下是我的域名为domain2的domain.xml片段:

Here is the snippet of domain.xml for my domain called "domain2":

  <applications>
    <application object-type="user" name="blobGame_ear_exploded" directory-deployed="true" location="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_ear_exploded/">
      <property name="archiveType" value="ear"></property>
      <property name="isComposite" value="true"></property>
      <property name="appLocation" value="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_ear_exploded/"></property>
      <property name="org.glassfish.ejb.container.application_unique_id" value="98074431158681600"></property>
      <property name="defaultAppName" value="blobGame_ear_exploded"></property>
      <module name="web.war">
        <engine sniffer="ejb"></engine>
        <engine sniffer="security"></engine>
        <engine sniffer="weld"></engine>
        <engine sniffer="web"></engine>
      </module>
      <engine sniffer="ear"></engine>
    </application>
    <application context-root="/blobGame_war_exploded" object-type="user" name="blobGame_war_exploded" directory-deployed="true" location="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_war_exploded/">
      <property name="archiveType" value="war"></property>
      <property name="appLocation" value="file:/C:/Users/Kevin/EECS/blobGame/out/artifacts/blobGame_war_exploded/"></property>
      <property name="org.glassfish.ejb.container.application_unique_id" value="98074431158812672"></property>
      <property name="defaultAppName" value="blobGame_war_exploded"></property>
      <module name="blobGame_war_exploded">
        <engine sniffer="ejb"></engine>
        <engine sniffer="security"></engine>
        <engine sniffer="weld"></engine>
        <engine sniffer="web"></engine>
      </module>
    </application>
  </applications>

第二,为什么部署我重新部署或重新启动服务器时仍然使用以前的工件(我假设它们是这样的)?

SECOND of all, why does the deployment still use previous artifacts (as I assume they are) when I redeploy or restart the server?

具体来说,当我按下重启时,我会得到完全相同的HTML和javascript文件我之前离开了,即使我在第二次调试之前编辑了html或JS文件。
(我在新调试中添加了alert(test),但它没有出现在新调试中。当我独立访问index.html页面时,警报会显示出来。)

Specifically, when I press restart, I get the exact same HTML and javascript files I was left with before, and even if I edited the html or JS files during the time before my second debug. (I add alert("test") in the new debug, but it does not show up in the new debug. When I access the index.html page independently the alert does show up).

这是index.html

Here is the index.html

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>keyBoardDemo</title>
    </head>
    <body>
        <canvas id="canvas" width="800" height="600" style="border:1px solid #000000;"></canvas>
        <p id="main"></p>
        <script type="text/javascript" src=resources.js></script>
        <script type="text/javascript" src=canvas.js></script>
        <script type="text/javascript" src=keyboard.js></script>
        <script type="text/javascript" src=packethandler.js></script>
        <script type="text/javascript" src=player.js></script>
        <script type="text/javascript" src=websocket.js></script>
    </body>
</html>

这里是它调用的canvas.js:

and here is the canvas.js that it calls:

alert("test 123"); //this is not called on the second redeployment!


var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");

推荐答案


首先,如何部署这些工件?当我部署它们时,我必须有URL ...

Firstly, how are these artifacts deployed? When I deploy them, I MUST have the URL ...

默认情况下,IDEA通过替换从工件名称计算上下文根带有下划线的不支持的字符。因此,'blobGame:war爆炸'工件,默认情况下获取'blobGame_war_exploded'上下文根。

By default, IDEA computes context root from the artifact name, by replacing unsupported characters with underscores. Thus, the 'blobGame:war exploded' artifact, by default gets 'blobGame_war_exploded' context root.

要更改工件的上下文根,您可能需要打开运行配置的部署选项卡,选中使用自定义上下文根并在字段中输入所需的值

To change the context root for the artifact, you may want to open the 'Deployment' tab of the run configuration, check 'Use custom context root' and enter the desired value into the field

服务器选项卡上的打开浏览器字段它不会影响服务器设置,它只允许您在服务器启动后打开您喜欢的任何URL。字段值默认到从第一个工件计算的URL,但是一旦用户更改了它,IDEA就会假定用户知道的更好。

'Open browser' field on the 'Server' tab does not affect the server settings, it just allows you to open whatever URL you like after the server start. The field value defaults to the URL computed from the first artifact, but once user have changed it IDEA assumes that user knows better.


具体来说,当我按重启时,我会得到与之前剩下的完全相同的HTML和javascript文件,...

Specifically, when I press restart, I get the exact same HTML and javascript files I was left with before, ...

预期的顺序如下:


  1. make更改资源

  2. 使用提及的更新<>应用程序操作更新服务器上的应用程序:更新资源选项应足以用于展开的应用程序,重新部署/重新启动归档工件可能需要

  3. 重新加载(刷新)在浏览器中使用资源的页面

我怀疑你错过了最后一步(3)。请注意,步骤(2)仅更新服务器上的资源,并且要查看浏览器中的更改(在客户端上),您应该通过手动刷新页面从服务器重新加载相应的资源。

I suspect you're missing the last (3) step. Please note, step (2) only updates the resource on the server, and to see a change in browser (on client) you should reload the corresponding resources from server by refreshing the page manually.

希望有所帮助,
我要重定向你的第二篇文章到这个答案

Hope that helps, I am going to redirect your second post to this answer

这篇关于关于Glassfish服务器如何使用IntelliJ调试器运行的细节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆