All Products
Search
Document Center

Enterprise Distributed Application Service:HSF-0005: Service object not configured

Last Updated:Mar 11, 2026

High-speed Service Framework (HSF) throws error HSF-0005 (java.lang.IllegalArgumentException) at application startup when it cannot find the implementation object for a published service bean.

Error message

java.lang.IllegalArgumentException: The object to be published as a service is not configured.
Service name: com.taobao.hsf.jar.test.HelloWorldService:1.0.zhouli

When this error occurs

During startup, HSF scans all configured service beans and attempts to publish them to the service registry. If a bean declaration references a missing or misconfigured implementation object, HSF throws this error and the application fails to start.

Possible causes

CauseDescription
Missing target attributeThe service provider bean does not specify a target attribute pointing to the implementation bean.
Invalid implementation classThe target attribute references a class that does not exist in the classpath.

Troubleshooting steps

Cause 1: Missing target attribute

The target attribute in the HSF service provider bean tells HSF which Spring bean implements the service interface. Without this attribute, HSF cannot locate the implementation object.

Fix: Add the target attribute to your service provider bean in the Spring XML configuration file. The target attribute must reference the bean that implements the service interface.

<!-- Incorrect: missing target attribute -->
<bean id="myServiceProvider" class="<HSFSpringProviderBean-class>">
    <property name="serviceInterface" value="<your-service-interface>" />
    <property name="serviceVersion" value="<your-service-version>" />
    <!-- No target attribute - HSF cannot find the implementation object -->
</bean>

<!-- Correct: target attribute references the implementation bean -->
<bean id="myServiceProvider" class="<HSFSpringProviderBean-class>">
    <property name="serviceInterface" value="<your-service-interface>" />
    <property name="serviceVersion" value="<your-service-version>" />
    <property name="target" ref="myServiceImpl" />
</bean>

<!-- The implementation bean that target references -->
<bean id="myServiceImpl" class="<your-implementation-class>" />

Replace the following placeholders with your actual values:

PlaceholderDescription
<HSFSpringProviderBean-class>The fully qualified class name of the HSF Spring provider bean
<your-service-interface>The service interface to publish, for example, com.taobao.hsf.jar.test.HelloWorldService
<your-service-version>The service version, for example, 1.0.zhouli
<your-implementation-class>The class that implements the service interface

Cause 2: Invalid implementation class

The target attribute exists, but the referenced class is not available in the classpath.

Fix:

  1. Verify that the implementation class exists in your project.

  2. Check that the fully qualified class name in the bean definition matches the actual class path.

  3. Confirm that the JAR file containing the implementation class is included in your project dependencies.

<!-- Verify this class exists and the package path is correct -->
<bean id="myServiceImpl" class="<your-implementation-class>" />

Still need help?

If these solutions do not resolve the error, submit a support ticket through the Alibaba Cloud console. Include the full stack trace and your Spring XML configuration file (with sensitive values redacted).