How to build web.xml for Dropwizard application - java

I have created application in Dropwizard, which is serving REST API to my clients. I used to run this from .jar file on server, everything worked fine.
Now I have requirement to move my application to WildFly, so now I assume that I need to have a WAR instead of JAR, and here comes my problem:
How to write web.xml to my application? What to include in there? Could anyone give me any template or tutorial or some example how it is done in Dropwizard?

I found what I was looking for. It's wizard-in-a-box project that do all the necessary things to build a WAR file.

Related

Re-deploy spring boot service without restart?

I have developed a micro service (Spring Boot REST service, deployed as executable JAR) to track all activities from third party projects as my requirement and its working now.
Currently it's working apart of some projects, and now I have updated service with some additional features.
But I can't move it to live server without restarting the existing service as it is deployed as jar. I'm afraid to restart my service, restart may be leads to lose data of integrated projects.
What improvements can I make in my architecture to solve my problem?
What about JRebel plugin. It worked perfectly for me, but, unfortunately, it's not a free app. Like alternative, (i used this approach with Spring MVC, with Spring Boot it could be otherwise), I set up a soft link in work directory on a compiled path in JBoss (in my case it was dir with name target and *.class and *.jar files). As for me, the first solution with JRebel is the most appropriate for you.
Finally got a solution as commented by #Gimby .
We can do it by deploying multiple instances of services and it bound to a service registry ,Here i achieved it by using eureka as registry service and also used zuul as proxy .

jersey REST layer for existing project

I'm working on project which has an existing war file containing java code. Currently this project is deployed on tomcat but war is not placed in webapps, it is in different location and referenced in tomcat using file containing following in Catalina/localhost folder.
<Context docBase="war path/<file.war>" unPackWAR="false"/>
My requirement is to design a restful webservices for this existing project. I have setup a standalone dynamic web project with Jersey REST setup and its working fine. Whenever a rest call will be made it needs to call its underlying api(existing one).
Note: Both the projects are deployed on same tomcat container, but existing war project file is un-extracted and resides in different location.
Also i dont want to combine both the project into single war.
Could some help me figure out how to call the existing java functions from new REST project?
Can JMX connection work in this case or is that recommended?
Appreciate your help!
Thanks,

An address of a website deployed using Tomcat and Eclipse

I'm trying to run a website using Tomcat and Eclipse. I created a Dynamic Web Project, I configured web.xml file and I also used Maven. In a directory src/main/webapp I put an index.html file. I also made a simple REST service in the same project. So this REST service is working for me (for example, when I put "http://localhost:8080/RESTfulService/rest/item" in an address bar. But what is the address that I should write to get an access to a website I put in a webapp folder? I thought "http://localhost:8080/RESTfulService/" should be working, but it's not.
From what i understand of your setup, try "http://localhost:8080/index.html". Do you have a context path called 'RESTfulService' setup?
Do you have a context element listed in your server.xml? If so, what does it say?

Deploy Axis2 .aar without Axis2 web application

I would like to know if there's a way to deploy an Axis2 .aar file without having to include it as part of the Axis 2 web application.
I know that my question is short, but there isn't much information that I could provide to direct my question.
Yes, there is.
The axis2 web archive (axis2.war) can be extracted once and never has to be extracted again after that.
Following changes within the axis2 webapp directory are common:
You add modules in 'axis2/WEB-INF/modules/'.
You add libraries in 'axis2/WEB-INF/lib/'.
You change the configuration in 'axis2/WEB-INF/conf/axis2.xml' file.
You deploy your services in 'axis2/WEB-INF/services/'.
Also, there's an option for hot deploys in the services directory. In the axis2.xml file, the folowing line enables this:
<parameter name="hotdeployment">true</parameter>
You can also override the default location of services with the following configuration parameter:
<parameter name="ServicesDirectory">service</parameter>
You can, of course, also make symlinks (unix/linux) instead, but I would not recommend polluting your installation with those.
So, to wrap it up, after your initial deploy of the axis2.war file, you do not need to redeploy it, it can stay, and you can deploy your .aar-files in the services directory. If hot deploy is not enabled (default), you need to restart your tomcat server/reload context manually.
I believe you want to deploy an axis2 web service in an existing application, if so, look at this

Put authentication/login configuration inside PROJECT

I implemented a custom login module I want to use with the JBoss AS 6. I followed some tutorial guidelines on the internet, namely http://x-techteam.blogspot.com/2007/04/jboss-custom-login-module-simple.html.
They write about configuring ${JBOSS_HOME}/server/default/conf/login-config.xml and deploy a JAR with the custom login module, but I don't like the idea of changing a configuration within the JBoss folder.
I really would like to have ALL configurations within my WAR file. The EE application I write will be sent to some customers and they should not have to worry about configuring some security contexts or roles via XML.
So my question is:
Can I have a local login-config.xml within my war that will be picked up by JBoss?
Can the custom login module class remain within my war, without having to deploy it to some JBoss folder?
Thank you in advance.
Use dynamic security domains:
link

Categories

Resources