Centos 7 apache httpd can not load weblogic plug library - java

This is a practices that configure httpd service by adding weblogic apache plugin to support apache frontage to route traffic. This process is fellowing Puneeth Prakash's Oracle blog:
https://blogs.oracle.com/blogbypuneeth/configuring-wls-web-server-proxy-plug-in-for-apache-http-server-v2
Working environment as: Centos 7, apache 2.4.29.
I first tried install weblogic apache plugin for 12c (WLSPlugins12c-12.1.2), There are four libs in the lib directory, two modules for httpd and other two dynamic shared libs. Unfortunately, this version not work properly on ajax request, some time make session invalid.
Next I tried newer version as: WLSPlugin12.2.1.2.0. There are seven files in lib directory, two files for module libs and others 5 as shared dynamic load libs. I tried to put all files in lib directory into /usr/local/lib and change the owner to root:root, change mode to 755 for all files and then put a line in config file 00-base.conf in /etc/httpd/conf.modules.d directory. such as: "LoadModule weblogic_module /usr/local/lib/mod_wl_24.so" system load mod_wl_24.so properly, but not load dependency libopmnsecure.so, error as:
"Jan 06 16:22:49 centos.mywebsite.com.au httpd[4001]: httpd: Syntax error on line 58 of /etc/httpd/conf/httpd.conf: Syntax error on line 67 of /etc/httpd/conf.modules.d/00-base.conf: Cannot load /usr/local/lib/mod_wl_24.so into server: libopmnsecure.so: cannot open shared object file: No such file or directory"
From the error message we can see, mod_wl_24 is trying load dependent Dynamic lib libopmnsecure.so, but not found it in place. But, it is not true, libopmnsecure.so just seating in same directory with mod_wl_24.so. As Puneeth Prakash's Oracle blog required.
I had set up all related environment variables as well, that include APACHE_HOME, JAVA_HOME, PLUGIN_HOME,LD_LIBRARY_PATH.
If some one had an idea, please advise!

You need to add the specific path in LD_LIBRARY_PATH and make sure it is loaded when httpd starts.
I know you say you have, but double check, because that's exactly what the error is saying (that you haven't).
Apache httpd by default uses a file for environment variables that need to be set before starting apache httpd with its script "apachectl"
Here is the typical envvars file where we set it:
if test "x$LD_LIBRARY_PATH" != "x" ; then
LD_LIBRARY_PATH="/path/to/httpd/lib:/path/to/httpd/weblogic-module/lib:$LD_LIBRARY_PATH"
else
LD_LIBRARY_PATH="/path/to/httpd/lib:/path/to/httpd/weblogic-module/lib"
fi
export LD_LIBRARY_PATH
By the way, you don't need all files for httpd to start just these:
libdms2.so
libonssys.so
libopmnsecure.so
and obviously the module: mod_wl_24.so
Edit: Note this requirement/dependency of other libraries is new for these newer versions of the weblogic module, in earlier versions it wasn't necessary.
Update:
This issue was fixed by following steps:
Remove yum installed httpd service from system.
Download & Install weblogic apache plugins 12.2.1.2 from Oracle in customer location.
Following https://blacksaildivision.com/how-to-install-apache-httpd-on-centos to build apache 2.4.29 from source in CentOS 7
Please note: When run ./configure in apache build process, use parameter as:
--libdir=/usr/local/WLSPlugins12c-12.2.1.2/lib point to your weblogic plugin lib location
After apache was built and installed in your CentOS, setup httpd.service to be controlled by systemctl
Reconfigure apache and restart it.
it will works for you.

This issue was fixed by following steps:
1. Remove yum installed httpd service from system.
2. Download & Install weblogic apache plugins 12.2.1.2 from Oracle in customer location.
3. Following https://blacksaildivision.com/how-to-install-apache-httpd-on-centos to build apache 2.4.29 from source in CentOS 7
4. Please note: When run ./configure in apache build process, use parameter as: --libdir=/usr/local/WLSPlugins12c-12.2.1.2/lib point to your weblogic plugin lib location
5. After apache was built and installed in your CentOS, setup httpd.service to be controlled by systemctl
6. Reconfigure apache and restart it.
it will works for you.

Related

Tomcat running on Intellij doesn't seem to find the right path to JAVA

Introduction
I've been assigned to an old Java Facets application, and in order to do my work I have to do a reverse ingeneering task first, hence running the project on my machine.
Problem
So the project seems to build fine and it's supposed to run on a Tomcat 7 server but it's been 3 days now and i've tried pratically everything I could think of to fix this single output :
/home//.jdks/temurin-17.0.3/bin/java -Dfile.encoding=UTF-8 -classpath /tmp/classpath1653361017.jar com.intellij.javaee.oss.process.JavaeeProcess 40057 org.jetbrains.idea.tomcat.agent.TomEEAgent
/home//apache-tomee-plume-7.0.9/bin/catalina.sh run
[2022-05-11 09:49:54,280] Artifact MyProject:war exploded: Waiting for server connection to start artifact deployment...
/home/azesa/apache-tomee-plume-7.0.9/bin/catalina.sh: line 427: /var/lib/snapd/snap/intellij-idea-ultimate/353/bin/java: No such file or directory
Disconnected from server
Stuff I tried
I tried to manually configure the catalina.sh but ended up breaking it.
I changed the /etc/profile file and added two export statements one of the JAVA_HOME and the other for the CATALINA_HOME
I have also copied the WAR file in the /webapps directory trying to run doirectly, but it's too messy and it oesn't seem to work
Please HELP
To run TomEE 7, you need to use Java 7 or Java 8.
Your log indicate, that you try to run with Java 17, which won't work. Java 17 ist only supported in TomEE 8.0.11 (Jakarta EE 8) or TomEE 9.0.0+M8-SNAPSHOT (Jakarta EE 9.1).
In addition, it looks like your Environment variables (JAVA_HOME) point to a non existing Java executable.

Issue with com.ibm.mq.jar

I am using IBM MQ as client to put/get messages .
when trying to create MQMessage reqMsg= new MQMessage() getting below exception
java.lang.NoClassDefFoundError: Could not initialize class com.ibm.mq.internal.MQCommonServices
But com.ibm.mq.jar is available inside my war.The same code is working in my windows machine but not working in linux(smoke) server.This will happen often but when i replace the existing mq jar with new one it used to start working again. But this time no luck.
Below some key points may help to figure out the issue.
1)we manually uploaded jars into artifact with version 7.1.0.6 since the server is running with same version and hence client side also need to have same version of jar.
But when i did java -jar com.ibm.mq.jar it shows as below
Name: WebSphere MQ classes for Java
Version: 8.0.0.5
Level: p800-005-160516.2
Build Type: Production
2) i have below jars with version 7.1.0.6 in my war to put/get messages from/to server.
com.ibm.mq.allclient
com.ibm.mq.axis2
com.ibm.mq.commonservices
com.ibm.mq.headers
com.ibm.mq
com.ibm.mq.jmqi
com.ibm.mq.jms.Nojndi
com.ibm.mq.pcf
com.ibm.mq.soap
com.ibm.mq.tools.ras
com.ibm.mq.traceControl
com.ibm.mqjms
3) i am using jdk 1.8.
Any help is greatly appreciated.
com.ibm.mq.allclient.jar did not exist prior to IBM MQ v8, so it can not be from a v7.1.0.6 install.
Check the MANIFEST.MF file in each jar to check what version of IBM MQ it is from.
On linux you can use this following command, replace the jar name with each jar.
unzip -p com.ibm.mq.jar META-INF/MANIFEST.MF|grep Implementation-Version
The error you are receiving is likely because of a mis-match between jar versions. Validate that all jar files are from the SAME version of IBM MQ.

Why doesn't my JBoss AS bin directory contain a run.sh script?

I am running Ubuntu 16.04 and I need to install and run Restcomm JSS7 stack as a JBoss AS Service.
I followed this video tutorial to install JBoss AS 7. Then I set the JBOSS_HOME environment variable to installation directory of JBoss AS 7. As a result, I was able to start the JBoss AS successfully by executing ./run.sh in the bin sub-folder of the installation directory.
Then I followed this guide to install Restcomm JSS7 stack. For that, I downloaded restcomm-jss7-7.4.1404.zip, unzipped it to /opt/ and then navigated to the ss7-jboss sub-directory and then executed ant deploy,
and the result was
...
BUILD SUCCESSFUL
which according to the guide is an indication of the service deployed successfully.
Then I am following CHAPTER 4 SECTION 4.1 of this user manual to run it as a JBoss AS Service. According to it,
All you have to do to start the Service is start the JBoss AS. This
will automatically start the SS7 Service. To start the JBoss Server
you must execute the run.sh (Unix) or run.bat (Microsoft Windows)
startup script in the /bin folder (on Unix or
Windows).
TWO PROBLEMS:
My <jboss_install_directory>/bin does NOT have a run.sh script. Because of this reason, I tried by running JBoss AS by using the regular standalone.sh script.
Next in the user manual, it is stated:
Result: If the service started properly you should see following lines
in the Unix terminal or Command Prompt depending on your environment:
(Note: I have pasted the following excerpt from user manual here, since it is too long to paste in this question.)
But I see none of those lines in my terminal. Rather, my terminal output of running ./standalone.sh is pasted here.
So I don't know how and where to proceed from here. Please help.
NOTE: This question is NOT a duplicate of my other question. Like I mentioned in the question titles, this question is about why my JBoss AS installation doesn't contain a run.sh script, and what would be its alternative. The other question is about some possible command to find out the JBoss Services started when it is running? When a beginner is starting to learn something, their entire purpose Not getting the job done. They have many confusions/questions in their mind.
The documentation documents how to start a JBoss 5.1 server but your installation uses a JBoss 7.1 server, which is why you have to use standalone.sh instead of run.sh to start the server and why the logs are different.
Since you correctly reach the JBoss AS 7.1.0.Final "Thunder" started in 3955ms line I wouldn't worry too much (except about using a documentation that is clearly outdated).
The documentation of your product only declares compatibility with JBoss 5.1.0. While it may work on later releases, you might want to check if there's a more recent version of your product. I wouldn't recommend installing JBoss AS 5.1.0 as it isn't supported anymore and will contain security breaches.

Trouble starting tomcatv7 via Eclipse Kepler

I see that problems like mine have been posted before, some of which posts were answered. I've attempted the fixes, which indeed seem like they should have worked, but I'm still running into the same problem:
I'm trying to run a dynamic web project in Eclipse Kepler (Java EE) via apache tomcat 7.0.53 on my localhost. I've created tomcat as a server in Eclipse, and copied the config files from /tomcat/7.0.53/libexec/conf into /workspace/Servers/Tomcat v7.0 Server at localhost-config, and changed the permissions on the files so that they are all readable and writeable.
However, when I try to start the tomcat server in eclipse, I get this error:
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete.
In case it's helpful, it's all being run in mac osx 10.6.8, on a 64-bit machine.
Thanks in advance for your help.
I am facing this issue. I have fixed as following way,
Step 1: Delete server at local host(Server tab)
Step 2: Delete Servers folder in (navigator/project explorer)
Step 3: After add New->server->Apache->choose path
Step 4: start the server
After it will work......
How to solve:
1.Close Eclipse
2.Copy all files from TOMCAT_7_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v7.0.53 Server at localhost-config
3.Start Eclipse
4.Expand the Servers project, click on the Tomcat 7 project and hit F5
5.Start Tomcat from Eclipse
Go to Server --> Apache Tomcat v7.0 --> Add
Select jre7 instead of Workbench default JRE
Click on Finish
Stop Server and then Start Server
This is a permissions problem (I had the same issue in ubuntu 14.04, eclipse luna, tomcat7). The executable files are not marked as "executable" when tomcat is donwloaded from eclipse.
Just go to your "[tomcat]/bin" directory in your file system and add execution permission (x) to all .sh files. Then go back to eclipse/servers tab, delete the tomcat7 entry an create again, finally start tomcat from eclipse.
This same problem happened to me before then i got solution for config load error:
it can be solved Right click on Project-> Build Path-> Configure Build Path->go Library tab-> Add External Jar-> browse (Apache TomCat Folder->lib->and add servlet-api.jar) add click ok. it run fine for me.
Unfortunately, this is not much of an answer. I finally never got this working with eclipse Kepler. However, when I installed linux mint on my computer, and used its software installer to install linux 3.8 (indigo), added all the EE updates (all the web/xml additions via help-->install new software-->indigo update site), installed tomcat 7.0, I finally got eclipse to play nice with tomcat (that is, I can run the webapp on tomcat from eclipse, without copy/pasting all the requisite files into tomcat, which is saving me a boatload of time).
I'm sure there is a better way to do this - if anyone has any thoughts about what may have gone wrong in my initial environment, please advise - I'm curious why it didn't work. Here were the specs:
MacOS 10.6.8
Eclipse 4.3.2
Tomcat 7.0.54
My apologies, Raju, for not responding sooner. Thanks for your post.
How to solve:
Close Eclipse
Copy all files from TOMCAT_7_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v7.0 Server at localhost-config
Start Eclipse
Expand the Servers project, click on the Tomcat 7 project and hit F5
Start Tomcat from Eclipse
I found that this is a good old fashion directory naming convention problem. I'm running Linux Ubuntu and noticed that right under {your work space}/Servers there appeared a strange error type file when I opened it had all kinds of chunks of the crazy long directory name "Tomcat 7.0 Server... bla bla" So I deleted the Server, then made use of this little ditty cause my version also won't let me re-add the server again:
1. Close Eclipse
2. In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings delete the following two files:
org.eclipse.wst.server.core.prefs
org.eclipse.jst.server.tomcat.core.prefs
3. Restart Eclipse
Then I re-added the server using a friendlier server name without any crazy spaces or chars: Tomcat7ServerAtLocalHost
The wella... it started with a brand new error for me to debug... which means I'm on the right track... BTW, the new error is: "Cannot publish to the server because it is missing its runtime environment."
So I'm off to debug that mess... Cheers!
This problem is mostly associated with file permissions. So the best way to solve the problem is to install a local copy of Tomcat on your development machine instead of putting Tomcat in a system directory such as /usr/share/tomcat7. This way all Tomcat conf files belong to the user and user group so that it can be run from Eclipse by the user. I normally place Tomcat at my local folder such as /home/abc/dev and it works perfectly with Eclipse development environment.
For me the only solution that works is this solution suggested here:
Could not load the Tomcat server configuration
cd /usr/share/tomcat7
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /var/log/tomcat7 log
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo chmod -R a+rwx /usr/share/tomcat7/conf

Where do I locate Java Servlet container

I have installed JRE and now I'm trying to install Solr by following the Solr Reference Guide.
The guide dictates:
Stop your Java servlet container.
Copy the solr.war file from the Solr distribution to the webapps directory of your servlet container...
Start your servlet container, passing to it the location of your Solr Home in one of these ways:
Set the Java system property solr.solr.home to your Solr
Home. (for example, using the example jetty setup: java
-Dsolr.solr.home=/some/dir -jar start.jar). Configure the servlet container so that a JNDI lookup of java:comp/env/solr/home by
the Solr webapp will point to your Solr Home. Start the
servlet container in the directory containing ./solr: the default Solr
Home is solr under the JVM's current working directory
($CWD/solr).
Questions:
Where do I find this Java Servlet container?
Where/how do I execute those commands to start/stop/configure the Java Servlet container?
How do I set Java system properties?
Mine was quite straight forward. After downloading the file, I extracted it to a folder on my Server. I used the Command Line to complete the installation.
With the Command line, navigate to the example folder inside the solr-X.XX.X folder you extracted the file to, once there run the java command:
cd C:/<folder>/app/solr-X.XX.X/example
java -jar start.jar
It would perform the installation for you, like magic.
You can access SOLR by visiting localhost:8983/solr
I'm using a Windows Server though, it may be different on yours, but I guess the logic is the same.
You should to install Apache Tomcat. All information about these servers you can find here.
You also could to install Jetty, JBoss, vSphere, tc vFabric Server ... but I think that you'll setup tomcat and solr easier (it is mine personal opinion, if you are familiar with any one, use them of course).
Tomcat setup is described here.

Categories

Resources