Aug 05th
1.
遇上Jboss启动时报端口1099占用
java.net.BindException: Address already in use: JVM_Bind
解决办法有二,一则消灭冲突进程
http://www.mastertheboss.com/en/jboss-server/195-solving-javanetbindexception-address-already-in-use-jvmbind.html
@Windows
1. In MS-DOS, send command "netstat -ao". You can get network information for all processes.
2. Find out the one using port 1098, get the PID.
3. Find out the process with the PID you just got from windows task manager and shut it down. (By default the Task Manager doesn't show the PID. You have to add it from the menu View | Select columns)
4. Restart JBoss.
5. Restart the application you've just shutdown.
@Unix
fuser -v -n (tcp | udp) <port#>
二则修改Jboss端口,由于使用的是JBoss6.0,conf文件夹内文件相对之前版本已面目全非,端口修改位置:
%JBOSS_HOME%\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml
Aug 12th
JPA调用Oracle存储过程的问题
EJB3.0采用JPA的方式去调用存储过程,使用的方式为:
entityManager.createNativeQuery({CALL XXX_PRO(?)});
此处发现JPA不能调用参数为OUT的存储过程(请高手指教)
替代方式有二:
1. 修改存储过程
--pl/sql
create procedure my_function(arg1 in out varchar2 , arg2 varchar2)
为
create function my_function(arg2 varchar2) return varchar2
2. 如果使用的是Hibernate,可以通过创建CallableStatement来调用。
stmt.registerOutParameter(1, OracleTypes.CURSOR);