Aditya S Posted April 17, 2012 Share Posted April 17, 2012 Hi, I am trying to configure my web application to load sample jasperserver reports. I have installed jasperserver-4.5.0-ce on my machine with a new tomcat instance. In the C:\Program Files\jasperreports-server-cp-4.5.0\samples\java-webapp-sample folder, the README file says :==============================To run the java webapp sample, first locate the sample war file: <js-install>/samples/java-webapp-sample/target/jasperserver-ws-sample.war copy it to your application server location (for instance tomcat) <tomcat>/webapps==============================The issue here is that I am not able to find the war file in the <js-install> directory. Only source files are available at "C:\Program Files\jasperreports-server-cp-4.5.0\samples\java-webapp-sample\jasperserver-ws-sample-war". There is no target directory. I am assuming I might have to build it, but i dont see any instructions on how to do that. Any help will be greatly appreciated. Link to comment Share on other sites More sharing options...
Ching Ice-creaming Posted April 17, 2012 Share Posted April 17, 2012 Do you install maven.apache.org first ? Under directory jasperreports-server-cp-4.5.1/java-webapp-sample/, there is a file pom.xmlYou can type "mvn install" to build this war file. Link to comment Share on other sites More sharing options...
Aditya S Posted April 17, 2012 Author Share Posted April 17, 2012 When I tried running "mvn install", I got warnings and then it failed. Warnings:-----------------------[WARNING] Some problems were encountered while building the effective model for com.jaspersoft.jasperserver:jasperserver-ws-sample-war:war:4.5.0[WARNING] The expression ${pom.version} is deprecated. Please use ${project.version} instead.----------------------I tried updating pom.xml, but got the error that the file is used by other application and cannot be saved. Finally the build failed with this error: ------------------------------[ERROR] Failed to execute goal on project jasperserver-ws-sample-jar: Could not resolve dependencies for project com.jaspersoft.jasperserver:jasperserver-ws-sample-jar:jar:4.5.0: The following artifacts could not be resolved: net.sf.jasperreports:jasperreports:jar:4.5.0.2, com.jaspersoft.jasperserver:jasperserver-common-ws:jar:4.5.0, com.jaspersoft.jasperserver:jasperserver-ws-client:jar:4.5.0, com.jaspersoft.jasperserver:jasperserver-ireport-plugin:jar:4.5.0: Could not find artifact net.sf.jasperreports:jasperreports:jar:4.5.0.2 in central (http://repo.maven.apache.org/maven2) -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException[ERROR][ERROR] After correcting the problems, you can resume the build with the command[ERROR] mvn <goals> -rf :jasperserver-ws-sample-jar--------------------------- I have maven 3.0.4 installed on my machine. Where can be the issue? Link to comment Share on other sites More sharing options...
Aditya S Posted April 17, 2012 Author Share Posted April 17, 2012 I tried the same "mvn install" with Maven 2.2.1. This time I got this error:----------------------------[ERROR] BUILD ERROR[iNFO] ------------------------------------------------------------------------[iNFO] Cannot create resource output directory: C:\Program Files\jasperreports-server-cp-4.5.0\samples\java-webapp-sample\jasperserver-ws-sample-jar\target\classes [iNFO] ------------------------------------------------------------------------[iNFO] Traceorg.apache.maven.lifecycle.LifecycleExecutionException: Cannot create resource output directory: C:\Program Files\jasperreports-server-cp-4.5.0\samples\java-webapp-sample\jasperserver-ws-sample-jar\target\classes at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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: Cannot create resource output directory: C:\Program Files\jasperreports-server-cp-4.5.0\samples\java-webapp-sample\jasperserver-ws-sample-jar\target\classes at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:166) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) ... 17 moreCaused by: org.apache.maven.shared.filtering.MavenFilteringException: Cannot create resource output directory: C:\Program Files\jasperreports-server-cp-4.5.0\samples\java-webapp-sample\jasperserver-ws-sample-jar\target\classes at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:215) at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:162) ... 19 more Any clue? Link to comment Share on other sites More sharing options...
Ching Ice-creaming Posted April 17, 2012 Share Posted April 17, 2012 Before I run "mvn install", I need to download jasperreports-server-cp-4.5.0-maven-repository.zip and unzip it to $HOME/.m2/repository I am using it at linux and I have no idea of making it work at Windows. Link to comment Share on other sites More sharing options...
Aditya S Posted April 17, 2012 Author Share Posted April 17, 2012 Thanks. I'll try and keep you posted. Link to comment Share on other sites More sharing options...
Aditya S Posted April 17, 2012 Author Share Posted April 17, 2012 I extracted jasperreports-server-cp-4.5.0-maven-repository.zip in %HOME%/.m2/repository. Now I am getting mondrian dependency issue: [iNFO] Unable to find resource 'commons-logging:commons-logging:jar:1.0.2' in repository jasperreports (http://jasperreports.sourceforge.net/maven2)Downloading: http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar[iNFO] Unable to find resource 'mondrian:mondrian:jar:3.2.0-13661' in repository central (http://repo1.maven.org/maven2) [iNFO] ------------------------------------------------------------------------[ERROR] BUILD ERROR[iNFO] ------------------------------------------------------------------------[iNFO] Failed to resolve artifact. Missing:----------1) mondrian:mondrian:jar:3.2.0-13661 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=mondrian -DartifactId=mondrian -Dversion=3.2.0-13661 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=mondrian -DartifactId=mondrian -Dversion=3.2.0-13661 -Dpackaging=jar -Dfile=/path/to/file -Durl= -DrepositoryId=[id] Path to dependency: 1) com.jaspersoft.jasperserver:jasperserver-ws-sample-jar:jar:4.5.0 2) com.jaspersoft.jasperserver:jasperserver-common-ws:jar:4.5.0 3) com.jaspersoft.jasperserver.core.util:jasperserver-core-util:jar:4.5.0 4) com.jaspersoft.jasperserver.api.engine:jasperserver-api-engine:jar:4.5.0 5) com.jaspersoft.jasperserver.api.metadata:jasperserver-api-metadata:jar:4.5.0 6) jaspersoft.ji-pro.ji-jpivot-ui:ji-jpivot:jar:4.0.1 7) mondrian:mondrian:jar:3.2.0-13661 ----------1 required artifact is missing. for artifact: com.jaspersoft.jasperserver:jasperserver-ws-sample-jar:jar:4.5.0 from the specified remote repositories: central (http://repo1.maven.org/maven2) Is there any place I need to download mondrian and common_logging? Link to comment Share on other sites More sharing options...
Aditya S Posted April 18, 2012 Author Share Posted April 18, 2012 Finally managed to get it working. The issue was with jasperreports-server-cp-4.5.0-maven-repository.zip. After extracting files into %USER_HOME%\.m2\repository (same as linux), I found %USER_HOME%\.m2\repository\mondrian\mondrian\3.2.0-13661-JS-2 folder with the mondrian jar/pom/sha1 file also having "-JS-2" suffix. After renaming the files as well as folder to "3.2.0-13661" instead of "3.2.0-13661-JS-2", the mvn install worked perfectly fine. Hope this helps someone facing similar issue and the same can be fixed in the jasperreports-server-cp-4.5.0-maven-repository.zip on jasper website. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now