Deploying file to WebLogic - Error: Unresolved Webapp Library references - weblogic

I received this error on deploying the file to WebLogic.
Should I make any alteration to the Weblogic.xml file?
Error: Unresolved Webapp Library references for "ServletContext#8793091[app:casman-jsf-3 module:casman-jsf-3.5-SNAPSHOT.war path: spec-version:2.5]", defined in weblogic.xml [Extension-Name: jstl, Specification-Version: 1.1, exact-match: true], [Extension-Name: jsf-myfaces, Specification-Version: 1.1, exact-match: true]

To fix this, I had to take the following steps (I am developing using Eclipse and deploying to Weblogic 10.3.5):
REMOVE weblogic.xml from the /WebContent/WEB-INF/ directory
Add needed jars to your lib directory (/WEB-INF/lib/) including JSTL.jar
Add project libraries to your Deployment Descriptor
Install EAR or WAR to Weblogic
This resolved the issue.

the error is because some library referenced in the Weblogic.xml is not being accessed during deployment.
try to call all the referencing libraries through run (Windows OS). Like if you have some reference to a library called \systemlib\alllibs\lib1.jar, then go to run and try calling in the library file or see manually if you can access the file in the server.
If the file is present then for unix/linux server, check if there are no access rights issue on the system. like if the library was placed by the root user and the weblogic user(Application server) does not have rights to read or write on the library folder. Remove any such issues.
Lastly, since the error specifically says JSTL, therefore check if the JRE version and JSTL version are in sync.
If still the error is not resolved, then please share the weblogic.xml also

Do a deep search of "jsf" in your wlServer\common\deployable-libraries folder .
Find the library corresponding to that extension and install it into your server.
Re-deploye the application
It worked for me

Related

Weblogic server - Getting NoClassDeffError for TIFFImageReader even when the library is in classpath

I am working on TIFF to JPEG conversion program. I am using the TIFF implementation from jai-imageio-core.1.3.1.jar, which is available in the classpath.
Everything works fine in my local environment in eclipse (running on tomcat server). However, when I deploy the same in Weblogic, I am getting the following error. Weblogic server is unable to recognize the TIFF implementation classes. I am unable to find the missing link. Please help.
java.lang.NoClassDefFoundError: com/github/jaiimageio/impl/plugins/tiff/TIFFImageReader
at com.github.jaiimageio.impl.plugins.tiff.TIFFImageReaderSpi.createReaderInstance(TIFFImageReaderSpi.java:118)
at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:529)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:513)
at javax.imageio.ImageIO.read(ImageIO.java:1443)
at javax.imageio.ImageIO.read(ImageIO.java:1308)
I will answer my own question. The issue is resolved. The problem was with the the jai-imageio-core.1.3.1.jar file present in multiple places. It was present in my application war file in WEB-INF/lib folder. however, the same jar file was also present outside the war in the weblogic adm root directory. (my bad)
I guess weblogic clearly expects the jar file only in 1 place (especially java SPI implementation jar)
It is also a good idea to search all directories under weblogic to make sure there are no additional jar files of the same name.
I had only one jai-imageio-core.1.3.1.jar file (in WAR file) and caught this error. Weblogic managed server restart helped me.

How to load a dll in Karaf container?

I have a dll which provides a simple functionality (called HelloCpp.dll) and
I need to access to the content of this library from Karaf container via REST calls.
I created a simple maven bundle which provides the REST api and a class (HelloJNI) which loads HelloCpp.dll using: System.loadLibrary("HelloCpp");
I have also addressed this dll in my POM file using: <Bundle-NativeCode>HelloCpp.dll</Bundle-NativeCode>
I have coppied the dll in both project directory and also karaf/lib folder.
I can successfuly install the bundle and I don't receive any compilation error as well, but when I deploy my bundle into Karaf container and try to start bundle, I get this error message: No matching native libraries found.
Could you please help me to solve the problem? Maybe I don't address the dll correctly in the POM file.
Thanks in advance,
Mandana

mule anypoint studio class not found exception

If I run the application in server, which is working fine, but If i run application in anypoint studio doesn't run. Here is the error message for loading oracle driver.
error message:
2015-02-04 11:18:34 WARN DriverManagerDataSource:107 - Could not load driverClass oracle.jdbc.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
I have placed all jdbc and other jars under studio->project->properties->libraries.
This is caused by the Studio's classloading policies. The workaround is to copy the JDBC Driver .jar to ${studio.home}/plugins/org.mule.tooling.server.${mule.version}.ee_${mule.version}.${release.date}/mule/lib/user
Hi there actually that's kind of a hack :P though it works.
The more proper way to deal with this is, when coding your application (that's why one should use Mule Studio), to place the jars like drivers in a particular folder, like a /lib in the root of you project.
Then add these jars to the classpath.
I know what you did is the way it should be done when running on Mule stand alone in order to share such jars but try this one if you can ;)
I was also facing the same problem. As the application runtime fails to locate the jdbc driver jar in classpath So It is unable to load the same.
the simple and easiest way to handle this error is just put your lib folder containing the ojdbc jar file inside the app resource (src/main/app) of the project. During the building of project it will automatically be place in classpath.
I have tried the same approach and It works for me.
Hope this helps.
The way I fixed the problem was removing the .classpath / .project files from my project root folder. I re-imported the project and then I saw a bin folder created. I removed this bin folder then right-click on the project -> Refresh and then Run As -> Mule Application.

Glassfishv3 not adding jars in ear to the classpath

I have been working on this problem for one whole day but in vain without any effective solution.
I have an ear file packaged with an ejb and a handful of jar files (including hibernate and the other dependent jar files).The ejb is stateless and enabled as a web service.
The ear file has been packaged using maven and has the below structure
ear->projectrelatedejb.jar
->hibernate.jar
->otherdependent. jar
->META-INF/application.xml
->META-INF/manifest.mf
The application.xml and manifest file are automatically generated by maven when I do a package.
When I deploy this ear file on glassfish it gets deployed with the ejb methods being accessible using web services. However when accessing the application (using soapui),
the ejb methods that perform some database functionality using hibernate throw java.lang.NoClassDefFoundError for the hibernate api during runtime.
It is obvious from the error that the hibernate jars are not on the classpath during runtime but since the jars are within the ear Glassfish should have
added it to the application classpath.
I tried various options like adding the classpath entries to the manifest.mf during the package (by using the element addClasspath with the maven-ear-plugin) which didn't do any good.Also with Glassfish we cannot add the dependent jars as modules to the application.xml unless the jars are application client jars
(Glassfish wouldn't deploy the ear file if the application.xml has the dependent jars declared as modules).
I also tried placing the jars in the lib directory within the ear (which isn't actually required) and with the manifest Class-Path header referencing the jars in the lib directory which also didn't fix the problem.
The quick and dirty fix which I can do to get this working is to place the hibernate and the other the dependent jars in Glassfish's lib directory.However,this is a bad practice
and I am somewhat reluctant to do it.
I would really appreciate if someone can provide me with a working solution to this problem.I have gone through the net looking for this problem
but couldn't find any solution.
Wondering if its a bug with glassfish or does glassfish need something special to reference the jars in an ear.
Thanks in advance.
I found a similar problem which is discussed here: http://www.tricoder.net/blog/?p=59.
Simply put, try putting the libraries in EAR/lib directory and according to JEE5 spec, glassfish will add them to class path automatically.
I used Server Library option to deploy application JARs and it worked for me.
Right click on your EAR-> Properties -> Libraries-> Add Library -> Create -> give name and change type in Library Type to Server Libraries then add JARs that should be deployed and confirm.
I work with NetBeans 7.0.1 and GlassFish server 3.1
When you say you added classpath entries to manifest.mf, which manifest.mf do you refer to? The one in ear-root/META-INF/manifest.mf ? Try adding a META-INF/MANIFEST.MF to your ejb module with Class-Path entries!

Apache Felix Bundle Repository - Calling from another bundle

I have a simple test program which is designed to consume the Apache Felix Bundle Repository bundle service however I am having trouble configuring it through eclipse.
I am using the jar for the bundle (org.apache.felix.bundlerepository-1.4.0.jar) as an referenced library and have added it to the classpath in the manifest.
When I try to start my bundle it gives the error:
java.lang.ClassCastException: org.apache.felix.bundlerepository.RepositoryAdminImpl cannot be cast to org.apache.felix.bundlerepository.RepositoryAdmin
I can't add org.osgi.service.obr to the list of imported packages in my bundle (as it doesnt resolve) and I think this is the reason for the issue.
Any ideas?
Thanks
This was resolved by including the Apache Felix Bundle Repository bundle (org.apache.felix.bundlerepository-1.4.0.jar) in the eclipse/plugins folder which allowed me to reference the org.osgi.service.obr package in the list of imported packages in the manifest.