weblogic加载hibernate

时间:2016-05-23 11:58:41

标签: java hibernate log4j2 weblogic12c

我已经有log4j2在weblogic上工作,我唯一的propblem是启动日志,而weblogic加载所有hibernate查询还没有配置。

以下是日志中的示例:

Listening for transport dt_socket at address: 5005
<May 23, 2016 2:49:49 PM IDT> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance.
To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<May 23, 2016 2:49:49 PM IDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to FIPS186PRN
G. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<May 23, 2016 2:49:50 PM IDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 24.79-b02
from Oracle Corporation.>
<May 23, 2016 2:49:50 PM IDT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.1.3.0.0  Wed May 21 18:53:34 PDT 2014 1604337 >
<May 23, 2016 2:49:52 PM IDT> <Error> <Management> <BEA-141244> <Schema validation errors while parsing C:\work\srv\wls-core.13.5\config\config.xml<47
:1> - Expected elements 'administration-protocol@http://xmlns.oracle.com/weblogic/domain wldf-system-resource@http://xmlns.oracle.com/weblogic/domain
jdbc-system-resource@http://xmlns.oracle.com/weblogic/domain saf-agent@http://xmlns.oracle.com/weblogic/domain wlec-connection-pool@http://xmlns.oracl
e.com/weblogic/domain error-handling@http://xmlns.oracle.com/weblogic/domain remote-saf-context@http://xmlns.oracle.com/weblogic/domain migratable-rmi
-service@http://xmlns.oracle.com/weblogic/domain webservice-security@http://xmlns.oracle.com/weblogic/domain jms-connection-consumer@http://xmlns.orac
le.com/weblogic/domain auto-deploy-for-submodules-enabled@http://xmlns.oracle.com/weblogic/domain admin-console@http://xmlns.oracle.com/weblogic/domai
n internal-apps-deploy-on-demand-enabled@http://xmlns.oracle.com/weblogic/domain guardian-enabled@http://xmlns.oracle.com/weblogic/domain ocm-enabled@
http://xmlns.oracle.com/weblogic/domain msg-id-prefix-compatibility-enabled@http://xmlns.oracle.com/weblogic/domain coherence-cluster-system-resource@
http://xmlns.oracle.com/weblogic/domain restful-management-services@http://xmlns.oracle.com/weblogic/domain system-component@http://xmlns.oracle.com/w
eblogic/domain osgi-framework@http://xmlns.oracle.com/weblogic/domain webservice-testpage@http://xmlns.oracle.com/weblogic/domain server-migration-his
tory-size@http://xmlns.oracle.com/weblogic/domain service-migration-history-size@http://xmlns.oracle.com/weblogic/domain coherence-management-cluster@
http://xmlns.oracle.com/weblogic/domain' instead of 'app-deployment@http://xmlns.oracle.com/weblogic/domain' here in element domain@http://xmlns.oracl
e.com/weblogic/domain.>
<May 23, 2016 2:49:52 PM IDT> <Error> <Management> <BEA-141244> <Schema validation errors while parsing C:\work\srv\wls-core.13.5\config\config.xml<57
:1> - Expected elements 'administration-protocol@http://xmlns.oracle.com/weblogic/domain wldf-system-resource@http://xmlns.oracle.com/weblogic/domain
jdbc-system-resource@http://xmlns.oracle.com/weblogic/domain saf-agent@http://xmlns.oracle.com/weblogic/domain wlec-connection-pool@http://xmlns.oracl
e.com/weblogic/domain error-handling@http://xmlns.oracle.com/weblogic/domain remote-saf-context@http://xmlns.oracle.com/weblogic/domain migratable-rmi
-service@http://xmlns.oracle.com/weblogic/domain webservice-security@http://xmlns.oracle.com/weblogic/domain jms-connection-consumer@http://xmlns.orac
le.com/weblogic/domain auto-deploy-for-submodules-enabled@http://xmlns.oracle.com/weblogic/domain admin-console@http://xmlns.oracle.com/weblogic/domai
n internal-apps-deploy-on-demand-enabled@http://xmlns.oracle.com/weblogic/domain guardian-enabled@http://xmlns.oracle.com/weblogic/domain ocm-enabled@
http://xmlns.oracle.com/weblogic/domain msg-id-prefix-compatibility-enabled@http://xmlns.oracle.com/weblogic/domain coherence-cluster-system-resource@
http://xmlns.oracle.com/weblogic/domain restful-management-services@http://xmlns.oracle.com/weblogic/domain system-component@http://xmlns.oracle.com/w
eblogic/domain osgi-framework@http://xmlns.oracle.com/weblogic/domain webservice-testpage@http://xmlns.oracle.com/weblogic/domain server-migration-his
tory-size@http://xmlns.oracle.com/weblogic/domain service-migration-history-size@http://xmlns.oracle.com/weblogic/domain coherence-management-cluster@
http://xmlns.oracle.com/weblogic/domain' instead of 'admin-server-name@http://xmlns.oracle.com/weblogic/domain' here in element domain@http://xmlns.or
acle.com/weblogic/domain.>
<May 23, 2016 2:49:52 PM IDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<May 23, 2016 2:49:52 PM IDT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.>
<May 23, 2016 2:49:52 PM IDT> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.>
<May 23, 2016 2:49:54 PM IDT> <Notice> <Log Management> <BEA-170019> <The server log file C:\work\srv\wls-core.13.5\servers\AdminServer\logs\AdminServ
er.log is opened. All server side log events will be written to this file.>
<May 23, 2016 2:49:56 PM IDT> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<May 23, 2016 2:49:56 PM IDT> <Warning> <Management> <BEA-141277> <The JMX MBean PlatformMBeanServerUsed attribute is true, but the Platform MBeanServ
er was created without the hooks for the WebLogic Server security infrastructure. The Platform MBeanServer will not be used and Platform MBeans will n
ot be available using the WebLogic Server Runtime or Domain Runtime MBeanServers. This can occur if Platform MBeanServer system properties or JVM opti
ons (-Dcom.sun.management.jmxremote or JRockit -XManagement) were defined.
 To allow the Platform MBeanServer to be used, either remove the system properties and JVM options or start WebLogic Server with the following system
property:
 -Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder
 To eliminate this log error if Platform MBeans do not need to be available when using WebLogic Server, set the PlatformMBeanUsed attribute in the JMX
MBean to false.>
<May 23, 2016 2:49:56 PM IDT> <Warning> <Store> <BEA-280109> <The JVM was unable to load the native wlfileio library for the store "_WLS_AdminServer".
 File and paging stores will continue to function correctly. Specifically, file stores that are configured with a transactionally safe synchronous wri
te policy will continue to operate safely and transactionally but may open with a different write-policy. Other store types may not be able to open.>

<May 23, 2016 2:49:58 PM IDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<May 23, 2016 2:49:58 PM IDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
May 23, 2016 2:49:58 PM weblogic.wsee.WseeCoreMessages logWseeServiceStarting
INFO: The Wsee Service is starting
May 23, 2016 2:50:05 PM org.hibernate.annotations.common.Version <clinit>
INFO: Hibernate Commons Annotations 3.2.0.Final
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.6.10.Final
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
May 23, 2016 2:50:05 PM org.hibernate.ejb.Version <clinit>

只有当服务器到达应用程序启动点时,它才会查找log4j2.xml并且格式更改为我们的:

The loading of the configuration:
INFO: JNDI InitialContext properties:{}
May 23, 2016 2:51:52 PM org.hibernate.cache.UpdateTimestampsCache <init>
INFO: starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
May 23, 2016 2:51:52 PM org.hibernate.cache.StandardQueryCache <init>
INFO: starting query cache at region: org.hibernate.cache.StandardQueryCache
<May 23, 2016 2:52:35 PM IDT> <Warning> <EJB> <BEA-010230> <EJB PolicySessionBean : method name performAllUnderwritingChecks and method name performAl
lUnderWritingChecks are equal under case-insensitive comparison but both methods have declarative security settings. Declarative security checks are c
ase-insensitive.>
<May 23, 2016 2:52:36 PM IDT> <Warning> <Connector> <BEA-190155> <Compliance checking and validation of the resource adapter C:\work\srv\wls-core.13.5
\.\applications\idit-Core-ear\idit-ra.mq-1.0.0.rar resulted in the following warnings:
The class 'org.apache.activemq.ra.ActiveMQResourceAdapter', which is defined as [<resourceadapter-class>] from [META-INF/ra.xml], should implement jav
a.io.Serializable but does not.>
May 23, 2016 2:52:39 PM com.idit.framework.rar.mq.server.impl.ActiveMQManagedConnectionFactoryIDIT <init>
INFO: ActiveMQManagedConnectionFactoryIDIT::Constructor()
May 23, 2016 2:52:40 PM com.idit.framework.rar.mq.server.impl.ActiveMQConnectionFactoryIDIT <init>
INFO: ActiveMQConnectionFactoryIDIT::Constructor(factory=com.idit.framework.rar.mq.server.impl.ActiveMQManagedConnectionFactoryIDIT@375f645f, manager=
weblogic.connector.outbound.ConnectionManagerImpl@6e9f8cd2-java:/idit/ConnectionFactory/general, requestInfo=ActiveMQConnectionRequestInfo{ userName =
 'defaultUser' , serverUrl = 'tcp://DO_NOT_EXIST:6666' , clientid = 'null' , userName = 'defaultUser' , useInboundSession = 'false'  })
<May 23, 2016 2:52:40 PM IDT> <Warning> <Weblogic-Validation> <BEA-2156400> <The validation.xml file, located at file:/C:/work/srv/wls-core.13.5/appli
cations/idit-Core-ear/idit-Core/WEB-INF/validation.xml, does not conform to the JSR 303 specifications.>
2016-05-23 14:52:40,661 [STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' ERROR Unable to access file:/c:/work/srv/wls-c
ore.13.5/file:/$%7Bproject.build.directory%7D/classes/log4j-embedded.xml
2016-05-23 14:52:40,663 [STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' ERROR Unable to access file:/c:/work/srv/wls-c
ore.13.5/file:/$%7Bproject.build.directory%7D/classes/log4j-embedded.xml
[[23-05-16 14:52:40.955] INFO  StrutsInformationEntry - Project properties set to: com.idit.noc.common.NOCProjectProperties
[[23-05-16 14:52:40.955] INFO  StrutsInformationEntry - Project properties set to: com.idit.noc.common.NOCProjectProperties
[[23-05-16 14:52:40.977] INFO  IditStartupController - Entering servlet for the first time.
[[23-05-16 14:52:40.977] INFO  IditStartupController - Start printing system properties:
[[23-05-16 14:52:40.978] INFO  IditStartupController -          java.vendor = Oracle Corporation
[[23-05-16 14:52:40.978] INFO  IditStartupController -          sun.java.launcher = SUN_STANDARD

我已经尝试过使用“log4j.configurationFile”,尝试使用log4j2官方网站:log4j2 JEE Application,但仍然没有。

我最大的问题是加载时间,我们有很多hibernate查询,每次服务器启动它们的加载需要几分钟。

如何让weblogic在启动时加载配置?

1 个答案:

答案 0 :(得分:1)

您需要在服务器配置菜单的 Server Start 选项卡上的 Arguments 窗格中设置-Dlog4j.configuration属性。然后,WebLogic将正确读取属性文件。

就像这样:

enter image description here