How to create separate log file for each server instance running in the jboss domain mode - jboss

I'm using jboss 7.2,and I created a log4j2.xml and placed in the server, application running in the domain mode there are two server instance in each ip, application logs are printing only for one server instance and another server instance logs are not printing,how to print the both server instance logs are in separate files.
Is anyone having idea pls help on this.

Sorry....you cannot use log4j2 in JBoss7.2.
Only WildFly 22 supports Log4j2 out of the box.
However, you may implement Log4j2 to other versions of WildFly, according to this tutorial. However I did not try myself.

Related

How to find port number of a Spring Boot app?

How do I find the port number of my SpringBoot app so I can call it? I already tried setting -Dserver.port=8080 and--server.port=8080 in VM arguments and in src/main/resources/application.properties.
If I try to go to localhost:8080 Chrome says refused to connect. I simply want to be able to connect to my App don't know why Spring Boot made finding which port is being used so challenging.
I'm using Eclipse and the app appears to be running properly from the logs.
This simply printed 0:
#Value("${local.server.port}")
int port;
I've tried these answers none work:
Spring Boot - How to get the running port
Spring boot - how to get running port and ip address How to configure port for a Spring Boot application How to configure port for a Spring Boot application
localhost:<your port> may not respond at all. Make sure you're hitting an endpoint you know is availible like localhost:8080/info. Make sure your app has completly started, it could take serveral minutes.
As #BrianC mentioned make sure your app is actually a web server.
in your springboot main method use below code to detect port of your application
Environment environment =app.run(args).getEnvironment();
System.out.println(environment.getProprty("server.port");
this will tell you actual port where your aplication running .
Value can be found using Spring’s Environment as it represents the environment in which the current application is running.
It can also be used to find other properties in applications like profiles.
#Autowired Environment environment;
String port = environment. getProperty("local.server.port");

Error creating an Application Server connection in JDeveloper

Background
I am using the Oracle JDeveloper Studio with SOA installed as my IDE. In JDeveloper I want to create a connection to a remote Weblogic server.
The remote server is running on my local machine, and I refer to it as remote to distinguish it from the Integrated Weblogic Server that comes with JDeveloper.
After reading this answer I attempted to add the following lines to the Windows 10 host file:
#
127.0.0.10 localhost2
::1 localhost2
These two pictures show the Application Server setup in JDeveloper: Picture 1, Picture 2
However I still receive the following error:
Server excetion is :
Connection refused from server
When create new server on random port such as 7013 and 7014 for ssl, test connection return:
Testing HTTP Authentication ... failed
Connection refused: connect
Testing JSR-160 Runtime ... failed
Cannot establish connection.
Testing JSR-160 DomainRuntime ... skipped
Testing JSR-88 ... skipped
Testing JSR-88-LOCAL ... skipped
Testing Server MBeans Model ... skipped
Testing App Controller ... skipped
Testing JSR-88-DEP-MGR ... skipped
Testing JSR-88-DEP-MGR-LOCAL ... skipped
Testing JNDI ... skipped
Testing JSR-160 Edit ... skipped
Testing HTTP ... failed
Connection refused: connect
0 of 12 tests successful.
Can anyone suggest some troubleshooting steps here?
Clarification
I need to clarify a few points to guide you to the correct answer.
Are you sure this is a separate Weblogic server running on localhost, not the Integrated Weblogic Server?
Are you sure the Integrated Weblogic server is not running?
Are you sure the Weblogic server you are attempting to connect to is running?
Troubleshooting
General Recommendations
Always run JDeveloper as Administrator
Located an utilize the *-diagnostic.log file and the standard out file
Utilize the JPS utility to see if the WLS process is running
Utilize the EM console to see what interface your server is listening on
Integrated Weblogic or Standalone Weblogic
Firstly, because you are new to Oracle SOA I need you to clarify if you have a Weblogic server installed locally separate from your Oracle BPM Studio ( JDeveloper ) IDE.
When creating a local SOA environment, JDeveloper comes with an Integrated Weblogic Server pre-installed. You don't need to install the Weblogic server separately.
To determine if you have a standalone Weblogic server installed on your local machine you could do a few things.
Do a search for startWebLogic.cmd. If that file is somewhere other than beneath %APPDATA% you likely have a standalone server
Secondly, with 11g ( maybe 12c ) you can check Add or Remove Programs to see if the installation is listed
You could also check to see if it's running by running a jps command in command prompt. This shows all Java processes currently running, and your Weblogic server runs as as a Java process. It will look something like the following
If you see a suspicious process you can run a jinfo <pid> to get more information about the process
You can also check Windows Services to see if you have a Weblogic service.
Most likely you don't even have a local Weblogic installed separate from JDeveloper's Integrated Server. In that case, please read the following section.
Integrated Weblogic Server
As stated before when you download Oracle BPM Studio ( JDeveloper with all the SOA plugins ) it comes with an Integrated server.
You first need to create a default domain and connection to this server.
First, open the Application Server panel.
You should now see the Application Server panel to the left side of your IDE
Remember, generally you are not installing the server here, you are just connecting to a server that is already installed from your IDE. The purpose being that you can deploy composites directly to the server from JDeveloper. Configuring the Integrated Server is a bit different, but the difference doesn't need to be explained here.
Right click on "Application Servers" and click New Application Server. This will display the following popup
Now walk through the steps of creating the default domain and server connection
Then test and finish. You should not have an integrated weblogic server running. To start the server you simply run -> Start Integrated Weblogic Server
If you Windows -> log you can see the server stdout and stderr rolling.
On windows you can also find these logs on Windows 10 by navigating to %APPDATA%\Roaming\JDeveloper\system12.2.1.3.42.170820.0914\DefaultDomain\servers\DefaultServer\logs in your system's file explorer.
Standalone Server
If for whatever reason you aren't using the Integrated Weblogic Server and instead have a standalone installation of Weblogic on your local machine you would first need to find where your Middleware Home directory is.
The environment variable is MW_HOME or ORACLE_HOME
Navigate to that directory and run startWeblogic.cmd. Then tail the out file to see if if it starts successful. From there, the process of creating a connection to the server in JDeveloper is no different than the steps listed above, except that you want to select "standalone" not "integrated".
Final Thoughts
If you want to create the Integrated Server and have already failed several times I would try the following
Stop the Integrated Server (if its running) and delete the default domain
Starting the server again (see above) will recreate the domain.
If that doesn't work delete the entire server connection and recreate. You may also want to delete the DefaultDomain folder in your %APPDATA%\JDeveloper folder

jboss 7 as- unable to see jboss sample site or admin interface even after jboss has started

I am a newbie to working with jboss 7 as- I recently set it up on my server, and am able to start it as well.
However after starting it, when I access
http://IP_ADDRESS:8080
or
http://IP_ADDRESS:9990
Google Chrome gives an error that the page is unavailable.
How can such access be enabled? Also, I am using the startup-shutdown script for /etc/init.d as provided with jboss, do I have to modify the startup and shutdown commands in it, for enabling remote web access to the server interface?
Have you tried http://localhost:8080? If you're using the IP address of your PC it's probably the firewall that is blocking the access to it.

tomcat and eclipse: starting server

in my system i am using eclipse and tomcat server. I hav 3 different versions of tomcat servers.
But i am trying to run only one server at a time. But by default Already one server is running on port number 8080. When i am trying to start the tomcat server in 8081 port, the tomcat server is not getting start.
I have configured my tomcat home, and server.xml in eclipse properly. But I don't know what I am missing. please guide me.
It sounds like you don't have your port numbers defined and each tomcat instance is fighting to grab the port range first before the others.
Check your config file to make sure the port numbers are specified for each instance.
see how to change port in y=tomcat , may be you forgot to change some where
http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/
you can stop another tomcat service before you start your tomcat gets started , end process tomcatX(X is version) from task-manager

Can't run a Servlet with Tomcat because something is using the ports

I'm trying to write a Servlet in eclipse configured to use Tomcat 5.5 and I get the following error when I try to run it:
Several ports (8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s)
As far as I know, Tomcat 5.5 is the one using port 8080, and when I go to http://localhost:8080 I do get the Tomcat success page, so it looks like eclipse tries to run another instance of Tomcat without shutting down the original and fails. How do I solve this?
like it says, something is using the port.
there are two solutions for your problem.
identify (on windows with netstat command) what is using the port (e.g. skype, ...) and stop it
change the port of your tomcat runtime in eclipse -> http://techteam.wordpress.com/2009/02/13/changing-the-tomcat-port-settings-in-eclipse/
hope this helps