Tomcat

SEVERE: Exception looking up UserDatabase under key UserDatabase javax.naming.NameNotFoundException: Name [UserDatabase] is not bound in this Context

孤街浪徒 提交于 2021-02-11 09:52:06
问题 im using TOMCAT 9 and latest hibernat jars with java 1.8 i create simple user in mysql and 1 table db called foo1 in my webapp in tomcat i configured based on examples online : workspace\HibernateApp\src\hibernate.cfg.xml: <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="show_sql">true<

SEVERE: Exception looking up UserDatabase under key UserDatabase javax.naming.NameNotFoundException: Name [UserDatabase] is not bound in this Context

半腔热情 提交于 2021-02-11 09:51:32
问题 im using TOMCAT 9 and latest hibernat jars with java 1.8 i create simple user in mysql and 1 table db called foo1 in my webapp in tomcat i configured based on examples online : workspace\HibernateApp\src\hibernate.cfg.xml: <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="show_sql">true<

Docker execute ant script after tomcat starts?

陌路散爱 提交于 2021-02-11 08:56:10
问题 Dockerfile works correctly for tomcat. After tomcat starts, I have to trigger ant scripts. catalina.sh is started from a separate run.sh file. So, Dockerfile has CMD ["/tmp/run.sh"] The run.sh file has below lines: catalina.sh run antscript Tomcat starts but ant scripts are not called. I also tried other possibilities like: catalina.sh run && antscripts tomcat starts but antscripts are not triggered Is there a way that I can call the ant scripts automatically after tomcat starts? I dont want

腾讯云服务器部署web项目

主宰稳场 提交于 2021-02-10 21:44:12
一、首先需要去 腾讯云 购买一个云服务器,个人可以免费领取一个十五天的体验版. https://cloud.tencent.com/act/free 二、在自己电脑点击开始菜单-> Run,输入"mstsc"命令,即可打开远程桌面连接对话框。 在输入框中输入 腾讯云 服务器的公网IP,在云服务器云主机可以查看公网IP 点击链接后,输入管理员账号和密码 (账号和密码可以在消息中心的站内信查看) 登录后就可以链接到云服务器的桌面 三、在云服务器中,需要进行下载安装Tomcat,MySQL和JDK,过程中有问题可自行百度. 关于此处有个人发现的一些小技巧,在文章末尾有总结. 四、环境配置完毕后,将eclipse的项目导出成war文件,然后放到Tomcat的webapps文件夹下. 然后可以将数据库导入. 五、启动Tomcat,打开浏览器 输入http://localhost:8080……..后面的大家都懂,和在自己电脑上查看发布在Tomcat的项目相同,如果可以显示,说明环境配置成功. 六、在自己电脑云主机-控制台页面,点击安全组,添加一个安全组. 注意!!!! 新建的安全组要选择放通全部端口,创建好后,点击最右边管理实例,将你的云主机添加进来,进行关联. 七、当我做到这里就在自己电脑用外网IP尝试登陆,发现并不可以.最后还有关键的一步. 转载自他人并盗图 https://www

JAR冲突问题的解决

心已入冬 提交于 2021-02-10 19:48:57
今天碰到群里小伙伴问,线上程序好像有多个不同版本的Netty包,怎么去看到底加载了哪一个? 在说如何看之前,先来说说,当你开始意识到项目里有多个不同版本的Jar包,都是因为遇到了这几个异常: 1、java.lang.NoSuchMethodException:自己代码中调用了某个方法,因为加载了其他版本的jar,这个版本正好没这个方法。 2、java.lang.NoClassDefFoundError:编译时候是好的,但是运行的时候,因为加载的jar版本问题,没有这个类。 3、java.lang.ClassNotFoundException:在动态加载某个Class的时候,因为要加载的jar不是正确的版本,而导致找不到这个类。 当你在本地运行ok,但到服务器上发现出现这些错误的时候,就要意识到很可能是jar冲突了(有相同依赖存在多个版本)。这个问题往往也会有这样的表现:多实例部署的时候,有的实例是好的,有的实例则不行。 查看加载的类和方法 根据之前分析的异常种类,我们可以去运行中的现场确认当前加载的问题。 这里我们可以使用阿里开源的Arthas工具,如果第一次用,那么按下面操作先安装再运行: curl -O https://arthas.aliyun.com/arthas-boot.jar java -jar arthas-boot.jar 运行好之后

May be a bug in tomcat 9.0.26 when i meet a deadlock

本秂侑毒 提交于 2021-02-10 18:32:17
问题 when i press test my application with spring boot 2.1.9.RELEASE and tomcat 9.0.26 i meet a deadlock. It's maybe a bug with tomcat. when i use tomcat 8.5.49 instead the bug is not appear. The follow is the stack i dump from my application. Found one Java-level deadlock: ============================= "http-nio-8080-exec-455": waiting to lock monitor 0x00007f59c40475e8 (object 0x00000006c0b4fe28, a java.util.HashSet), which is held by "http-nio-8080-ClientPoller" "http-nio-8080-ClientPoller":

Mac系统安装Tomcat服务器

妖精的绣舞 提交于 2021-02-10 18:31:50
超简单Mac安装Tomcat服务器 1.首先下载tomcat 下载连接 2. 解压并改名 3.把Tomcat复制到系统中的资源库或者Library 4.打开shell,进入Tomcat下面的bin目录 5.执行命令 //开启权限 $ sudo chmod 755 *.sh //启动服务 $ sudo sh ./startup.sh //关闭服务 $ sh ./shutdown.sh 导入到系统环境变量中 $ vim ~/.bash_profile #添加下面的内容(路径设置为自己的) export PATH=$PATH:/Library/Tomcat/bin $ source ~/.bash_profile 在命令行输入 startup.sh 启动 输入 shutdown.sh 关闭 #到此为止,安装成功,打开浏览器输入 http://127.0.0.1:8080即可看到tomcat 来源: oschina 链接: https://my.oschina.net/u/4317309/blog/3614400

How to set a custom ErrorReportValve in Tomcat?

吃可爱长大的小学妹 提交于 2021-02-10 18:22:49
问题 I want to set a custom ErrorReportValve . How do I do that? 回答1: To set a custom ErrorReportValve : Create a JAR with your custom valve Put it into $CATALINA_BASE/lib Add the errorReportValveClass to your Host element Restart your Tomcat 来源: https://stackoverflow.com/questions/12287719/how-to-set-a-custom-errorreportvalve-in-tomcat

How to set a custom ErrorReportValve in Tomcat?

可紊 提交于 2021-02-10 18:20:47
问题 I want to set a custom ErrorReportValve . How do I do that? 回答1: To set a custom ErrorReportValve : Create a JAR with your custom valve Put it into $CATALINA_BASE/lib Add the errorReportValveClass to your Host element Restart your Tomcat 来源: https://stackoverflow.com/questions/12287719/how-to-set-a-custom-errorreportvalve-in-tomcat

Need sample code explaning Workmanager in Tomcat

元气小坏坏 提交于 2021-02-10 15:16:51
问题 I want to know how to use WorkManager in Tomcat 7. I came across the open source library Foo-CommonJ but nowhere i found a sample code explaning the usage. The input parameter for FooWorkManager's constructor is an instance of commonj.work.work class, where as no one provides the commonj.work.work class (neither tomcat nor foo-commonj). Basically i need a sample code explaining usage of WorkManager (FooCommonj jar) in tomcat. And if Foo-Commonj doesn't support workmanager properly, then some