cancel
Showing results for 
Search instead for 
Did you mean: 

How to use JCR api in web application

itsard
Champ in-the-making
Champ in-the-making
Hi,
I wish to use the JCR apis and so I am trying to embed the Alfresco in my web application.
I have taken all the jars provided in the server folder of the alfresco 3.0 stable sdk and copied the properties file of config.jar in my properties folder set
in classpath. I am not able to call the jcr api as while loading the application-context.xml it throws error.
Is there any link for steps to embed alfresco in a web application to use the JCR api.Can anyone kindly let me know how do I use the JCR api from
my application.
Thanks
1 REPLY 1

cdifulco
Champ in-the-making
Champ in-the-making
Hi itsard,
I'm facing quite the same challange of you: I'm trying to use JCR to make a custom library and then to call the classes of my library from within a jsp web application.
The problem is that tomcat is not able to compile my library.

Here's the jsp code:


<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@ page import= "d2b.simpleClient.SearchService_v2;" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</head>
<body>
   
   
   <br/>
   <h1>Risultato della Ricerca: </h1>
   
   <%
      
   SearchService_v2 scdq = new SearchService_v2();
      scdq.setUser("admin");
      scdq.setPassword("admin");
      scdq.setFolderPath("PATH:\"/app:guest_home");
      scdq.doExamples();
   %>
</body>
</html>


where
d2b.simpleClient
is the name of my library, and
SearchService_v2
is the class that I want to call.

And here's the error message:


GRAVE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 20 in the jsp file: /principale.jsp
SearchService_v2 cannot be resolved to a type
17:    
18:    <%
19:       
20:       SearchService_v2 scdq = new SearchService_v2();
21:       
22:       out.println(scdq.ciao());
23:    %>


An error occurred at line: 20 in the jsp file: /principale.jsp
SearchService_v2 cannot be resolved to a type
17:    
18:    <%
19:       
20:       SearchService_v2 scdq = new SearchService_v2();
21:       
22:       out.println(scdq.ciao());
23:    %>


Stacktrace:
   at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
   at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
   at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
   at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)


if you have any suggestion they're welcome!

Thanks
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.