Laszlo Sinka | 4 Aug 14:54 2009
Picon

3-tier, client synchronization, JavaGroups

Hi,

we try to run Cayenne(3.0m6) in 3-tier mode with client synchronization.

We set up a configuration to use cross-vm caching through JavaGroups (2.2.1)
(with standard configuration).
We have a simple object with a string attribute (ItemCategory, name).
We have a tomcat5.5 deployed with the default HessianServlet (Hessian
version: 3.1.6).
We have a client that connects to the server, like
        String myChatRoom = "1111";
        ClientConnection connection = new HessianConnection(
                "http://192.168.3.154:8081/HVS_CAYENNE_V3/HVS_DATA", "hvs",
"hvs",
                myChatRoom);
        DataChannel channel = new ClientChannel(connection);
        context = new CayenneContext(channel, true, true);

then the client fetches an object
        SelectQuery select = new SelectQuery(ItemCategory.class);
        category = (ItemCategory)
context.performQuery(select).iterator().next();

we have a simple gui, which can update the name property:
        category.setName(nameField.getText());
        context.commitChanges();
the server accepts the requests, changes the database and logs also the
following message:
2009-08-04 14:03:29,125 DEBUG http-8081-Processor23
org.apache.cayenne.access.DataRowStore - postSnapshotsChangeEvent:
(Continue reading)

Laszlo Sinka | 4 Aug 14:54 2009
Picon

3-tier, client synchronization, xmpp

hi,

we try to run Cayenne(3.0m6) in 3-tier mode with client synchronization.

We set up a configuration to use cross-vm caching through XMPP with a WildFire server (2.6.2).
We have a simple object with a string attribute (ItemCategory, name).
We have a tomcat5.5 deployed with the default HessianServlet (Hessian version: 3.1.6).

But,
when we deploy the server and running a basic jsp page with
    SelectQuery query = new SelectQuery(ItemCategory.class);
    query.addOrdering(ItemCategory.NAME_PROPERTY, true);
 
    DataContext context = DataContext.createDataContext(true);
    List itemCategories = context.performQuery(query);
the server throws an exception
Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0M6 May 18 2009 07:55:30] Error setting up a group chat: (400)
(see attachment: cayennev3_xmpp_server.log).    

The wildfire admin console shows, that the server can login to the chatserver with a client id like:
    hvs <at> misk11/cayenne-xmpp-1249388992703
but doesn't enter into any chat room (we have set up room for cayenne.XMPPBridge.xmppChatService property's value
and another for the client chatroom parameter for the HessianConnection)
(the server allows to anybody to enter chatrooms or create new rooms)

We are using Eclipse(3.5) the client and server are in the same project, using the same configuration files, classes, libraries, etc., running on same machine.

What do we wrong? What else do we need?

Gilberto C. Andrade | 5 Aug 05:29 2009
Picon

Maven 2 Modeler - dependences problem

Hi, I'm back!
Hope this time I can stick with cayenne and contribute as well.

[code]
Gilberto <at> minhacasa /cygdrive/e/tools/workspace/osu-park
$ mvn cayenne-modeler:run
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building osu-park
[INFO]    task-segment: [cayenne-modeler:run]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.pom
[INFO] Unable to find resource 'jgoodies:looks:pom:1.3.1' in
repository central
(http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-
                                            1.0.1.pom
[INFO] Unable to find resource 'org.scopemvc:scopemvc:pom:1.0.1' in
repository c                                             entral
(http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/commons-dbcp/commons-dbcp/1.2.1/commo
                                            ns-dbcp-1.2.1.jar
Downloading: http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-
                                            1.0.1.jar
Downloading: http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.jar
Downloading: http://repo1.maven.org/maven2/commons-pool/commons-pool/1.2/commons
                                            -pool-1.2.jar
[INFO] Unable to find resource 'jgoodies:looks:jar:1.3.1' in
repository central
(http://repo1.maven.org/maven2)
[INFO] Unable to find resource 'org.scopemvc:scopemvc:jar:1.0.1' in
repository c                                             entral
(http://repo1.maven.org/maven2)
41K downloaded  (commons-pool-1.2.jar)
105K downloaded  (commons-dbcp-1.2.1.jar)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) jgoodies:looks:jar:1.3.1

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=jgoodies -DartifactId=looks
-Dversion=1                                             .3.1
-Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=jgoodies -DartifactId=looks
-Dversion=1.3                                             .1
-Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) org.apache.cayenne.plugins:maven-cayenne-modeler-plugin:maven-plugin:
                                            3.0M5
        2) org.apache.cayenne:cayenne-modeler:jar:3.0M5
        3) jgoodies:looks:jar:1.3.1

2) org.scopemvc:scopemvc:jar:1.0.1

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.scopemvc
-DartifactId=scopemvc -Dve
rsion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.scopemvc
-DartifactId=scopemvc -Dvers
  ion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
-DrepositoryId=[id]

  Path to dependency:
        1) org.apache.cayenne.plugins:maven-cayenne-modeler-plugin:maven-plugin:
                                            3.0M5
        2) org.apache.cayenne:cayenne-modeler:jar:3.0M5
        3) org.scopemvc:scopemvc:jar:1.0.1

----------
2 required artifacts are missing.

for artifact:
  org.apache.cayenne.plugins:maven-cayenne-modeler-plugin:maven-plugin:3.0M5

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  apache-snapshots (http://people.apache.org/repo/m2-snapshot-repository/)
[/code]

After download these library[1] I could run it. The documentation [2]
say nothing about that dependences.

regards,

Gilberto

[1]
http://objectstyle.org/maven2/org/scopemvc/scopemvc/1.0.1
http://objectstyle.org/maven2/jgoodies/looks/1.3.1/
[2]
http://cayenne.apache.org/doc/maven2-modeler.html

Andrey Razumovsky | 5 Aug 11:05 2009
Picon

Re: Maven 2 Modeler - dependences problem

Hi Gilberto!

Don't know where Objectstyle repo had gone, but now everything seems to
build OK. Looking forward for your contributions! :)

Cheers,
Andrey

2009/8/5 Gilberto C. Andrade <gilbertoca <at> gmail.com>

> Hi, I'm back!
> Hope this time I can stick with cayenne and contribute as well.
>
> [code]
> Gilberto <at> minhacasa /cygdrive/e/tools/workspace/osu-park
> $ mvn cayenne-modeler:run
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building osu-park
> [INFO]    task-segment: [cayenne-modeler:run]
> [INFO]
> ------------------------------------------------------------------------
> Downloading:
> http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.pom
> [INFO] Unable to find resource 'jgoodies:looks:pom:1.3.1' in
> repository central
> (http://repo1.maven.org/maven2)
> Downloading:
> http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-
>                                            1.0.1.pom
> [INFO] Unable to find resource 'org.scopemvc:scopemvc:pom:1.0.1' in
> repository c                                             entral
> (http://repo1.maven.org/maven2)
> Downloading:
> http://repo1.maven.org/maven2/commons-dbcp/commons-dbcp/1.2.1/commo
>                                            ns-dbcp-1.2.1.jar
> Downloading:
> http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-
>                                            1.0.1.jar
> Downloading:
> http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.jar
> Downloading:
> http://repo1.maven.org/maven2/commons-pool/commons-pool/1.2/commons
>                                            -pool-1.2.jar
> [INFO] Unable to find resource 'jgoodies:looks:jar:1.3.1' in
> repository central
> (http://repo1.maven.org/maven2)
> [INFO] Unable to find resource 'org.scopemvc:scopemvc:jar:1.0.1' in
> repository c                                             entral
> (http://repo1.maven.org/maven2)
> 41K downloaded  (commons-pool-1.2.jar)
> 105K downloaded  (commons-dbcp-1.2.1.jar)
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> Missing:
> ----------
> 1) jgoodies:looks:jar:1.3.1
>
>  Try downloading the file manually from the project website.
>
>  Then, install it using the command:
>      mvn install:install-file -DgroupId=jgoodies -DartifactId=looks
> -Dversion=1                                             .3.1
> -Dpackaging=jar -Dfile=/path/to/file
>
>  Alternatively, if you host your own repository you can deploy the file
> there:
>      mvn deploy:deploy-file -DgroupId=jgoodies -DartifactId=looks
> -Dversion=1.3                                             .1
> -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>
>  Path to dependency:
>        1)
> org.apache.cayenne.plugins:maven-cayenne-modeler-plugin:maven-plugin:
>                                            3.0M5
>        2) org.apache.cayenne:cayenne-modeler:jar:3.0M5
>        3) jgoodies:looks:jar:1.3.1
>
> 2) org.scopemvc:scopemvc:jar:1.0.1
>
>  Try downloading the file manually from the project website.
>
>  Then, install it using the command:
>      mvn install:install-file -DgroupId=org.scopemvc
> -DartifactId=scopemvc -Dve
> rsion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file
>
>  Alternatively, if you host your own repository you can deploy the file
> there:
>      mvn deploy:deploy-file -DgroupId=org.scopemvc
> -DartifactId=scopemvc -Dvers
>  ion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
> -DrepositoryId=[id]
>
>  Path to dependency:
>        1)
> org.apache.cayenne.plugins:maven-cayenne-modeler-plugin:maven-plugin:
>                                            3.0M5
>        2) org.apache.cayenne:cayenne-modeler:jar:3.0M5
>        3) org.scopemvc:scopemvc:jar:1.0.1
>
> ----------
> 2 required artifacts are missing.
>
> for artifact:
>  org.apache.cayenne.plugins:maven-cayenne-modeler-plugin:maven-plugin:3.0M5
>
> from the specified remote repositories:
>  central (http://repo1.maven.org/maven2),
>  apache-snapshots (http://people.apache.org/repo/m2-snapshot-repository/)
> [/code]
>
> After download these library[1] I could run it. The documentation [2]
> say nothing about that dependences.
>
> regards,
>
> Gilberto
>
> [1]
> http://objectstyle.org/maven2/org/scopemvc/scopemvc/1.0.1
> http://objectstyle.org/maven2/jgoodies/looks/1.3.1/
> [2]
> http://cayenne.apache.org/doc/maven2-modeler.html
>
Gilberto C. Andrade | 5 Aug 20:19 2009
Picon

Re: Maven 2 Modeler - dependences problem

> Don't know where Objectstyle repo had gone, but now everything seems to
> build OK.

I don't think so (new setup, zero cofing) :

gilberto <at> SUGEP-DMASI:~/dev/eclipse-config/workspace/osu-park> mvn
cayenne-modeler:run
[INFO] Scanning for projects...

[INFO] Searching repository for plugin with prefix: 'cayenne-modeler'.
[INFO] ------------------------------------------------------------------------
[INFO] Building osu-park
[INFO]    task-segment: [cayenne-modeler:run]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.pom
Downloading: http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.pom
Downloading: http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-1.0.1.pom
Downloading: http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-1.0.1.pom
Downloading: http://people.apache.org/repo/m2-incubating-repository//org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
Downloading: http://repository.codehaus.org/org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
Downloading: http://repo1.maven.org/maven2/org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
Downloading: http://repo1.maven.org/maven2/org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.geronimo.genesis
ArtifactId: genesis
Version: 1.1

Reason: Unable to download the artifact from any repository

  org.apache.geronimo.genesis:genesis:pom:1.1

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  codehaus (http://repository.codehaus.org),
  apache-snapshots (http://people.apache.org/repo/m2-snapshot-repository/),
  codehaus-snapshots (http://snapshots.repository.codehaus.org),
  apache-incubator (http://people.apache.org/repo/m2-incubating-repository/)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19 minutes 28 seconds
[INFO] Finished at: Wed Aug 05 15:11:28 BRT 2009
[INFO] Final Memory: 7M/83M
[INFO] ------------------------------------------------------------------------
gilberto <at> SUGEP-DMASI:~/dev/eclipse-config/workspace/osu-park>

There exists artifact on those server but not the version the cayenne
plugin uses.

Gilberto

Gilberto C. Andrade | 6 Aug 21:45 2009
Picon

Maven 2 Modeler - Configuration

Hi,

I need more information about this plugin. Until now, this [1] is only
source I've could find.

Can I setup my database on pom.xml file? For example:
[code]
			<plugin>
				<groupId>org.apache.cayenne.plugins</groupId>
				<artifactId>maven-cayenne-modeler-plugin</artifactId>
				<version>${cm.version}</version>
				<configuration>
					<driver>${jdbc.driverClassName}</driver>
					<username>${jdbc.username}</username>
					<password>${jdbc.password}</password>
					<url>${jdbc.url}</url>
					<src>src/test/resources/cayenne.xml</src>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>${jdbc.groupId}</groupId>
						<artifactId>${jdbc.artifactId}</artifactId>
						<version>${jdbc.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
[/code]

How can I set it to:
* open the cayenne.xml from the project it is running;
* use maven classpath

Gilberto

[1]http://cayenne.apache.org/doc/maven2-plugins.html

Andrey Razumovsky | 7 Aug 18:30 2009
Picon

Re: Maven 2 Modeler - dependences problem

I must have misunderstood you first. There is certainly a problem with
launching modeler plugin. Adding Objectstyle repo to my pom helped for me:

<repositories>
<repository>
            <id>objectstyle</id>
            <name>Objectstyle Repository</name>
            <url>http://objectstyle.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

Please do so until the problem is fixed.
Also shapshots seem to be not updated, so Modeler3.0M5 (not M6) is starting.

2009/8/5 Gilberto C. Andrade <gilbertoca <at> gmail.com>

> > Don't know where Objectstyle repo had gone, but now everything seems to
> > build OK.
>
> I don't think so (new setup, zero cofing) :
>
> gilberto <at> SUGEP-DMASI:~/dev/eclipse-config/workspace/osu-park> mvn
> cayenne-modeler:run
> [INFO] Scanning for projects...
>
> [INFO] Searching repository for plugin with prefix: 'cayenne-modeler'.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building osu-park
> [INFO]    task-segment: [cayenne-modeler:run]
> [INFO]
> ------------------------------------------------------------------------
> Downloading:
> http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.pom
> Downloading:
> http://repo1.maven.org/maven2/jgoodies/looks/1.3.1/looks-1.3.1.pom
> Downloading:
> http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-1.0.1.pom
> Downloading:
> http://repo1.maven.org/maven2/org/scopemvc/scopemvc/1.0.1/scopemvc-1.0.1.pom
> Downloading:
> http://people.apache.org/repo/m2-incubating-repository//org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
> Downloading:
> http://repository.codehaus.org/org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
> Downloading:
> http://repo1.maven.org/maven2/org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
> Downloading:
> http://repo1.maven.org/maven2/org/apache/geronimo/genesis/genesis/1.1/genesis-1.1.pom
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> GroupId: org.apache.geronimo.genesis
> ArtifactId: genesis
> Version: 1.1
>
> Reason: Unable to download the artifact from any repository
>
>  org.apache.geronimo.genesis:genesis:pom:1.1
>
> from the specified remote repositories:
>  central (http://repo1.maven.org/maven2),
>   codehaus (http://repository.codehaus.org),
>  apache-snapshots (http://people.apache.org/repo/m2-snapshot-repository/),
>  codehaus-snapshots (http://snapshots.repository.codehaus.org),
>  apache-incubator (http://people.apache.org/repo/m2-incubating-repository/
> )
>
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 19 minutes 28 seconds
> [INFO] Finished at: Wed Aug 05 15:11:28 BRT 2009
> [INFO] Final Memory: 7M/83M
> [INFO]
> ------------------------------------------------------------------------
> gilberto <at> SUGEP-DMASI:~/dev/eclipse-config/workspace/osu-park>
>
>
> There exists artifact on those server but not the version the cayenne
> plugin uses.
>
> Gilberto
>
Gilberto C. Andrade | 7 Aug 20:57 2009
Picon

Cayenne POJO inheritance

Hi, sometime ago I've tried cayenne JPA [1] and that time I couldn't
touch POJO source code.
Now this is a personal learning and I want do the cayenne way.

So trying Andrus advices:

1 reverse engineer the DB in question with CayenneModeler
2 manually tweak the model to match the property names in the existing
POJO Java classes
3 Run class generator to generate the _Xyz superclasses.
4 Change the existing classes by hand to inherit from _Xyz counterpart.
5 Remove existing persistence fields, and use superclass getters and
setters to access them. * Change the API throughout the code to use
Cayenne ObjectContext and Queries.

I've stopped on 4 when I saw the source generated
(osu-park/src/main/resources/codigo). The class inheritance looks a
little odd.

While testing my original code I do this
(osu-park/src/test/java/park/model/party/PessoaTest.java):
[code]
public class PessoaTest {

	 <at> Test
	public final void testPessoaFisica() {
		Pessoa p;
		p = new PessoaFisica(1, "Gilberto", "F", "Endere├žo",
Date.valueOf("2009-01-01"), "RG", "CPF");
		assertNotNull(p);
	}

	 <at> Test
	public final void testPessoaJuridica() {
		Pessoa p;
		p = new PessoaJuridica(1, "Souza e cia", "J", "Endere├žo",
Date.valueOf("2009-01-01"), "CNPJ");
		assertNotNull(p);
	}
}
[/code]

How would it be with the new generated code? I think I need a good reference!

Thanks,

Gilberto C. Andrade
blog.gilbertoca.com

[1]http://markmail.org/message/ijogqds67xhkri2u
Attachment (osu-park.tar.gz): application/x-gzip, 79 KiB
Blake Williams | 7 Aug 22:20 2009
Picon
Picon

Example of getting data from non-JDBC datasource?

Does anyone have an example of how to get data from a non-JDBC data 
source, or some docs/instructions/etc. of how this can be done?

Mike Kienenberger | 7 Aug 22:46 2009
Picon

Re: Example of getting data from non-JDBC datasource?

No non-jdbc examples that I know of, but I'd say you needed to create
your own implementation of Interface DbAdapter.

http://cayenne.apache.org/doc/api/org/apache/cayenne/dba/DbAdapter.html

You could use the JdbcAdaptor as an example:

http://cayenne.apache.org/doc/api/org/apache/cayenne/dba/JdbcAdapter.html

On Fri, Aug 7, 2009 at 4:20 PM, Blake Williams<bdub13 <at> earthlink.net> wrote:
> Does anyone have an example of how to get data from a non-JDBC data source,
> or some docs/instructions/etc. of how this can be done?
>


Gmane