[JBossCache] - JBossCache-1.4.1.GA - annotated50 example not working propar
by haviv.roshï¼ gmail.com
Hello,
I am trying to run the JBossCache-1.4.1.GA (stand alone-jdk1.5) annotated50 examples to work.
The strange thing is that the weaving example(build.bat run.aop.example) works ok, but the loadtime mode(build.bat run.loadtime.example) doesn't.
I have changed a bit the original StudentMaintTest Test case so it would check also the object graph replication.
It seems that the Student's Address attribute isn't getting replicated.
Any ideas?
| Here is the code I am testing :
|
| package test.examples;
|
| import junit.framework.TestCase;
| import junit.textui.TestRunner;
|
| import org.jboss.cache.PropertyConfigurator;
| import org.jboss.cache.aop.PojoCache;
|
| import examples.Address;
| import examples.Course;
| import examples.Student;
|
| /**
| * Driver test to illustrate the sensor netowrk supervising system using pojo cache. By using the cache, it will have:
| * <ul>
| * <li>automatic state fail over</li>
| * <li>fine-grained replication</li>
| * <li>preservation of object graph relationship</li>
| * </ul>
| */
| public class StudentMaintTest extends TestCase {
|
| private Student joe_;
| private Student mary_;
| private Course foo_;
| private Course bar_;
|
| // cache1 and cache2 are in the same clustering group.
| private PojoCache cache1_;
| private PojoCache cache2_;
|
| protected void setUp() throws Exception {
| cache1_ = createCache("TestCluster");
| cache2_ = createCache("TestCluster");
| init();
| }
|
| protected void tearDown() throws Exception {
| cache1_.remove("/");
| cache1_.stop();
| cache2_.stop();
| }
|
| private PojoCache createCache(String name) throws Exception {
| PojoCache tree = new PojoCache();
| PropertyConfigurator config = new PropertyConfigurator(); // configure the cache through injection
| // read in the replSync xml. Here we use synchronous mode replication.
| config.configure(tree, "META-INF/replSync-service.xml");
| tree.setClusterName(name); // We can set a different cluster group.
| tree.start(); // kick start the cache
| return tree;
| }
|
| /**
| * Populate the propagation tree.
| *
| * @throws Exception
| */
| protected void init() throws Exception {
|
|
| mary_ = new Student();
| mary_.setName("Mary Smith");
|
| Address address = new Address();
| address.setStreet("456 Oak Drive");
| address.setCity("Pleasantville, CA");
| address.setZip(94555);
|
| mary_.setAddress(address);
|
|
|
|
| }
|
| public void testPropagation() throws Exception {
|
| // Here we ask the pojo cache to manage mary_ and joe_
| cache1_.putObject("/students/54321", mary_);
|
| // Retrieve the pojos from the Server #2
| Student mary2 = (Student) cache2_.getObject("/students/54321");
|
| assertEquals(mary2.getName() , mary_.getName());
| //here it fails - sinch mary2.address object is null - probably not replicated
| assertEquals(mary_.getAddress().getCity() , mary2.getAddress().getCity());
|
|
| }
|
|
|
| public static void main(String[] args) throws Exception {
| TestRunner.run(StudentMaintTest.class);
| }
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014523#4014523
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014523
19Â years, 2Â months
[JBoss Messaging] - Re: jboss.messaging:service=PostOffice
by sasi2103
"timfox" wrote : Guys- can you tell me what version of messaging you are using?
|
| If you are getting sql exceptions with a config, that implies you are using the wrong config with that particular version. Are you using the config from the distro?
|
| If you are using 1.2, I have recently made big changes to the schema and I am currently going through the process of testing the pm configs for db2, sybase, sql server, mysql and postgresql, so this will all be fully tested and supported for the 1.2 release.
Hi Tim,
I'm using jboss-messaging-1.2.0.Beta1 and I d/w it form the JBoss site.
I fixed the error I mentioned here by adding the missing field IS_FAILED_OVER and it seems ok, (I guess it will be ok :)).
If you need anything else let me know so i'll provide it to u.
I walk with the tutorial of messaging by JBoss (User Guide).
I'm also using JBoss 4.0.2.
Sasi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014498#4014498
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014498
19Â years, 2Â months
[JBoss Portal] - Is this app design for my portal app good or bad.
by bmcgovern
I have a portal w/ multiple portlets that talk to my database. I'm using hibernate 3.2, jboss app server/portal server bundle.
Each page of the portal has between 3 and 7 portlets that each make a call to my single business object which gets 1 hibernate session from the factory PER METHOD and sends it in the constructor of each DAO that I use. The business method starts, then either commits, or rolls back the tx.
If I refresh any portal page multiple times in a row, very quickly, I get "wrong tx on thread" errors. Debugging the output, it seems that under that high concurrency, which i guess really isnt that high, the same TX is attempted to be committed by different sessions.
Is my design sound? Looking for help on how to debug.
Heres a little diagram.. Hope it makes sense.
Portal Page contains [ portletA, portletB, portletC ] each portlet calls a
| |
| |--->Business Class [methodA(), methodB(), methodC()]
| |
| |--->Various DAOs, each passed a session from prev layer.
| [DAOa.findbyID(), DAOb.findbyID(), DAOc.findbyID()]
Incidently, I've had same problems using JTA OR JDBC transactions. I've swapped out the default jboss connection pool with c3po and i do get better performance but it still breaks after refreshing like 5 x in a row.
I'm at a point where i think it might be a flaw in the portal architecture, but I cannot say that without first verifying that i'm not causing the issue with bad design.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014495#4014495
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014495
19Â years, 2Â months
[JBoss Seam] - Outjection problems with interface variables
by toni
Hi,
I have the problem that I can't outject an instance of an Entity Bean from a SFSB into a context variable.
The instance field of the SFSB from which I'm trying to outject the EntityBean is an INTERFACE, which two of my Enity Beans implement.
I think this is causing problems. I can tell that there is something wrong, because if I use the following code in the SFSB
@Out(required = false)
InterfaceCitySettable interfaceCitySettable;
then changes to the variable are NOT reflected in the context variable of the current conversation after invoking the SFSB.
However, if I change the code to
@Out(value="somethingnonexistent", required = false)
InterfaceCitySettable interfaceCitySettable;
then the EntityBean gets successfully outjected into the context variable "somethingnonexistent" of the current conversation.
Why is this?
I think it has to with the fact that the variable of the SFSB from which I'm trying to outject is an INTERFACE, which my hold two types of EntityBeans.
It seems to me that the first Entity Bean, which gets outjected into the context variable kind of write protects it or something like this.
After that I can only outject the same class into the interace, but not any other class also implementing the interface.
I appreciate any suggestions and comments, because I'm really kind of stuck on this one.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014489#4014489
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014489
19Â years, 2Â months