Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build and use Http service, the webconsole interface cannot be loaded #576

Open
Pangza opened this issue Jun 4, 2021 · 2 comments

Comments

@Pangza
Copy link

Pangza commented Jun 4, 2021

I am a novice, hoping to get answers from the big guys. I installed and started the webconsole bundle, how do I make the http service bundle publish a servlet to use the webconsole interface normally and use the http interface to implement http services?

@PrQiang
Copy link

PrQiang commented Nov 22, 2023

I use serveletContainer to start the webconsole, but tips "missing the context root property", please tell us how to fix this problem.
thanks so much.

@jeffdiclemente
Copy link
Member

disclaimer: The webconsole and httpservice sub-projects are experimental and not production ready so your mileage will vary.

It would be helpful if you can provide reproduction steps to help us help you debug the issue.

The string; "missing the context root property" comes from ServletContainer.cpp:

std::shared_ptr<ServletHandler>
    ServletContainerPrivate::AddingService(ServiceReference<HttpServlet> const& reference)
    {
        Any contextRoot = reference.GetProperty(HttpServlet::PROP_CONTEXT_ROOT);
        if (contextRoot.Empty())
        {
            std::cout << "HttpServlet from " << reference.GetBundle().GetSymbolicName()
                      << " is missing the context root property." << std::endl;
            return nullptr;
        }
...

It seems like a HttpServlet service wasn't registered with an appropriate service property called org.cppmicroservices.HttpServlet.contextRoot. I suggest debugging the process and checking the registration of HttpServlet services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants