WebLogic doesn't loads class despite being on $domain/lib - java

I'm trying to add a AS400 jar to WebLogic classpath. I'm putting the jt400.jar inside $domain/lib/ as indicated by the readme.txt found in there. And when server starts I can see the line:
<Sep 14, 2017 7:12:28 PM CST> <Notice> <WebLogicServer> <BEA-000395> <The following extensions directory contents added to the end of the classpath:
{$domain}/lib/jt400.jar.>
But, when I'm testing my datasource stills throws the error message:
weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class com.ibm.as400.access.AS400JDBCDriver for datasource 'MyDataSource'
I have verified that the class is indeed inside the given jar.
What am I doing wrong?

Finally I understand what was happening. I forgot to add to the question that the WebLogic had several managed cluster servers. After trying various approachs, I realized the error only occured when I selected one of the clusters I wanted that datasource to serve.
So in the end, the servers from that cluster also need the jar to connect to the selected datasource.

Related

"Class Not Found: JDBC driver org.apache.derby.jdbc.EmbeddedDriver could not be loaded" despite having included required JARs in classpath

While following this tutorial, in order to test if everything is set up correctly, I ran the 'setup' Ant target from Eclipse. The following is the error message I got:
Buildfile: C:\Users\bingis_khan\eclipse-workspace\JDBCTutorial\build.xml
setup:
drop-tables:
[echo] C:\Users\bingis_khan\eclipse-workspace\JDBCTutorial\classes;C:\Users\bingis_khan\Downloads\db-derby-10.15.2.0-bin\db-derby-10.15.2.0-bin\lib\derby.jar;C:\Users\bingis_khan\eclipse-workspace\JDBCTutorial\lib\JDBCTutorial.jar;C:\apache\xalan-j_2_7_2\xalan.jar
BUILD FAILED
C:\Users\bingis_khan\eclipse-workspace\JDBCTutorial\build.xml:141: The following error occurred while executing this line:
C:\Users\bingis_khan\eclipse-workspace\JDBCTutorial\build.xml:84: Class Not Found: JDBC driver org.apache.derby.jdbc.EmbeddedDriver could not be loaded
Total time: 374 milliseconds
This [echo] here is set up to print the CLASSPATH. As the next section shows, the path(s) in classpath match the actual locations of these archives:
Directory of C:\Users\bingis_khan\Downloads\db-derby-10.15.2.0-bin\db-derby-10.15.2.0-bin\lib
04/20/2021 08:57 PM <DIR> .
04/20/2021 08:57 PM <DIR> ..
04/20/2021 08:57 PM 3,683,035 derby.jar
04/20/2021 08:57 PM 1,490 derby.war
04/20/2021 08:57 PM 601,103 derbyclient.jar
04/20/2021 08:57 PM 83,942 derbyLocale_cs.jar
04/20/2021 08:57 PM 99,882 derbyLocale_de_DE.jar
*snip*
What I've tried:
Experimented with changing backslashes to slashes and vice-versa.
Tried changing derby.jar to derbyclient.jar.
Just in case imported the archive (outside of Ant) to the Eclipse project.
None of the above methods worked (or even changed the output of "setup").
Where I've looked:
here - Poster did not add derby.jar to classpath.
also here - Different circumstances, but still applied the solution - nothing.
Some others, but most referred to runtime ClassNotFoundException. I haven't even gotten that far...
EDIT:
Also attaching the relevant Ant target:
<target name="drop-tables">
<echo>${toString:CLASSPATH}</echo>
<sql driver="${DB.DRIVER}" url="${DB.URL}" userid="${DB.USER}"
password="${DB.PASSWORD}" classpathref="CLASSPATH"
delimiter="${DB.DELIMITER}" autocommit="false" onerror="continue">
<transaction src="./sql/${DB.VENDOR}/drop-tables.sql"></transaction>
</sql>
</target>
verry important
Since you're using Derby 10.15, you have to also have derbytools.jar in your classpath for the embedded driver.
db-derby-10.15.2.0-bin\lib\derbytools.jar\org\apache\derby\jdbc\EmbeddedDriver.class
Use 7zip to analyse!
Since you're using Derby 10.15, you have to also have derbyshared.jar in your classpath for the embedded driver.
More information here: http://db.apache.org/derby/releases/release-10.15.1.3.cgi#Release%20Notes%20for%20Apache%20Derby%2010.15.1.3
In particular, note this part:
A new jar file (derbyshared.jar) has been added. All Derby configurations require it. In addition, the derbytools.jar library is now required when running the network server, when using Derby DataSources, and when directly referencing the JDBC drivers.

Spring-boot jar return whitelabel error when run on Linux

I have a problem with my spring-boot app, when I try to deploy and run the JAR on a Linux server it returns me a whiteLabel error whereas when I run it on my local windows computer it doesn't have any problem.
Below the error displayed in the web page (no error returned on the server side) :
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Jun 26 09:03:01 UTC 2019
There was an unexpected error (type=Not Found, status=404).
/WEB-INF/jsp/advisor/home.jsp
Controller method which returns the home page
#GetMapping("home")
public String getHomePage(){
return "/advisor/home";
}
Application.properties
logging.level.root=INFO
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
Project structure
I don't understand why the jar works fine on my local computer but can't find the views when run on the Linux server
Problem resolved, instead of a war I have generated a jar when I generate a war the problem resolved himself.

JBoss AS 5.1 JMS Queue NoInitialContextException

I am trying to learn about JMS Queue in JBoss, however I have run into an error. I am following the tutorial on this page: https://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/JMS_Examples-A_Point_To_Point_Example.html
I get an error on this line: Object tmp = iniCtx.lookup("ConnectionFactory")
Here's the full error:
Jul 7, 2016 3:10:23 PM com.cloudlet.jms.SendRecvClient main
INFO: Begin SendRecvClient, now = 1467918623762
Jul 7, 2016 3:10:23 PM com.cloudet.jms.SendRecvClient sendRecvAsync
INFO: Begin sendRecvAsync
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.cloudlet.jms.SendRecvClient.setupPointToPoint(SendRecvClient.java:49)
at com.cloudlet.jms.SendRecvClient.sendRecvAsync(SendRecvClient.java:67)
at com.cloudlet.jms.SendRecvClient.main(SendRecvClient.java:106)
Exception in thread "main" java.lang.NullPointerException
at com.cloudlet.jms.SendRecvClient.sendRecvAsync(SendRecvClient.java:71)
at com.cloudlet.jms.SendRecvClient.main(SendRecvClient.java:106)
My code is exactly the same as the one in the link provided. I looked it up and found out I need some jndi.properties file inside the JBoss folder. Unfortunately, that file is not in the JBoss folder. I looked up some examples on what it would look like but every example was different.
How would I fix this? Thanks in advance!
Fixed it by manually making a Properties object with the necessary key/value pairs then passing it to the InitialContext constructor.
JBoss properties:
Properties properties = new Properties();
properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.provider.url", "jnp://localhost:1099");
properties.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
InitialContext context = new InitialContext(properties);
I get the same output from the provided link in the opening post.

Exception starting AntiSamyFilter

I'm unable to run my group's web application on my local machine with the AntiSamy filter in place. The filter works on WebSphere on our development and production servers, and also runs fine on one of my colleagues' machine with what should be the same setup as mine, using Tomcat. However, on my machine and several other colleagues', if we try to start our server with AntiSamy filter in place, we get this error:
Oct 12, 2015 11:06:32 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter AntiSamyFilter
java.lang.IllegalStateException: java.io.FileNotFoundException: C:\Users\myUsername\Documents\myWorkspaceDirectory.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\mobile3\WEB-INF\classes\antisamy-default.xml (The system cannot find the path specified)
I've looked in the directory cited, and there is an "antisamy-default.xml" file there, so I'm not sure where to begin to figure out what's causing the error.
Any help will be much appreciated!

Hbase calling HTable hangs

There is sample java code for Hbase connectivity program which is the famous "HbaseTest" class sample, which is available in the internet for long time.
I have compiled the code in my server and compiling was successful. When i run my Java class file, i am able to see that it is getting hanged in the particular line. "HTable table = new HTable(conf, tableName);"
It throws the below alert when running.
Jun 18, 2015 12:16:14 PM org.apache.hadoop.util.NativeCodeLoader WARNING: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Jun 18, 2015 12:16:15 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper INFO: The identifier of this process is pid#servername
I have identified it has stuck in that particular lines by giving Print statements.
Please do let me know what to do for the same. I have checked that the Hbase is running properly.
Kindly share your thoughts and idea's.
#hive #hbase #hadoop
Thanks in Advance Sam
I had a similar problem before it was network issues. Try setting retry and timeout parameters, e.g.
hbase.client.retries.number=2
zookeeper.session.timeout=2000
zookeeper.recovery.retry=0
hbase.rpc.timeout=100
ipc.socket.timeout=100
hbase.client.pause=100
zookeeper.recovery.retry.intervalmill=100
timeout=100
You may need to modify your network settings according to the errors that are thrown.

Categories

Resources