My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
friendforsale_sample_manual  

Featured
Updated Feb 6, 2009 by opensoci...@gmail.com

friendforsale sample build instruction(JAVA Version)

Prequisites before building friendforsale sample

In order to build sample, you must have the following:

  • Java (JDK/JRE) 1.5 or later installed on your system and the JAVA_HOME environment variable set.
  • o See: http://java.sun.com/ for installation instructions.
  • A Subversion client installed in order to checkout the code.
  • o Instructions for downloading and installing Subversion can be found here: http://subversion.tigris.org/
  • Apache Maven installed to perform the build.
  • o Instructions for downloading and installing Maven can be found here: http://maven.apache.org/download.html

Getting the code

Create a subdirectory and checkout the sample code from its Subversion repository

  1. mkdir ~/easy-opensocial-apps (or wherever you'd like to put it)
  2. cd ~/easy-opensocial-apps
  3. svn co http://easy-opensocial-apps.googlecode.com/svn/trunk/ .

Or download via this url http://easy-opensocial-apps.googlecode.com/files/friendforsale-java-1.0.zip and extract

Building and running the code:

To build a Web Archive(WAR) file:
  1. cd ~/easy-opensocial-apps/javascriptAPI/server/java/friendforsale
  2. mvn package
  3. Once the build successfully completes, you can install the built WAR files located in the /target subdirectory onto your JEE server.

To run friendforsale sample on jetty:
  1. cd ~/easy-opensocial-apps/javascriptAPI/server/java/friendforsale
  2. mvn jetty:run [-Djetty.port=<port>]
The XML spec you can access via http://localhost:<port>/friendsale.xml
You can add this url to SNS which support opensocial or shindig run locally.

More configuration:

Database:
The database configuration file at: ~\easy-opensocial-apps\javascriptAPI\server\java\friendforsale\src\main\resources\META-INF\persistence.xml
The sample use "default" persistence-unit which use a hsqldb database, You can change the setting to your own database
Server Setting:
Use ~easy-opensocial-apps\javascriptAPI\client\friendforsale\i18n\ALL_ALL.xml config your client and server by edit the following line:
<msg name="frontendURL">http://localhost</msg> <msg name="backendURL">http://localhost</msg>
for example: if your want change the server to python or php backend,you can change the backendURL.


friendforsale使用指南

安装friendforsale应用示例的条件:

你必须有以下东西:

获得代码:

建立一个文件夹然后checkout代码

  1. mkdir ~/easy-opensocial-apps (或者别的地方)
  2. cd ~/easy-opensocial-apps
  3. svn co http://easy-opensocial-apps.googlecode.com/svn/trunk/ .

或者从下面的url下载 http://easy-opensocial-apps.googlecode.com/files/friendforsale-java-1.0.zip 然后解压

编译并运行代码:

打包成WAR:
  1. cd ~/easy-opensocial-apps/javascriptAPI/server/java/friendforsale
  2. mvn package
  3. 编译成功后,你可以在/target目录下找到WAR文件,并可以发布到你自己的JEE服务器上.

在jetty上运行friendforsale示例:
  1. cd ~/easy-opensocial-apps/javascriptAPI/server/java/friendforsale
  2. mvn jetty:run [-Djetty.port=<port>]
XML文件在下面地址应该可以访问到 http://localhost:<port>/friendsale.xml
你可以把这个url添加到支持opensocial的SNS网站上,或者自己本地的shindig服务器上

更多配置:

数据库:
数据库的配置文件在: ~\easy-opensocial-apps\javascriptAPI\server\java\friendforsale\src\main\resources\META-INF\persistence.xml
示例中使用的"default"持久化单元,使用的是hsqldb数据库 你可以修改配置用你自己的数据库
服务器设置:
在下面的文件中配置你前端xml和后端数据服务的地址 ~easy-opensocial-apps\javascriptAPI\client\friendforsale\i18n\ALL_ALL.xml
<msg name="frontendURL">http://localhost</msg> <msg name="backendURL">http://localhost</msg>
比如你可以用python的后端数据服务,只要修改backendURL的值即可

Comment by gengfang...@gmail.com, May 20, 2009

在打包的时候得到如下错误,敬请指点。谢谢!

Microsoft Windows XP [版本 5.1.2600] (C) 版权所有 1985-2001 Microsoft Corp.

D:\easy-opensocial-apps\easy-opensocial-apps\javascriptAPI\server\java\friendfor sale>mvn package -e + Error stacktraces are turned on. INFO? Scanning for projects... INFO? ------------------------------------------------------------------------ INFO? Building friendforsale INFO? task-segment: package? INFO? ------------------------------------------------------------------------ INFO? [resources:resources] WARNING? Using platform encoding (GB18030 actually) to copy filtered resources,

i.e. build is platform dependent!
INFO? Copying 6 resources to ../friendforsale-1.0-SNAPSHOT/common INFO? Copying 18 resources to ../friendforsale-1.0-SNAPSHOT/ INFO? Copying 5 resources to / INFO? ------------------------------------------------------------------------ ERROR? BUILD ERROR INFO? ------------------------------------------------------------------------ INFO? \\config\catalog.xml (找不到网络路径。)

INFO? ------------------------------------------------------------------------ INFO? Trace org.apache.maven.lifecycle.LifecycleExecutionException?: \\config\catalog.xml (找 不到网络路径。)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoals(Defa
ultLifecycleExecutor.java:703)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoalWithLi
fecycle(DefaultLifecycleExecutor?.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoal(Defau
ltLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor?.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeTaskSegmen
ts(DefaultLifecycleExecutor?.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.execute(DefaultLi?
fecycleExecutor.java:181)
at org.apache.maven.DefaultMaven?.doExecute(DefaultMaven?.java:356) at org.apache.maven.DefaultMaven?.execute(DefaultMaven?.java:137) at org.apache.maven.cli.MavenCli?.main(MavenCli?.java:356) at sun.reflect.NativeMethodAccessorImpl?.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl?.invoke(NativeMethodAccessorImpl?.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl?.invoke(DelegatingMethodAcces?
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Caused by: org.apache.maven.plugin.MojoExecutionException?: \\config\catalog.xml (找不到网络路径。)

at org.apache.maven.plugin.resources.ResourcesMojo?.execute(ResourcesMojo?
.java:166)
at org.apache.maven.plugin.DefaultPluginManager?.executeMojo(DefaultPlugi?
nManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor?.executeGoals(Defa
ultLifecycleExecutor.java:678)
... 16 more
Caused by: org.apache.maven.shared.filtering.MavenFilteringException?: \\config\c atalog.xml (找不到网络路径。)
at org.apache.maven.shared.filtering.DefaultMavenFileFilter?.copyFile(Def
aultMavenFileFilter.java:96)
at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering?.filt
erResources(DefaultMavenResourcesFiltering?.java:293)
at org.apache.maven.plugin.resources.ResourcesMojo?.execute(ResourcesMojo?
.java:162)
... 18 more
Caused by: java.io.FileNotFoundException?: \\config\catalog.xml (找不到网络路径。 )
at java.io.FileOutputStream?.open(Native Method) at java.io.FileOutputStream?.<init>(FileOutputStream?.java:179) at java.io.FileOutputStream?.<init>(FileOutputStream?.java:131) at org.codehaus.plexus.util.FileUtils?.copyStreamToFile(FileUtils?.java:10
58)
at org.codehaus.plexus.util.FileUtils?.copyFile(FileUtils?.java:965) at org.codehaus.plexus.util.FileUtils?.copyFile(FileUtils?.java:2051) at org.apache.maven.shared.filtering.DefaultMavenFileFilter?.copyFile(Def
aultMavenFileFilter.java:91)
... 20 more
INFO? ------------------------------------------------------------------------ INFO? Total time: 8 seconds INFO? Finished at: Thu May 21 14:08:49 CST 2009 INFO? Final Memory: 7M/13M INFO? ------------------------------------------------------------------------ D:\easy-opensocial-apps\easy-opensocial-apps\javascriptAPI\server\java\friendfor sale>

Comment by mtss...@163.com, Aug 27, 2009

我也遇到同样的问题 请各位指教

Comment by ruiyu...@gmail.com, Oct 12, 2009

INFO? \\META-INF\persistence.xml (找不到网络路径。)

编译碰到不少问题

Comment by ruiyu...@gmail.com, Oct 14, 2009

opensocial-common那个工程直接用mvn compile通过不了,我后来用ant编译放到mvn的repository里面,再编译friendforsale通过 friendforsale的pom.xml需要改一个地方

<resource>
<directory>${basedir}/src/main/resources/</directory> <targetPath>/</targetPath> <includes>
<include>/.</include>
</includes>
</resource>

中的<targetPath>/</targetPath>改为<targetPath>.</targetPath> 不然复制时候出错。不知为啥。、

编译后,加载到tomcat或者运行jetty,添加到socialsite里面,friendsale只能显示

loading.....

根本用不了


Sign in to add a comment
Powered by Google Project Hosting