Well, here is a first post how to use mysql database with java shindig.
http://vohtaski.blogspot.com/2010/07/java-shindig-how-to-add-your-own-social.html

Next post will be about connecting my own social database with shindig,
that I am doing now :)

If you find it useful, I can create a wiki page for it.
I also have a patch that does all the mentioned in post changes.
Should I upload it to jira or some other place?

Evgeny

On 13.07.10 21:56, John Hjelmstad wrote:
I'd be interested to see the Shindig Wiki, or some other official/easy to
find documentation (seems like Wiki is the consensus at this point however?
what do others think?) updated with such information as well.

Many thanks,
John

On Tue, Jul 13, 2010 at 12:29 PM, Henry Saputra<henry.sapu...@gmail.com>wrote:

HI Evgeny,

A blog about this would be great. I be a lot other developers also
interested to hook up Shindig with their database.

- Henry

On Tue, Jul 13, 2010 at 12:49 AM, Evgeny Bogdanov
<evgeny.bogda...@epfl.ch>wrote:

Thanks Franck for your help!

It seems as I found a solution (At least now I am able to login to the
database :))
I had to move all dependencies from samples/pom.xml to social/pom.xml,
if I only put dependency in social/pom.xml on artifactId = samples,
it didn't find the needed classes.

I will write a blog post on how and what I did, maybe it will
be useful for somebody.

Evgeny


On 12.07.10 18:25, franck tankoua wrote:

Hi Evgeny. I have my own guice module based on JPA.


On Mon, Jul 12, 2010 at 5:56 PM, Evgeny Bogdanov<
evgeny.bogda...@epfl.ch
wrote:


The same problem is with a branches/2.0.x/

Franck, How did you add your own Guice JPA?



this is from my web.xml

  <context-param>
<param-name>guice-modules</param-name>
<param-value>
org.apache.shindig.common.PropertiesModule:
org.apache.shindig.gadgets.DefaultGuiceModule:
com.packagepath.MyJPAModule:
org.apache.shindig.gadgets.oauth.OAuthModule
     </param-value>
</context-param>



Did you also register it in web.xml


and added a module into profile "all" in shindig/pom.xml?

Actually I did not add anythinig to the "all" in the pom.xml.


Basically I am not using shindig-server but my own application web.xml
to
which I have add the shindig guice modules.

So I am not sure what you are trying to achieve but may be by explaining
me
I can share better my experience with the JPA implementation.





Or did you add some dependencies?

I think I know what is going on. i have download a fresh shindig from
trunk


and I have done what you have said. It does not work either. It looks
like
you have forgot this in your stacktrace.

2010-07-12 18:21:32.312:INFO::No Transaction manager found - if your
webapp
requires one, please configure one.

After you configure the transaction manager it should not trash anymore.

hope it helps

Sure I have added dependencies to hibernate



On 12.07.10 15:59, franck tankoua wrote:



http://svn.apache.org/repos/asf/shindig/branches/2.0.x/
<http://svn.apache.org/repos/asf/shindig/branches/2.0.x/>

On Mon, Jul 12, 2010 at 3:49 PM, Evgeny Bogdanov<
evgeny.bogda...@epfl.ch


wrote:





Where do you take shindig 2.0 release (I can't find it)? Or do you
mean
trunk here?


On 12.07.10 15:18, franck tankoua wrote:





I am using my own JPA implementation and the shindig 2.0 release.
things work fine so far.

I will try to add JPAModule and let you know. which version of
shindig
are
you using? the trunk version ?

On Mon, Jul 12, 2010 at 2:38 PM, Evgeny Bogdanov<
evgeny.bogda...@epfl.ch




wrote:








Thank you Franck for helping!

still the same
Does it work for you?


On 12.07.10 14:27, franck tankoua wrote:







what if you remove the space line before JPASocialModule?

On Mon, Jul 12, 2010 at 2:25 PM, Evgeny Bogdanov<
evgeny.bogda...@epfl.ch






wrote:











On 12.07.10 14:19, franck tankoua wrote:









Just out of curiosity. which version are you using?










Do you mean shindig? (latest trunk shindig)
$ mvn --version
Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200)
Java version: 1.6.0_20
Java home:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.4" arch: "x86_64" Family:
"mac"








could you paste also the web.xml param-value for your param-name
*
guice-modules* .










<context-param>
<param-name>guice-modules</param-name>
<param-value>
      org.apache.shindig.common.PropertiesModule:
      org.apache.shindig.gadgets.DefaultGuiceModule:
      org.apache.shindig.social.core.config.SocialApiGuiceModule:
      org.apache.shindig.social.sample.SampleModule:


  org.apache.shindig.social.opensocial.jpa.spi.JPASocialModule:
      org.apache.shindig.gadgets.oauth.OAuthModule:
      org.apache.shindig.common.cache.ehcache.EhCacheModule:
      org.apache.shindig.sample.shiro.ShiroGuiceModule:

  org.apache.shindig.sample.container.SampleContainerGuiceModule:
      org.apache.shindig.extras.ShindigExtrasGuiceModule:
      org.apache.shindig.extras.as.ActivityStreamsGuiceModule
</param-value>
</context-param>










On Mon, Jul 12, 2010 at 2:04 PM, Evgeny Bogdanov<
evgeny.bogda...@epfl.ch








wrote:














Probably misunderstood you before ...
I did now:
$cd java/samples
$mvn
Build Successful


On 12.07.10 13:02, franck tankoua wrote:











were you able to successfully run mvn at /java/samples level?

On Mon, Jul 12, 2010 at 12:57 PM, Evgeny Bogdanov
<evgeny.bogda...@epfl.ch>wrote:













Sorry for spamming but I still can't get a working version.

This is what I did based on the suggestions here.

1) I've checked out a latest shindig version.
2) I added a Guice module

"org.apache.shindig.social.opensocial.jpa.spi.JPASocialModule:"
into java/server/src/main/webapp/WEB-INF/web.xml
3) I added java/samples into shindig/pom.xml for profile
"all"
<profile>
<id>all</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>features</module>
<module>java/common</module>
<module>java/gadgets</module>
<module>java/social-api</module>
<module>java/samples</module>
<module>java/server</module>
<module>extras</module>
</modules>
</profile>

4) I compile the code with command
mvn package -Dmaven.test.skip

5) Than I go to the java/server and run "mvn jetty:run"

However it can't find a class
org.apache.shindig.social.opensocial.jpa.spi.JPASocialModule

java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.apache.shindig.social.opensocial.jpa.spi.JPASocialModule
        at







org.apache.shindig.common.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:63)
I would be very happy if somebody could help or give a hint
on
what
I
am
doing wrong

Thanks in advance
Evgeny
























































.

Index: 
java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java
===================================================================
--- 
java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java
       (revision 964051)
+++ 
java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java
       (working copy)
@@ -34,6 +34,9 @@
 import org.apache.shindig.social.opensocial.service.MessageHandler;
 import org.apache.shindig.social.opensocial.service.PersonHandler;
 
+import  org.apache.shindig.social.opensocial.oauth.OAuthDataStore;
+import org.apache.shindig.social.sample.oauth.SampleOAuthDataStore;
+
 import java.util.List;
 import java.util.Set;
 
@@ -68,6 +71,8 @@
     
bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.atom")).to(
         BeanXStreamAtomConverter.class);
 
+    bind(OAuthDataStore.class).to(SampleOAuthDataStore.class);
+
     bind(new TypeLiteral<List<AuthenticationHandler>>(){}).toProvider(
         AuthenticationHandlerProvider.class);
 
Index: java/social-api/pom.xml
===================================================================
--- java/social-api/pom.xml     (revision 964051)
+++ java/social-api/pom.xml     (working copy)
@@ -84,9 +84,93 @@
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
+    
+    <dependency>
+      <groupId>org.apache.shindig</groupId>
+      <artifactId>shindig-samples</artifactId>
+      <version>${project.version}</version>
+    </dependency>
 
     <!-- external depenencies -->
     <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>5.1.6</version>
+    </dependency>    
+    <dependency>
+      <groupId>com.google.inject</groupId>
+      <artifactId>guice</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.persistence</groupId>
+      <artifactId>persistence-api</artifactId>
+      <version>1.0</version>
+    </dependency>
+     <dependency>
+      <groupId>org.eclipse.persistence</groupId>
+      <artifactId>eclipselink</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <version>10.4.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-dbcp</groupId>
+      <artifactId>commons-dbcp</artifactId>
+      <version>1.2.2</version>
+    </dependency>
+    <dependency>
+      <artifactId>commons-collections</artifactId>
+      <groupId>commons-collections</groupId>
+    </dependency>
+    <dependency>
+      <artifactId>commons-io</artifactId>
+      <groupId>commons-io</groupId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.collections</groupId>
+      <artifactId>google-collections</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>net.oauth.core</groupId>
+      <artifactId>oauth-httpclient4</artifactId>
+    </dependency>
+
+    <!-- Hibernate -->
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate</artifactId>
+      <version>3.2.6.ga</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-annotations</artifactId>
+      <version>3.3.1.GA</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-entitymanager</artifactId>
+      <version>3.3.1.ga</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-tools</artifactId>
+      <version>3.2.0.ga</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>ejb3-persistence</artifactId>
+      <version>1.0.1.GA</version>
+    </dependency>
+
+    <!-- external depenencies -->
+    <dependency>
       <groupId>org.json</groupId>
       <artifactId>json</artifactId>
     </dependency>
Index: java/samples/src/main/resources/socialjpa.properties
===================================================================
--- java/samples/src/main/resources/socialjpa.properties        (revision 
964051)
+++ java/samples/src/main/resources/socialjpa.properties        (working copy)
@@ -15,12 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-db.driver=org.apache.derby.jdbc.EmbeddedDriver
-db.url=jdbc:derby:target/testdb;create=true
-db.user=sa
-db.password=
+db.driver=com.mysql.jdbc.Driver
+db.url=jdbc:mysql://localhost:3306/shindig
+db.user=shindig
+db.password=shindig
 db.write.min=1
 db.read.min=1
 jpa.socialapi.unitname=default
-
+ 
 shindig.canonical.json.db=sampledata/canonicaldb.json
Index: java/server/src/main/webapp/WEB-INF/web.xml
===================================================================
--- java/server/src/main/webapp/WEB-INF/web.xml (revision 964051)
+++ java/server/src/main/webapp/WEB-INF/web.xml (working copy)
@@ -30,16 +30,12 @@
   <context-param>
     <param-name>guice-modules</param-name>
     <param-value>
-      org.apache.shindig.common.PropertiesModule:
-      org.apache.shindig.gadgets.DefaultGuiceModule:
-      org.apache.shindig.social.core.config.SocialApiGuiceModule:
-      org.apache.shindig.social.sample.SampleModule:
-      org.apache.shindig.gadgets.oauth.OAuthModule:
-      org.apache.shindig.common.cache.ehcache.EhCacheModule:
-      org.apache.shindig.sample.shiro.ShiroGuiceModule:
-      org.apache.shindig.sample.container.SampleContainerGuiceModule:
-      org.apache.shindig.extras.ShindigExtrasGuiceModule:
-      org.apache.shindig.extras.as.ActivityStreamsGuiceModule
+            org.apache.shindig.common.PropertiesModule:
+            org.apache.shindig.gadgets.DefaultGuiceModule:
+            org.apache.shindig.social.core.config.SocialApiGuiceModule:
+            org.apache.shindig.social.opensocial.jpa.spi.JPASocialModule:
+            org.apache.shindig.gadgets.oauth.OAuthModule:
+            org.apache.shindig.common.cache.ehcache.EhCacheModule:
     </param-value>
   </context-param>
 
Index: java/common/conf/shindig.properties
===================================================================
--- java/common/conf/shindig.properties (revision 964051)
+++ java/common/conf/shindig.properties (working copy)
@@ -31,8 +31,8 @@
 
 ### Outbound OAuth support
 shindig.signing.state-key=
-shindig.signing.key-name=
-shindig.signing.key-file=
+shindig.signing.key-name=mytestkey
+shindig.signing.key-file=./ssl_keys/oauthkey.pem
 shindig.signing.global-callback-url=http://localhost:8080/gadgets/oauthcallback
 shindig.signing.enable-signed-callbacks=true
 
Index: ssl_keys/testkey.pem
===================================================================
--- ssl_keys/testkey.pem        (revision 0)
+++ ssl_keys/testkey.pem        (revision 0)
@@ -0,0 +1,29 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQCT5JYgOJNpfGJjKwZW+2RtGKKw952zgew/ecjY+fwhEpRUYqD/
+9vIppQl3K2PCti6ZR1ZGK3C25CUhOfmoefEEgW9ccbeSVdfHR94GaZnsh8Kc+kQm
+bnv+L4IxDewdoJlzzUXQRvi6gcB14aZEog2A0mW+6dUJ1YjXJX2KbDLZGwIDAQAB
+AoGAM0umknhtELp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tjz1J3hYrVIp8lZKIRva243UZMEQGA1UdIwQ9MDuAFKLtjz1J3hYrVIp8
+lZKIRva243UZoRikFjAUMRIwEAYDVQQDEwlteXRlc3RrZXmCCQCbdiBRfC+WmzAM
+BgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAFByazPiICa7X4nw7ZeWrBDt
+o4RFstlJbMHsJjB8jIfQN3z79xrHGQJUWT8RN4NtxhifJpQVnDft21JJXXyPm7o+
+VelN1Q1CFkUvcN+ft2+d/vHuimDUQjmezi16oAiqGGVk5JbEajpDuKZ7sSE/FrXd
+jq8uMunCdukw0G+EK3ld
+-----END CERTIFICATE-----
Index: ssl_keys/oauthkey.pem
===================================================================
--- ssl_keys/oauthkey.pem       (revision 0)
+++ ssl_keys/oauthkey.pem       (revision 0)
@@ -0,0 +1,16 @@
+-----BEGIN PRIVATE KEY-----
+MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJPkliA4k2l8YmMr
+Blb7ZG0YorD3nbOB7D95yNj5/CESlFRioP/28imlCXcrY8K2LplHVkYrcLbkJSE5
++ah58QSBb1xxt5JV18dH3gZpmeyHwpz6RCZue/4vgjEN7B2gmXPNRdBG+LqBwHXh
+pkSiDYDSZb7p1QnViNclfYpsMtkbAgMBAAECgYAzS6aSeG0Qula5xLOHOdykRlYv
+gUMOfvK9NXVnZJWBtxsBhdAH19Q4g4ib783DPEM/YNHYtrp6hPkn5B7mw5zHh03m
+Oyfe6NUl9SMmPlLbYTL/3VD7gMFZFaxZFQL6s2pZRNYj092MHAtWd2SpT1sm167V
+I2RMXP/nKDzOzGVsaQJBAMQxLtnllDDzeSSYlZhz4qUvvpw5PSXUra3K0g63WRTr
+q1G+naFwFR1vMw07rvBhKuxT1ekmUbgdS5TI+tlxVeUCQQDA+iMsyJxTCyDTsRGc
+2JSzo9nqTZ545v4UKhn0sqXoennwLUjbA3XKlYEC2UimQmmqaB+79LdbZInRawTA
+8IL/AkBnH7MQtav/TvsOUWXQjJlFWqNGWo/ZosDn6QQg2B7q8DVM8nTItrFil2Cu
+RADgOTLmpep6crnhnQRtYHb6dKhBAkEAoWWTXbU66Ul5XxPNAz0wwT3c19WrILsw
+7XR42OtBTzqAGZwGPwaZ0aFQkS1hUYxiC5+iSvTVFZ70lS3IgAWnyQJBALZbKDZF
+BLIY6GT+TdDlBX9NaTtNvC04cfbP/3vK2QoISi652VfMnJSbYbXd19dv2gFhzh9g
+qj3f4PMHeYUUVzU=
+-----END PRIVATE KEY-----

Reply via email to