WebLogic的一个优雅之处是WLST(Weblogic Scripting).是否可以编写在ALSB(Aqualogic Service Bus)中完成的操作?
例如:从总线导出资源.
是否有一种简单的方法来读取运行Java应用程序的Weblogic域的目录路径?
我可以使用System.getProperty("weblogic.Name")轻松访问服务器的名称,但我不知道什么是保存Weblogic域文件夹路径的变量(如果有的话).
我知道我可以设置一个这样的变量,但我想知道Weblogic中是否已有一个变量.
非常感谢
我正在编写一个使用MDB,EJB的应用程序,并且需要ThreadLocal在多个EJB和Helper类之间传递和记录变量,直到事务完成.
流程是
从MDB onMessage()开始 - >一些业务委托EJB - >一些帮助程序
题:
这个应用程序在Weblogic中运行,Weblogic从它的ThreadPool中重用Threads.那么是否有可能跨线程数据损坏?解决方案使用ThreadLocal.remove()安全吗?
除了将Object作为参数传递给所有方法之外,还有ThreadLocal的替代方法吗?
我有一个Spring应用程序,启用了aop,使用cglib代理进行日志记录:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
<aop:aspectj-autoproxy proxy-target-class="true"/>
<bean id="loggingPointcuts" class="com.coverall.integration.commons.logging.LoggingPointcuts"/>
<bean id="loggingAspect" class="com.coverall.integration.commons.logging.LoggingAspect"/>
</beans>
Run Code Online (Sandbox Code Playgroud)
我使用cglib-nodep-2.2.2.jar和spring 3.1.1这在tomcat或jetty中运行良好.但是,当我在OC4J(使用jdk1.6)上部署它时,我收到以下错误:它试图代理的类 - ComponentRegistryImpl是包私有
Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.company.int.components.core.registration.ComponentRegistryImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:207) ~[org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112) ~[org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:476) ~[org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362) ~[org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322) ~[org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE] …Run Code Online (Sandbox Code Playgroud) 我目前有两个客户端(生产者/消费者),我试图通过JMS发送一个大文件.我成功生成并将文件发送到JMS服务器没有任何问题.问题是当我尝试使用消息时,我得到以下异常:
Aug 24, 2012 11:25:37 AM client.Client$1 onException
SEVERE: Connection to the Server has been lost, will retry in 30 seconds. weblogic.jms.common.LostServerException: java.lang.Exception: weblogic.rjvm.PeerGoneException: ; nested exception is:
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3'
<Aug 24, 2012 11:25:37 AM CDT> <Error> <Socket> <BEA-000403> <IOException occurred on socket: Socket[addr=127.0.0.1/127.0.0.1,port=7001,localport=51764]
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3'.
weblogic.socket.MaxMessageSizeExceededException: Incoming message of …Run Code Online (Sandbox Code Playgroud) 我正在使用安装了JRockit的weblogic 10.3.6.我使用的是64位系统,Linux作为操作系统.我安装了一个adf应用程序.只有几个用户使用该应用程序.但是安装了WLS的服务器机器每周都会停机,造成内存不足.所以我们每周都要重启它.当我查看时,我发现通过调整堆大小和其他内存参数可以使WebLogic更稳定.
示例: - Xms256m --Xmx512m MaxPermsize为128m
我的问题是
这些论点是什么?
这些论点如何相互关联?
如何确定这些参数的值?
什么可能是内存不足问题的其他原因?
谢谢,
拉克什
我试图运行WLST(在Windows XP上),但我总是得到java.lang.NoClassDefFoundError:
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/wlst
Caused by: java.lang.ClassNotFoundException: weblogic.wlst
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: weblogic.wlst. Program will exit.
Run Code Online (Sandbox Code Playgroud)
我尝试运行*user_projects/domains/my_domain/bin/setDomainEnv.cmd*和*wlserver_10.3/server/bin/setWLSEnv.cmd*但没有任何成功,当我运行java weblogic.wlst myscript时,我总是得到这个NoClassDefFoundError . py.我该怎么办?
我有一个MDB EJB,里面有静态块.我在第一次运行应用程序时(即部署时)使用静态块来初始化一些组件.MDB EJB部署在除Admin_Server之外的单独服务器(My_Server)上.
问题是静态块被调用两次!
另外,我打印了服务器名称和pid,它们在两者中都是相同的:
System.out.println("server name: " + System.getProperty("weblogic.Name"));
System.out.println("pid: " + ManagementFactory.getRuntimeMXBean().getName().split("@")[0]);
Run Code Online (Sandbox Code Playgroud)
我也注意到一些奇怪的行为.基本上,我附加了一个Shutdown Hook(从静态块内部),在关闭应用程序时向我发送电子邮件.
我该如何解决这个问题?
一些额外的信息:
Weblogic version: 10.3.0
EJB version: 3.0
Run Code Online (Sandbox Code Playgroud) 我花了一天时间寻找正确的解决方案,但没有运气!问题是,例如,如何使用jel $ {bean.objectName}从jsp调用Java常量变量。最佳做法是什么?
我想知道这是否可行,对于Spring和jsp来说还是很新的。
常量类:
public class RNConstant {
public static final String HELLO_WORLD = "Hello World again!";
public static final String DEFAULT_LOCALE = "id_ID";
public static final String CONTEXT_PATH_SOAP_SR = "soap.sr";
}
Run Code Online (Sandbox Code Playgroud)
用EL调用jsp中的期望
<p>${RNConstant.HELLO_WORLD}</p>
Run Code Online (Sandbox Code Playgroud)
我可以使用scriptlet进行以下操作,但是如果它在weblogic中运行,则无法正常工作。这适用于apache tomcat v7或v8
<%@ page import="static id.co.telkom.common.RNConstant.*" %>
...
...
<%= HELLO_WORLD %>
Run Code Online (Sandbox Code Playgroud)
Weblogic中的错误
home.jsp:2:18: Syntax error on token "static", Identifier expected after this token
<%@ page import="static id.co.telkom.common.RNConstant.*" %>
^-------------------------------------^
home.jsp:11:19: HELLO_WORLD cannot be resolved
Hello world! <%=HELLO_WORLD%>
^--------^
Run Code Online (Sandbox Code Playgroud)
Java版本:1.6
pom.xml
spring
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties> …Run Code Online (Sandbox Code Playgroud) 我想要消耗2个服务,并希望有不同的超时.所以,我已经覆盖了Spring SimpleClientHttpRequestFactory并且使用了它HttpDaoImpl.
现在一切都工作在一个环境中,但完全一样的EAR不能在其他环境中工作,只有在这两个环境不同的是,我连接的服务URL是在一个非LB在其他负载平衡的URL.问题出现在负载均衡的服务URL中.
问题是每次httpReadTimeout都在生效或被使用但不是XYZHttpReadTimeout,即使我有条件地设置了时间.
这是一个非常奇怪的问题,因为一切都在一个环境中工作.而不是在其他方面.到目前为止我对可能的根本原因的猜测是负载均衡的URL,但我仍然无法看到为什么负载平衡的URL可能会出现问题的任何技术原因,因为我的机器将打开套接字并在读取超时后关闭它.
我已将记录器放入CustomClientHttpRequestFactory并验证正在使用正确的值但最终以某种方式读取超时未按预期工作.
CustomClientHttpRequestFactory.java:
public class CustomClientHttpRequestFactory extends SimpleClientHttpRequestFactory{
private Log logger = LogFactory.getLog(CustomClientHttpRequestFactory.class);
@Value("${httpRequest.readTimeoutInMilliseconds}")
private Integer httpRequestTimeout;
@Value("${httpRequest.connectionTimeoutInMilliseconds}")
private Integer httpReadTimeout;
@Value("${XYZ.httpRequest.readTimeoutInMilliseconds}")
private Integer XYZHttpRequestTimeout;
@Value("${XYZ.httpRequest.connectionTimeoutInMilliseconds}")
private Integer XYZHttpReadTimeout;
@Value("${sgw.XYZHttp.service.url}")
private String XYZSystemUrl;
/**
* Overriding the default and setting a separate read timeout and HTTP connection timeout values for XYZ transactions.
*
* @param uri
*/
public void setTimeoutProperties(URI uri){
boolean isXYZTransaction = isXYZTransaction(uri);
Integer …Run Code Online (Sandbox Code Playgroud) weblogic ×10
java ×6
java-ee ×3
wlst ×2
alsb ×1
cglib ×1
classloader ×1
ejb-3.0 ×1
jms ×1
jsp ×1
linux ×1
oc4j ×1
oracle-adf ×1
proxy ×1
resttemplate ×1
scriplets ×1
sockets ×1
spring ×1
spring-aop ×1
spring-mvc ×1
weblogic11g ×1
windows ×1