[JBossCache] - Re: unable to configure logging
by matabo
Well. lets' start with the "simple" case:
This is the source of java stand alone program:
package cachiamo;
import org.jboss.cache.*;
public class Principale {
public static void main(String[] args) throws Exception {
TreeCache tree = new TreeCache();
PropertyConfigurator config = new PropertyConfigurator();
config.configure(tree, "META-INF/mioreplSync-service.xml");
tree.setClusterName("pippo");
tree.startService();
tree.destroyService();
}
}
__________________________________
This is log4j.xml contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!-- ===================================================================== -->
<!-- -->
<!-- Log4j Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: log4j.xml,v 1.5 2005/06/09 15:54:45 bela Exp $ -->
<!--
| For more configuration infromation and examples see the Jakarta Log4j
| owebsite: http://jakarta.apache.org/log4j
-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<!-- ================================= -->
<!-- Preserve messages in a local file -->
<!-- ================================= -->
<!-- A time/date based rolling appender -->
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- Rollover at the top of each hour
<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
-->
<!-- The default pattern: Date Priority [Category] Message\n -->
<!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
-->
<!-- ============================== -->
<!-- Append messages to the console -->
<!-- ============================== -->
<!-- The default pattern: Date Priority [Category] Message\n -->
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
<!-- Limit JBoss categories to INFO
-->
<!-- Increase the priority threshold for the DefaultDS category
-->
<!-- Decrease the priority threshold for the org.jboss.varia category
-->
<!--
| An example of enabling the custom TRACE level priority that is used
| by the JBoss internals to diagnose low level details. This example
| turns on TRACE level msgs for the org.jboss.ejb.plugins package and its
| subpackages. This will produce A LOT of logging output.
-->
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
<appender-ref ref="CONSOLE"/>
<!-- <appender-ref ref="FILE"/>-->
</log4j:configuration>
(it is just the log4j.xml shipped with JBosscache distribution)
______________________________________
This is the launch command of the program:
Q:\remote\jdk\jdk1.3.1_05\bin\java -Dlog4j.configuration=log4j.xml -classpath "C:\JBuilder8\progetti\cache\xml;P:\bea\weblogic700\server\lib\weblogic.jar;C:\JBuilder8\progetti\cache\classes;D:\jbosscachebueo\jdk13\commons-logging.jar;D:\jbosscachebueo\jdk13\concurrent.jar;D:\jbosscachebueo\jdk13\javassist.jar;D:\jbosscachebueo\jdk13\jboss-cache.jar;D:\jbosscachebueo\jdk13\jboss-common.jar;D:\jbosscachebueo\jdk13\jboss-jmx.jar;D:\jbosscachebueo\jdk13\jboss-system.jar;D:\jbosscachebueo\jdk13\jgroups-all.jar;Q:\remote\jdk\jdk1.3.1_05\jre\lib\i18n.jar;Q:\remote\jdk\jdk1.3.1_05\jre\lib\jaws.jar;Q:\remote\jdk\jdk1.3.1_05\jre\lib\rt.jar;Q:\remote\jdk\jdk1.3.1_05\jre\lib\sunrsasign.jar;Q:\remote\jdk\jdk1.3.1_05\lib\dt.jar;Q:\remote\jdk\jdk1.3.1_05\lib\htmlconverter.jar;Q:\remote\jdk\jdk1.3.1_05\lib\tools.jar" cachiamo.Principale
(Directory C:\JBuilder8\progetti\cache\xml contains file logj4.xml and file META-INF\mioreplSync-service.xml. This directory is, of course, in the classpath.)
_____________________________________
The output produced is:
[INFO] PropertyConfigurator - -Found existing property editor for org.w3c.dom.Element: org.jboss.util.propertyeditor.ElementEditor@5d173
[INFO] PropertyConfigurator - -configure(): attribute size: 13
[INFO] TreeCache - -setting cluster properties from xml to: UDP(bind_addr=1.6.64.159;ip_mcast=true;ip_ttl=64;loopback=true;mcast_addr=228.1.2.3;mcast_port=48866;mcast_recv_buf_size=80000;mcast_send_buf_size=150000;ucast_recv_buf_size=80000;ucast_send_buf_size=150000):PING(down_thread=false;num_initial_members=3;timeout=2000;up_thread=false):MERGE2(max_interval=20000;min_interval=10000):FD_SOCK:VERIFY_SUSPECT(down_thread=false;timeout=1500;up_thread=false):pbcast.NAKACK(down_thread=false;gc_lag=50;max_xmit_size=8192;retransmit_timeout=600,1200,2400,4800;up_thread=false):UNICAST(down_thread=false;min_threshold=10;timeout=600,1200,2400;window_size=100):pbcast.STABLE(desired_avg_gossip=20000;down_thread=false;up_thread=false):FRAG(down_thread=false;frag_size=8192;up_thread=false):pbcast.GMS(join_retry_timeout=2000;join_timeout=5000;print_local_addr=true;shun=true):pbcast.STATE_TRANSFER(down_thread=true;up_thread=true)
[INFO] TreeCache - -interceptor chain is:
class org.jboss.cache.interceptors.CallInterceptor
class org.jboss.cache.interceptors.LockInterceptor
class org.jboss.cache.interceptors.UnlockInterceptor
class org.jboss.cache.interceptors.ReplicationInterceptor
[INFO] TreeCache - -cache mode is REPL_SYNC
[INFO] UDP - -sockets will use interface 1.6.64.159
[INFO] UDP - -socket information:
local_addr=1.6.64.159:2625, mcast_addr=228.1.2.3:48866, bind_addr=ic2302299.ic.intra.infocamere.it/1.6.64.159, ttl=64
sock: bound to 1.6.64.159:2625, receive buffer size=80000, send buffer size=150000
mcast_recv_sock: bound to 1.6.64.159:48866, send buffer size=150000, receive buffer size=80000
mcast_send_sock: bound to 1.6.64.159:2626, send buffer size=150000, receive buffer size=80000
[INFO] TreeCache - -viewAccepted(): new members: [1.6.64.159:2625]
[INFO] TreeCache - -new cache is null (maybe first member in cluster)
[INFO] TreeCache - -state could not be retrieved (must be first member in group)
______________________________
Then, I removed the file log4j.xml from directory C:\JBuilder8\progetti\cache\xml. The output produced is:
[INFO] PropertyConfigurator - -Found existing property editor for org.w3c.dom.Element: org.jboss.util.propertyeditor.ElementEditor@5d173
[INFO] PropertyConfigurator - -configure(): attribute size: 13
[INFO] TreeCache - -setting cluster properties from xml to: UDP(bind_addr=1.6.64.159;ip_mcast=true;ip_ttl=64;loopback=true;mcast_addr=228.1.2.3;mcast_port=48866;mcast_recv_buf_size=80000;mcast_send_buf_size=150000;ucast_recv_buf_size=80000;ucast_send_buf_size=150000):PING(down_thread=false;num_initial_members=3;timeout=2000;up_thread=false):MERGE2(max_interval=20000;min_interval=10000):FD_SOCK:VERIFY_SUSPECT(down_thread=false;timeout=1500;up_thread=false):pbcast.NAKACK(down_thread=false;gc_lag=50;max_xmit_size=8192;retransmit_timeout=600,1200,2400,4800;up_thread=false):UNICAST(down_thread=false;min_threshold=10;timeout=600,1200,2400;window_size=100):pbcast.STABLE(desired_avg_gossip=20000;down_thread=false;up_thread=false):FRAG(down_thread=false;frag_size=8192;up_thread=false):pbcast.GMS(join_retry_timeout=2000;join_timeout=5000;print_local_addr=true;shun=true):pbcast.STATE_TRANSFER(down_thread=true;up_thread=true)
[INFO] TreeCache - -interceptor chain is:
class org.jboss.cache.interceptors.CallInterceptor
class org.jboss.cache.interceptors.LockInterceptor
class org.jboss.cache.interceptors.UnlockInterceptor
class org.jboss.cache.interceptors.ReplicationInterceptor
[INFO] TreeCache - -cache mode is REPL_SYNC
[INFO] UDP - -sockets will use interface 1.6.64.159
[INFO] UDP - -socket information:
local_addr=1.6.64.159:2631, mcast_addr=228.1.2.3:48866, bind_addr=ic2302299.ic.intra.infocamere.it/1.6.64.159, ttl=64
sock: bound to 1.6.64.159:2631, receive buffer size=80000, send buffer size=150000
mcast_recv_sock: bound to 1.6.64.159:48866, send buffer size=150000, receive buffer size=80000
mcast_send_sock: bound to 1.6.64.159:2632, send buffer size=150000, receive buffer size=80000
[INFO] TreeCache - -viewAccepted(): new members: [1.6.64.159:2631]
[INFO] TreeCache - -new cache is null (maybe first member in cluster)
[INFO] TreeCache - -state could not be retrieved (must be first member in group)
(I dont' see any difference.)
__________________________________
Then, I modified log4j.xml in this way:
I modified WARN in the following lines with FATAL
This is the output after the modification:
[INFO] PropertyConfigurator - -Found existing property editor for org.w3c.dom.Element: org.jboss.util.propertyeditor.ElementEditor@5d173
[INFO] PropertyConfigurator - -configure(): attribute size: 13
[INFO] TreeCache - -setting cluster properties from xml to: UDP(bind_addr=1.6.64.159;ip_mcast=true;ip_ttl=64;loopback=true;mcast_addr=228.1.2.3;mcast_port=48866;mcast_recv_buf_size=80000;mcast_send_buf_size=150000;ucast_recv_buf_size=80000;ucast_send_buf_size=150000):PING(down_thread=false;num_initial_members=3;timeout=2000;up_thread=false):MERGE2(max_interval=20000;min_interval=10000):FD_SOCK:VERIFY_SUSPECT(down_thread=false;timeout=1500;up_thread=false):pbcast.NAKACK(down_thread=false;gc_lag=50;max_xmit_size=8192;retransmit_timeout=600,1200,2400,4800;up_thread=false):UNICAST(down_thread=false;min_threshold=10;timeout=600,1200,2400;window_size=100):pbcast.STABLE(desired_avg_gossip=20000;down_thread=false;up_thread=false):FRAG(down_thread=false;frag_size=8192;up_thread=false):pbcast.GMS(join_retry_timeout=2000;join_timeout=5000;print_local_addr=true;shun=true):pbcast.STATE_TRANSFER(down_thread=true;up_thread=true)
[INFO] TreeCache - -interceptor chain is:
class org.jboss.cache.interceptors.CallInterceptor
class org.jboss.cache.interceptors.LockInterceptor
class org.jboss.cache.interceptors.UnlockInterceptor
class org.jboss.cache.interceptors.ReplicationInterceptor
[INFO] TreeCache - -cache mode is REPL_SYNC
[INFO] UDP - -sockets will use interface 1.6.64.159
[INFO] UDP - -socket information:
local_addr=1.6.64.159:2923, mcast_addr=228.1.2.3:48866, bind_addr=ic2302299.ic.intra.infocamere.it/1.6.64.159, ttl=64
sock: bound to 1.6.64.159:2923, receive buffer size=80000, send buffer size=150000
mcast_recv_sock: bound to 1.6.64.159:48866, send buffer size=150000, receive buffer size=80000
mcast_send_sock: bound to 1.6.64.159:2924, send buffer size=150000, receive buffer size=80000
[INFO] TreeCache - -viewAccepted(): new members: [1.6.64.159:2923]
[INFO] TreeCache - -new cache is null (maybe first member in cluster)
[INFO] TreeCache - -state could not be retrieved (must be first member in group)
Output doesn't change. I am not able to control the behavior of logging in JBosscache/JGroups.
regards
matabo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960274#3960274
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960274
19 years, 9 months
[JBoss Seam] - Re: Error during model data update
by jason_rency
my entity bean: RegUser.java
package src.reg.server;
|
| // Generated 17-Jul-2006 10:43:29 by Hibernate Tools 3.1.0.beta5
|
| import static org.jboss.seam.ScopeType.SESSION;
|
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.Id;
| import javax.persistence.Table;
|
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
|
| /**
| * RegUser generated by hbm2java
| */
| @Entity
| @Name("reguser")
| @Scope(SESSION)
| @Table(name = "REG_USER", schema = "PUBLIC", uniqueConstraints = {})
| public class RegUser implements java.io.Serializable {
|
| private static final long serialVersionUID = -595498938312392108L;
|
| private String UId;
|
| private int pinHash;
|
| private String EMail;
|
| private String phoneNumber;
|
|
| // Constructors
|
| /** default constructor */
| public RegUser() {
| }
|
| /** minimal constructor */
| public RegUser(String UId, int pinHash, String tokenKey, int tokenSta,
| String EMail) {
| this.UId = UId;
| this.pinHash = pinHash;
| this.EMail = EMail;
| }
|
| /** full constructor */
| public RegUser(String UId, int pinHash, String tokenKey, int tokenSta,
| String EMail, String phoneNumber) {
| this.UId = UId;
| this.pinHash = pinHash;
| this.EMail = EMail;
| this.phoneNumber = phoneNumber;
| }
|
| // Property accessors
| @Id
| @Column(name = "U_ID", unique = true, nullable = false, insertable = true, updatable = false, length = 10)
| public String getUId() {
| return this.UId;
| }
|
| public void setUId(String UId) {
| this.UId = UId;
| }
|
| @Column(name = "PIN_HASH", unique = false, nullable = false, insertable = true, updatable = true)
| public int getPinHash() {
| return this.pinHash;
| }
|
| public void setPinHash(int pinHash) {
| this.pinHash = pinHash;
| }
|
|
| @Column(name = "E_MAIL", unique = false, nullable = false, insertable = true, updatable = false, length = 20)
| public String getEMail() {
| return this.EMail;
| }
|
| public void setEMail(String EMail) {
| this.EMail = EMail;
| }
|
| @Column(name = "PHONE_NUMBER", unique = false, nullable = true, insertable = true, updatable = false, length = 15)
| public String getPhoneNumber() {
| return this.phoneNumber;
| }
|
| public void setPhoneNumber(String phoneNumber) {
| this.phoneNumber = phoneNumber;
| }
|
| }
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960271#3960271
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960271
19 years, 9 months
[Remoting] - Re: rmi registry
by choozie
I figured out my mistake, but I've run into another one. My code is the following:
if (System.getSecurityManager() == null){
System.setSecurityManager(new RMISecurityManager());
}
Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.setProperty("java.naming.provider.url", "localhost:3455");
env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
try {
InitialContext context = new InitialContext(env);
} catch (NamingException e) {
e.printStackTrace();
}
try{
InvokerLocator myLocator = new InvokerLocator("rmi://localhost:3455");
RMIServerInvoker rmiserver = new RMIServerInvoker(myLocator);
}catch(Exception e){
e.printStackTrace();
}
No errors so far. But then I try to bind to the registry, with
Naming.rebind( serverUrl, server );
where serverUrl = rmi://localhost:3455/
and server is a UnicastRemoteObject.
This gives
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: <server-class>_Stub
I checked the class-folder, and the stub is there. If I create a local rmi-registry and bind to that (skipping all the above code expect the naming.rebind), everything works fine. But I would like the use the jboss rmi registry. What am I doing wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960269#3960269
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960269
19 years, 9 months