Can't Access ActiveMQ Web Console - eclipse

I am having trouble accessing ActiveMQ's web console.
On their website it says you can access the console through the URL : localhost:8161/admin
But all I get when I try this is "This webpage is not available"
I found another site saying I can access it through port '61616', which gives me a response in the form of the following :
I have done some extensive searching on this issue, and have found others with the same problem, but have not come across a solution.
I am fairly new to using ActiveMQ so please excuse me if I have left out any relevant information.
Any help is greatly appreciated.

The admin console is a web application (WAR-file) deployed in an embedded Jetty server that starts up along with ActiveMQ standalone distribution.
Since you intend to run ActiveMQ inside a web application inside Tomcat, it would not make sense to fire up a jetty server.
Simply deploy the web console WAR to your Tomcat. You need to point out the JMS/OpenWire connection URI as well as JMX connection URI to ActiveMQ Web Console to get it going. Typically in Tomcat setenv.sh (or similar file):
JAVA_OPTS="$JAVA_OPTS -Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://localhost:61616- Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi -Dwebconsole.jmx.user=admin -Dwebconsole.jmx.password=mypassw0rd"
This requires you to have JMX setup on your Tomcat instance. If not, check this Tomcat doc page out.
This will deploy the console just like any app in your Tomcat (not port 8161).
Off-topic, but a nice feature with decoupling the web console from the actual broker is that you can access a the activem broker of a master/slave pair using failover protocol and comma separated jmx settings.

Related

Running ActiveMQ Artemis web console in embedded mode

In the artemis example folder, there is a sample that helped me run artemis in embedded mode. This is helpful for me when dealing with unit tests.
Is it possible to view the console in browser (localhost:8161) after running the server in embedded mode.
I found that the console war file is listed in bootstrap.xml file and I tried to place bootstrap.xml file in classpath as well but still not able to run console.
Is it possible to view web console when artemis run in embedded mode?
When you run your own embedded instance of ActiveMQ Artemis the bootstrap.xml file isn't used. That file is only used by a standalone broker. The application which embeds the broker is itself responsible for bootstrapping it (i.e. configuring and passing in all the prerequisites).
By default a standalone broker will configure and start an embedded instance of Jetty. It will also deploy the web console WAR to this Jetty instance. All this is defined in bootstrap.xml.
However, when you embed your own broker all you get is the broker. If you want a web server in your application to serve any web applications (e.g. the ActiveMQ Artemis web console) then you'll have to embed that yourself as well along with the broker.

REST Spring Boot Web Service on Websphere 9

I want to create a Spring Boot REST Web Service and deploy and publish it in Traditional Websphere 9 Application Server. Is it possible ?
What all challenges I might encounter? Can someone please provide me few pointers for reference?
Yes this can be done. It is not a good design, but yes it can be done. Back in the day when I was working for a big bank, they deployed java spring-boot microservices in IBM websphere(Not liberty).
How to do it?
1) Package your deployable as war. You can do this by editing your pom to package as WAR.
2) You can either add connection string config in your springboot starter class or get a JNDI created in the websphere instance. We observed that performance of the API's improved when the app used websphere JNDI as opposed to app created connection bean.
3) If you use IBM MQ, the best course of action is get a non-ssl and ssl based channel created at MQ and a JNDI for the MQ connection as well.
4) If you plan to create MQ connection beans within the app, like we did, ensure the JKS file has all the valid set of signers of your org.
Problems we faced
1) Our app used a lot of third party rule engine like drools, so ensure the websphere server.xml is configured to servlet version 3.1 or higher
2) Webshpere admin console is helpful, but don't just blindly believe if it says green to your container, always check your app logs for errors.
3) Common pain points are establishing a successful connection with IBM MQ host. Get a MQ server admin to troubleshoot all MQRC errors.
4) If you plan to use Oracle as backend, ensure the DBA has created a wallet for you to enable both SSL and Non SSL connections. Some organisations are picky with non-sssl db connections. It is easier to handle all this if you leverage webspehere JNDI for DB connections.
Let me know if this helped.
Both WebSphere Traditional and WebSphere Liberty support Spring boot.
Are you looking for something like this?
http://www.adeveloperdiary.com/java/spring-boot/deploy-spring-boot-application-ibm-liberty-8-5/

Java Servlets + JDBC + Postgres: How does it all interact?

I'm having trouble wrapping my head around how to use servlets properly
I've set up a postgres database, and downloaded a JDBC driver for it.
What I want to have is my webpages post to the servlet, and the servlet get info from the database. I understand how to code everything (eg add library for driver, open connections, execute queries), but I think I'm lacking knowledge in how to set up the file structure.
I have the postgresql database running on pgAdmin. Do I also need to have a server running to make the servlets work as well? Can't I just make a web.xml file that maps to the servlets, and open the webpages to use the website? If I run the project through an IDE with a server running (glassfish) everything works. If I close the IDE and go to open the webpages on my browser again, I get 404's whenever I submit to a servlet.
Can someone give me a bit of guidance on the big picture of how everything is supposed to interact (with details on servers please). I've been searching the web and I havent found anything that explains the big picture very well.
Thanks
A Java web application is a set of files obeying a well-defined structure, and which can be packaged in a war file.
This web application is deployed into a server (also called container), which understands the file structure, listens to HTTP requests, and calls the appropriate servlet of the appropriate deployed web application when it receives one.
And of course, if you shut down the server, nothing listens to the HTTP requests anymore, so you won't get any response.
You could read the Java EE tutorial for more explanations.

How I can deploy my GWT application on www

I created my first Java EE application (GWT + Hibernate). I want deploy my application on a Tomcat web server.
Could you give me a step by step tutorial?
You can start with Google App Engine + GWT tutorial if you are trying out deploying into Google Cloud - https://developers.google.com/web-toolkit/doc/latest/tutorial/appengine
This question is massive so I will try to bring it down to some steps that need some research to implement.
1st. You created an application using GWT and Hibernate. That means that you need some kind of a web server that understands java and can re-write the logic from java to javascript (for the clientside), and also connect to the database on the serverside and retrieve the data for the client.
This web server is tomcat so what you need is:
A computer that will work as a server. This could be your own machine or some server you can buy as a hosting solution. Buying something like this requires research and effort on your part and cannot be explained here.
A version of Tomcat or Resin or any other web server that understands java
A domain name. These can be bought from sites like this one, but there are some free ones around the web. They require static ips that is you cannot use them from a home line that changes ips. Even without a domain name you can host your site on the server but you need to access it by writing the machine's ip instead. - optional - A temporary solution would be to use some kind of dynamic dns service on your router.
After having set up tomcat (you might want to give port 80 to tomcat) and the server you can host your application by uploading the war file. You can make a war file from gwt by following the instructions here
To upload the war file you can use the tomcat manager interface, or you can connect to the server and place it manually in the folder used for the web applications.
I know that each step propably needs as much if not more explanation by I hope I cleared the area a little bit here.

Deploying .ear file (contains rest services)

I have a few questions about deploying my .ear file (was provided to me, the file itself should not be the problem). I set up jBoss application server jboss-6.0.0.Final and was able to run a simple hello world app to ensure the server was functioning properly.
I was told to place the .ear file in /server/default/deploy so I did. When I ran jboss (through /bin/run.bat) I got no errors related to deploying the ear file.
Question
Is this all the software I need (jBoss)? Do I also need something like Apache or tomcat?
The .ear file contains RESTful service calls that should return xml. Will these be deployed (accessible through a jQuery ajax call after the server (jboss/bin/run.bat) is executed?
Currently when I try to make the calls, the resources do not seem to exist.
Thanks in advance for taking the time to help.
JBoss AS ships with an embedded Tomcat as a servlet container so you really don't need that anymore. Apache Web Server is NOT required for your .EAR to be deployed properly.
To answer your questions
No other software is needed to deploy the EAR. You simply copy your EAR file to deploy directory (which you have rightfully done so).
If your EAR contains RESTFul services, they will be deployed and you can access them using any client including jQuery or even a simple browsers. The trick is to know the access URL to the RESTFul services.
If you have difficulty identifying the URL for accessing your RESTFul services please refer [1] for more information.
Hope this helps.
Good luck!
[1] https://docs.jboss.org/author/display/AS7/JAX-RS+Reference+Guide
I can answer the first question. You need apache if you want to serve static content or you need to isolate the traffic (say keep apache in the dmz and then use apache to proxy traffic to the internal jboss servers). tomcat is bundled along with jboss, so you do not need it.