Summary of issues in deploying SSH projects to WebLogic

Source: Internet
Author: User

Deploying to WebLogic is still laborious, but basically the problem is caused by the ClassLoader order.

First add the Weblogic.xml file under Web-inf below

[HTML]View Plaincopy print?
  1. <? XML version= "1.0" encoding="UTF-8"?>
  2. <Weblogic-web-app
  3. xmlns="Http://www.bea.com/ns/weblogic/weblogic-web-app"
  4. xmlns:xsi="Http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemalocation="Http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/ Weblogic-web-app/1.0/weblogic-web-app.xsd ">
  6. <container-descriptor>
  7. <index-directory-enabled>true</index-directory-enabled>
  8. <!--key!!! Load the jar package under Web-inf first--
  9. <prefer-web-inf-classes>true</prefer-web-inf-classes>
  10. <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
  11. </container-descriptor>
  12. </Weblogic-web-app>


The main is to ensure that the jar packages in the project are loaded first, to prevent jar package conflicts in the project jar and WebLogic, to load the absolute path, and to ensure classpath execution in the spring configuration file.

Add Antlr-2.7.6.jar package to WebLogic

Prevention of errors: when making inquiries, quote Org.hibernate.QueryException:ClassNotFoundException:org.hibernate.hql.ast.HqlToken this Errors (which are connected through a data source)

1.Could not load user defined filter in Web.xml:org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter .

2.No Bean named ' sessionfactory ' is defined

The problem occurs because the Web. XML in WebLogic does not support wildcard notation, such as:

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>classpath:applicationContext*.xml</param-value>

</context-param>

Workaround:

Switch

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext-common.xml</param-value>
</context-param>

Write a directory full, wildcard not supported

3. Post-deployment error Java.lang.ClassCastException:weblogic.xml.jaxp.RegistrySAXTransformerFactory cannot be cast to Javax.xml.transform.TransformerFactory

There are several ways of saying this, a foreigner's post says, to remove the jar package of XML parsing

* Xercesimpl-2.9.1.jar

* Xml-apis-1.3.04.jar
* Xmlparserapis-2.0.2.jar

Also found a post http://hi.baidu.com/zhoushugen/blog/item/27e1caf71bbc0024730eecdc.html said that Download the latest Xalan package to the Apache website to replace some of the packages below your lib.

I solved it using the second method.

    • DBCP error, this problem is silly, a start with Tomcat in the run, so the database connection pool with DBCP, changed the WebLogic, forgot to match into Jndi. The workaround is simple, plus spring's Jndi lookup datasource, such as:

<jee:jndi-lookup id= "DataSource" jndi-name= "jdbc/xxxDS"/>

Due to WebLogic security issues, the following error may occur ... invalid subject. Principles[weblogic,administrators], so the configuration should be as follows:

<jee:jndi-lookup id= "DataSource" jndi-name= "Jdbc/xxxds" >
<jee:environment>
Java.naming.factory.initial=weblogic.jndi.wlinitialcontextfactory
Java.naming.provider.url=t3://yourhost:yourport
Java.naming.security.principal=yourprincipal
Java.naming.security.credentials=yourcredentials
</jee:environment>
</jee:jndi-lookup>

In addition, you need to set wls_jdbc_remote_enabled= "-dweblogic.jdbc.remoteenabled=true" in setdomainenv.sh, the default value is False

CXF deployed to WebLogic, which was the longest time I had to solve the problem, and some of the errors were very bizarre. Although the solution has not figured out why it happened.

The version mentioned earlier, is because I was deployed in weblogic10.3.0 a bit wrong, deployed to 10.3.2 and 10.3.3 the wrong bunch. CXF official also has said how to deploy to WebLogic in the instructions, unfortunately it only verified the weblogic9.2, at least I follow its configuration, little effect.

1, java.lang.LinkageError:loader constraints violated when linking Javax/xml/namespace/qname class

The problem was searched for a long time, and the solution was inspired by http://www.blogjava.net/security/archive/2008/07/06/java_lang_LinkageError_Problem.html

I was the one that found the class that contained the QName in my project, and I deleted the QName class in it (that doesn't seem very good).

2, Org.apache.commons.logging.LogConfigurationException:org.apache.commons.logging.LogConfigurationException: Org.apache.commons.logging.LogConfigurationException:Invalid class loader hierarchy. You had more than one version of ' Org.apache.commons.logging.Log ' visible, which was not allowed.

This fault is very magical, I because it made a lot of day, always thought I used the version of the commons-logging and WebLogic use of different, just appear this fault, And then searched for all versions of commons-logging in the WebLogic directory. I tried it in my project, none of them, search all the streets of the foreign forum, is not a result, then carefully look at the exception stack, It contained a spring.orm thrown information, I deployed just a very simple CXF project, and did not contain any ORM framework, configuration also checked again, and did not match the ORM, why the exception is thrown from here. The last discovery was caused by the use of @autowired and @component annotations for automatic injection, but I still don't understand, I just injected a plainjavabean, why use @autowired and @component, The exception will appear on the ORM, and then I throw Spring-orm-2.5.6.jar into the Lib and deploy it once, and this commons-logging error disappears. It was a magical mistake. (Dripping sweat)

3. Java.lang.NoSuchMethodException:Oracle. java. ws. wsdl. Extensions. Soap. Soapbindingimpl. GetElementType ()

This error also searched for a long time, did not find a very straightforward solution, and finally their own groping to solve, cxf to use is Wsdl4j.jar, and then my WebLogic installed Webcenter middleware, and then mw_home below will be more oracle_ Common directory, there will be a jar in the subdirectory under this directory called Orawsdl.jar, which has the Oracle. java. ws. wsdl. Extensions. Soap described above. Soapbindingimpl class, the solution is to edit the startweblogic.sh file, put Wsdl4j.jar in front of WebLogic own classpath, there will be no such error.

WebLogic did cluster, session replication problem

This online has a lot of instructions, but most of them seem to be for the old version of the WebLogic, online popular wording:

In Weblogic.xml, add the following configuration:

<session-descriptor>

<session-param>

<param-name>PersistentStoreType</param-name>

<param-value>replicated</param-value>

</session-param>

</session-descriptor>

The wording under weblogic11g is:

<session-descriptor>
<persistent-store-type>replicated</persistent-store-type>
<sharing-enabled>true</sharing-enabled>
</session-descriptor>

This should be related to different versions of DTDs.

Note that any content in the session that needs to be persisted must implement the Java.io.Serializable interface, otherwise it cannot be replicated.

remote query and security of resources in different WebLogic

This problem can be solved, but it will also cause other problems, in my project, I have 3 WebLogic, a deployed Oracle bpm10g,

In addition, 2 B and C cluster deployed the management server of the cluster in Oracle Webcenter11g,b, the Webcenter project needs to find the topic of BPM remotely, without ADF security, there will be no error, but with ADF Security, it will appear ... invalid subject. PRINCIPLES[XXXXX,XXXXX] Error, now I have temporarily resolved this remote lookup problem by enabling the global trust in WebLogic.

But there is a new problem, the problem is very strange, after the global trust is enabled, B's Management Server does not know when to read a domain information, once this appears, once I want to change the configuration of domain B must restart the Management Server B, log in again. I do not understand this problem, and I do not know when it will happen, sometimes the correct reading, sometimes incorrect. There is no way to solve it.

Summary of issues in deploying SSH projects to WebLogic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.