Hi,
I followed in adobe cq5 document exactly store the data in my MySQL but i got problem in application when i am submitting user details it throw unable to retrieve data i import every thing jquery files and js files can help me am new to cq5 below document i follow.
http://helpx.adobe.com/experience-manager/using/querying-persisting-cq-data-mysql.html
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
This JSP code:
var url = location.pathname.replace(".html", "/_jcr_content.query.json") + "?filter="+ filter;
sends a request to this JS file:
<%@include file="/libs/foundation/global.jsp"%>
<%@ page import="org.apache.sling.commons.json.io.*,org.w3c.dom.*" %><%
String filter = request.getParameter("filter");
com.adobe.aem.sql.CustomerServiceImp cs = new com.adobe.aem.sql.CustomerServiceImp();
String XML = cs.getCustomerData(filter);
//Send the data back to the client
JSONWriter writer = new JSONWriter(response.getWriter());
writer.object();
writer.key("xml");
writer.value(XML);
writer.endObject();
%>
This JS file creates an object of type com.adobe.aem.sql.CustomerServiceImp. This Java class is bundled in the OSGi that you created.
There are three places where something may be wrong:
1. You did not setup the connection class properly.
2. The drvier file is not bundled.
3. The main page JSP is not finding the query.js file.
Please post your log file - we can tell what is happening from that.
Views
Replies
Total Likes
Try this article
http://helpx.adobe.com/experience-manager/using/datasourcepool.html
The difference is you are using a DataSourcePool to connect instead of writing a custom connection handler.
Views
Replies
Total Likes
Hi,
can you provide some logs (e.g. uploading somwhere and posting the link here?); it's hard to do a problem analysis based on the information you provided.
Thanks,
Jörg
Views
Replies
Total Likes
I just re-tested that article - it produced the following CQ app:
[img]client.png[/img]
If you are still having issues, email me at scottm@adobe.com. I can setup a connect session.
Views
Replies
Total Likes
Hi ,
I followed that one also i tried more times but am not getting ,when i entered user details custId showing "Zero" and not adding details.
i have doubt in this jsp code
var ur = location.pathname.replace(".html", "/_jcr_content.query.json")
can u explain i shared screen shot can u guide me how to form data storing Mysql database
Thanks.
Views
Replies
Total Likes
Also did you deploy a database driver file in an osgi bundle?
Views
Replies
Total Likes
Hi,
Thank you very much giving response.
i have server problem so i taken the backup of my project, once done i try to implement document same u given. still if have any issue i will let u know.
Thank You
Views
Replies
Total Likes
Hi ,
I tried again same problem coming,kindly check i attached error log file .
Kindly help me once check.
Thanks
Views
Replies
Total Likes
Hi,
I added my application jar file and below jar files
javax.xml.stream-1.0.1
mysql-connector-java-5.1.22-bin
javax.xml-1.3.4
can u see attached Bundle Information
Views
Replies
Total Likes
please find error screen
Views
Replies
Total Likes
From your log file:
05.12.2014 21:02:52.095 *ERROR* [192.168.1.108 [1417793572064] GET /content/templatecustomer/_jcr_content.persist.json HTTP/1.1] com.day.cq.wcm.core.impl.WCMDebugFilter Error during include of SlingRequestPathInfo: path='/content/templatecustomer/jcr:content', selectorString='persist', extension='json', suffix='null' org.apache.sling.api.scripting.ScriptEvaluationException:
It means that you have not setup the project files correctly. AEM cannot find persist.json file. Make sure you setup all the files exactly as shown in the article. Looks like you missed this step in the article:
Create the persist.json.jsp
Add a new JSP file named persist.json.jsp to the following CQ path:
/apps/sqlquery/components/page/mysqlTemplate
The following code represents the persist.json.jsp file.
<%@include file="/libs/foundation/global.jsp"%>
<%@ page import="org.apache.sling.commons.json.io.*,com.adobe.cq.*" %><%
String first = request.getParameter("first");
String last = request.getParameter("last");
String address = request.getParameter("address");
String desc = request.getParameter("desc");
com.adobe.aem.sql.CustomerServiceImp cs = new com.adobe.aem.sql.CustomerServiceImp();
int myPK = cs.injestCustData(first, last, address, desc) ;
//Send the data back to the client
JSONWriter writer = new JSONWriter(response.getWriter());
writer.object();
writer.key("pk");
writer.value(myPK);
writer.endObject();
%>
Views
Replies
Total Likes
Hi ,
i followed what you say exactly.
i build in crxde component and template and jsp's same project struture in Adobe document.
but application not working.
thanks
Views
Replies
Total Likes
Can you please post your CQ log file. There is a reason why the data is not being returned that leads to the JSON data.
Views
Replies
Total Likes
ZIP up your package and send to me at scottm@adobe.com. I want to look at your code then I will find out where the issue is.
Views
Replies
Total Likes
This JSP code:
var url = location.pathname.replace(".html", "/_jcr_content.query.json") + "?filter="+ filter;
sends a request to this JS file:
<%@include file="/libs/foundation/global.jsp"%>
<%@ page import="org.apache.sling.commons.json.io.*,org.w3c.dom.*" %><%
String filter = request.getParameter("filter");
com.adobe.aem.sql.CustomerServiceImp cs = new com.adobe.aem.sql.CustomerServiceImp();
String XML = cs.getCustomerData(filter);
//Send the data back to the client
JSONWriter writer = new JSONWriter(response.getWriter());
writer.object();
writer.key("xml");
writer.value(XML);
writer.endObject();
%>
This JS file creates an object of type com.adobe.aem.sql.CustomerServiceImp. This Java class is bundled in the OSGi that you created.
There are three places where something may be wrong:
1. You did not setup the connection class properly.
2. The drvier file is not bundled.
3. The main page JSP is not finding the query.js file.
Please post your log file - we can tell what is happening from that.
Views
Replies
Total Likes