maven工程开启jetty调试

maven中集成jetty插件的使用 maven中集成jetty插件的使用一、pom.xml 引入插件二、编译和运行 一、pom.xml 引入插件 <build> <plugins> <!-- jetty插件 --> <plugin> <groupId>org.mortbay.j... 阅读详情

原文http://czj4451.iteye.com/blog/1942437

准备工作: 

a. 在pom.xml中配置jetty插件: 

Xml代码   收藏代码
  1. <plugins>  
  2.     <plugin>  
  3.         <groupId>org.mortbay.jetty</groupId>  
  4.         <artifactId>maven-jetty-plugin</artifactId>  
  5.         <version>6.1.26</version>  
  6.         <configuration>  
  7.             <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>  
  8.             <scanIntervalSeconds>6</scanIntervalSeconds>  
  9.             <contextPath>/prospect</contextPath>  
  10.             <webDefaultXml>jetty.xml</webDefaultXml>  
  11.             <jettyEnvXml>jetty-env.xml</jettyEnvXml>  
  12.             <connectors>  
  13.                 <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">  
  14.                     <port>8080</port>  
  15.                     <headerBufferSize>80000</headerBufferSize>  
  16.                 </connector>  
  17.             </connectors>  
  18.             <stopKey>stop</stopKey>  
  19.             <stopPort>8089</stopPort>  
  20.         </configuration>  
  21.     </plugin>  
  22. </plugins>  


b. 使用maven的clean install命令将web及依赖工程打包成war文件。 


方式1 - Eclipse调试:  

①. 右键maven工程,在弹出的菜单中选择[Debug As],首次选择[Maven build...],以后选择[Maven build]来读取保存的配置启动: 


②. 在浏览器输入地址http://localhost:8080/prospect/already/mosaic.htm,在代码上加断点,命中后IDE提示:Source not found: 
 

解决: 
点击[Edit Source Lookup Path...]添加源代码工程或目录 

完成后即可调试代码: 



方式2 - 远程调试:  

①. 选择Eclipse的[Run]-[External Tools]-[External Tools Configurations...]菜单。 

在打开的对话框中,新建一个Program,输入mvn.bat (mvnDebug.bat)的完整路径,指定要启动的web工程,在Arguments框输入jetty:run 

 

使用mvn.bat时,需要添加调试参数: 
切换到Environment选项,添加一个变量: 
MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1066 

注: address是和调试器通信的端口,不是服务的端口号 。 



其它参数: 
-Xnoagent: 禁用默认sun.tools.debug调试器 
-Djava.compiler=NONE: 禁止JIT编译器的加载 
dt_shmem: 共享内存传输,仅限于Windows 

点击[Run]启动jetty服务器  

选择Eclipse的[Run]-[Debug Configurations...]菜单,在弹出的对话框中,新建一个Remote Java Application,指定和External Tools里面相同的工程和连接属性: 



点击[Debug]启动调试客户端  

 

②. 同方式1的② 


附: 
i. 远程调试的jvm可以独立于Eclipse运行: 
 

这时Eclipse里只有调试客户端: 
 

ii. 如果suspend=y,运行JVM而没有开启调试客户端,JVM会等待直到客户端就绪: 

MagicDraw小白必看:BDD图中模块的5种属性详解(含SysML v1.6最新端口配置指南) 本文面向MagicDraw初学者,详细解析SysML BDD图中模块的五种核心结构属性,包括组成部分、引用、值、约束属性及端口。重点阐述了SysML v1.6中端口设计的范式转移,对比了完整端口与代理端口的区别与应用场景,并通过实战案例指导如何利用代理端口进行清晰的接口定义与系统架构设计。 阅读详情

相关推荐

毕设案例|保安公司智慧管理系统的建设与开发方案

"保安公司智慧管理系统是一款专为保安行业设计的高效信息化解决方案,其核心功能涵盖了从人力资源管理到业务运营的各个方面。系统以Java作为开发语言,结合SpringMVC框架,确保了稳定性和可扩展性,而MySQL数据库则提供了强大的数据存储和处理能力。首先,系统允许用户设置各类保安,如门卫、巡逻员等,实现精细化分类管理。其次,保安信息管理模块包括详细的人事档案、资格证书、培训记录等,便于人员追踪和考核。部门和城市设置方便公司层级管理和异地项目管理。岗位设置与时间安排精确到分钟,确保排班科学合理。

muyu2980的专栏 935

java idea maven工程 org.mortbay.jetty升级

org.mortbay.jetty 太旧 用下边替换 pom.xml 中plugin 保存后刷新。

qq_58019045的博客 956

基于STM32的宠物智能照护嵌入式系统设计

嵌入式系统是实现物联网终端设备本地化感知、决策与执行的核心技术载体,其关键在于多传感器融合、低功耗执行控制与轻量级云边协同。本文围绕环境监测(温湿度、烟雾、余粮)、机电执行(步进电机食盘、继电器风扇)和可靠通信(MQTT+ESP8266)三大技术主线,深入解析STM32F103在资源约束下的外设调度策略、ADC采样抗干扰设计、DHT11时序精准控制及HX711称重滤波算法等工程实践要点。系统强调本地闭环优先原则,确保离线基础功能可用,同时通过阿里云IoT平台实现远程监控与告警联动,为中小型智能硬件项目提供可

weixin_29155599的博客 292

jetty快速入门

转自:http://blog.sina.com.cn/s/blog_608379270100mslx.htmlJetty 是一个开源的servlet容器,它为基于Java的web内容,例如JSP和servlet提供运行环境。Jetty以其高效、小巧、可嵌入式.如果让一个人说出一种开源的servlet容器,可能他们会回答Apache Tomcat。但是,Tomcat并不是孤单的,我们还有Jett

callsea的专栏 1110

九齐NY8B062F单片机:12位ADC与4路PWM在智能家居控制中的实战应用

本文详细介绍了九齐NY8B062F单片机在智能家居控制中的实战应用,重点解析其12位ADC高精度传感器数据采集和4路PWM精准驱动技术。通过实际案例展示如何利用该单片机实现温湿度监测、灯光调节及电机控制,并分享低功耗设计与抗干扰方案,为低成本高可靠性的智能家居设备开发提供完整解决方案。

rnn9storyteller的博客 730

ESP32S3学习——i2c,点亮0.96寸oled

ESP32S3学习——i2c,点亮0.96寸oled

HandBAI的博客 1万+

Maven中使用Jetty容器

1、在pom.xml中添加Jetty的插件 <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.5</version> <co...

weixin_30325793的博客 329

ERA5数据批量下载

ERA5再分析数据的IDM接管下载

qq_38734327的博客 3034

【Maven】maven工程 调试出现 Source not found ,开启jetty调试

问题:maven工程使用jetty 调试出现 Source not found,解决如下: 1、开启MAVEN_OPTS的调试参数 配置如下:-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1066 配置的地方如下: 2、参数含义如下: -Xdebug :通知JVM工作DEBUG模式

Draco 8916

西门子S7-200 SMART与施耐德ATV变频器Modbus通讯实战:从接线到稳定运行的完整指南

本文详细介绍了西门子S7-200 SMART PLC与施耐德ATV变频器之间实现稳定Modbus通讯的完整实战指南。内容涵盖从硬件接线、参数配置、PLC程序编写到触摸屏设计的全流程,并分享了提升通讯稳定性的关键技巧和常见故障排查方法,助力工业自动化系统可靠运行。

kkk56的博客 1106

机器学习发展历史及现状(重要的期刊,会议,大牛总结)

1 引言 机器学习是指通过计算机学习数据中的内在规律性信息,获得新的经验和知识,以提高计算机的智能性,使计算机能够像人那样去决策。随着各行业对数据的需求量增多,对处理和分析数据的效率要求变高,一系列机器学习算法应运而生。机器学习算法主要是指通过数学及统计方法求解最优化问题的步骤和过程。针对不同的数据和不同模型需求,选择和使用适当的的机器学习算法可以更高效地解决一些实际问题。本文将从机器学习的起源...

Oscar2018的博客 5万+

jetty maven工程开启jetty调试

准备工作:a. 在pom.xml中配置jetty插件: <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.26</version> <

Code-lover's Learning Notes 1088

Fedproto:原型聚合的联邦学习框架

文中说明,联邦学习通过计算传递梯度聚合模型时,客户端之间的异构性通常会阻碍模型优化收敛和泛化性能。故本文提出新的FedProto框架,将梯度替换成为原型,通过计算、聚合从不同客户端收集到的本地原型,然后将全局原型发送回所有客户端,以规范本地模型的训练。对每个客户机进行局部训练的目的是最小化对本地数据的分类损失,同时保持生成的本地原型足够接近相应的全局原型(损失函数最小+正则)。什么是原型?文中提到:“

weixin_47754029的博客 2649

maven工程 调试出现 Source not found ,开启jetty调试

问题:maven工程使用jetty 调试出现 Source not found,解决如下: 1、开启MAVEN_OPTS的调试参数 配置如下:-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1066 配置的地方如下: 2、参数含义如下: -Xdebug

huaieli1的博客 1290

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

maven+jetty工程开启Debug调试

①. 右键maven工程,在弹出的菜单中选择[Debug As],选择[Maven build…]。 ②. 在浏览器输入地址URL地址,在代码上加断点,命中后IDE提示:Source not found。 -》选择Edit Source Lookup Path -》选择Add -》选择Java Project 选择相应的Project 进行OK确定即可。 这时界面会出现一闪,然后又回到’

轻舟泛水 1305

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

IDEA13+Maven + Jetty-plugin 调试项目

IDEA13+Maven + Jetty-plugin 调试项目1、pom.xml&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.or...

weixin_34153893的博客 125

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jetty调试mavenWEB项目

新项目决定用现在流行的maven结构来发开。 但由于maven的编译结果不是标准的sevlet结构,原来的eclipse+tomcat插件无法直接debug。 网上都说用jetty来调试,那就改用jetty吧。 首先要配置一个外部工具,来运行JETTY Run->External Tools->External Tools Configurations... 双击Program 新建一个

chagaostu的专栏 750

Eclipse中调试Maven+Jetty

Eclipse中调试Maven+Jetty

PseudoScience 1697
上一篇: Linux 推荐分区
下一篇: Class.forName()用法详解
javaee_ssh
博客等级 码龄18年 42粉丝 42原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值