Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7564267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:51:54+00:00 2026-05-30T13:51:54+00:00

my company is looking into using Adobe CQ5 as a new content management system

  • 0

my company is looking into using Adobe CQ5 as a new content management system and I’ve been given the task of figuring out how to do certain things with it.

One thing we would like to do is use some JARs we created for our old web-apps in scriptlets within our JSP pages, possibly to call a service or something.

I looked into doing this with OSGi bundles but I don’t think it’s what we want to do.
Right now I’m having trouble figuring out where to put external libraries to be used in our JSP files.

I created a JAR that just has a generic class

package org.company.test;

import java.lang.String;

public class TestService{
    private String myString;
    public TestService(String input){myString = input;}
    public String getMyString(){return myString;}
}

That is the only thing in the jar.

I tried putting it in /crx-quickstart/server/lib/common

which the README for that folder says

“Put libraries in this folder that should be shared among all web applications and the server.”

but my JSP file has a few issues when I try to access it. This is the JSP file in its entirety:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ TR/html4/loose.dtd">
<%%>
<%@page session="false"%>
<%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%>
<sling:defineObjects/>

<%@ page import="javax.jcr.Repository, javax.jcr.Session, javax.jcr.SimpleCredentials, javax.jcr.Node, javax.jcr.NodeIterator,
                 java.net.URLEncoder, java.util.List, java.util.Iterator, javax.jcr.Value, javax.jcr.RepositoryException,org.company.test.TestService;"%>
<html>
    <head> 
        <style type="text/css"><jsp:include page="/content/myBlog/style.css"/></style>
        <!--<link rel="stylesheet" href="/content/myBlog/style.css" type="text/css">-->
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <% 
            TestService jServ = new TestService("TigerBlood");
            String returnValue = "Failed";
            if(jServ!=null){
                returnValue = jServ.getMyString();
            }            
        %>
        <title><%= returnValue %></title> 
    </head> 
    <body> 
        <a href="/content/myBlog.html" class="imgcontainer"><img src="/apps/myBlog/myBlog.png" width="80px" height="60px" border="0" alt="myBlog" /></a>
        <h1><%= returnValue %></h1>
        <div class="body">
            <br>
            <a href="/apps/myBlog/comment.html">Comment</a>
        </div>
    </body> 
</html>

When I navigate to it in a browser I get these errors:

Unable to compile class for JSP: An error occurred at line: 16 in the generated java file Only a type can be imported. org.company.test.TestService resolves to a package 

An error occurred at line: 17 in the jsp file: /apps/myBlog/test.jsp TestService cannot be resolved to a type  
14: <!--<link rel="stylesheet" href="/content/myBlog/style.css" type="text/css">-->  
15: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  
16: <%  
17: TestService jServ = new TestService("TigerBlood");  
18: String returnValue = "Failed";  
19: if(jServ!=null){  20: returnValue = jServ.getMyString(); 

An error occurred at line: 17 in the jsp file: /apps/myBlog/test.jsp TestService cannot be resolved to a type  
14: <!--<link rel="stylesheet" href="/content/myBlog/style.css" type="text/css">-->  
15: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  
16: <%  
17: TestService jServ = new TestService("TigerBlood");  
18: String returnValue = "Failed";  
19: if(jServ!=null){  
20: returnValue = jServ.getMyString();

I can fix the first error about the package by changing the import to com.company.test.* but it does not fix the other two errors.

I know this is not the best ‘practice’ for using services but I was hoping to just get a Proof of Concept going that shows we could use those libraries if we wanted. Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:51:55+00:00Added an answer on May 30, 2026 at 1:51 pm

    I’ve found the answer, you have to bundle external libraries as an OSGi bundle.

    The process can be found here

    It was surprisingly hard to find that answer and although it’s more time consuming than just adding a JAR, it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking into developing a new user registration system for my company. In
Our company is looking into allowing third party sites to use our online checkout
My company is looking into writing a custom application that will need to perform
I am looking into Cloud Computing for my company. The one question that I
My company recently purchased TFS and I have started looking into the code analysis
In my company management is looking for screen-pumping-machine/production-line-factory for data centric (form entry) windows
I'm looking into using Assembla for hosted SVN, is it possible to have the
I am looking into using a lightweight serverless database engine like SQLite, Firebird, or
I'm looking into using CakePHP to build a web application. The sticking point is
My company is looking into ASP.NET and Prism. We are wondering how much code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.