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 437823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:37:01+00:00 2026-05-12T20:37:01+00:00

i am facing one problem.i have a class named ReportingService and it should be

  • 0

i am facing one problem.i have a class named “ReportingService” and it should be singleton and is is extending “CommonService”.

package MyApp.Services.ReportingService;

public class ReportingService extends CommonService {

    private static ReportingService instance = null;

    public static ReportingService getInstance() {
        if (instance == null) {
            instance = new ReportingService();
        }
        return instance;   

    }
}

and to access this class in other class i am using

package MyApp.Services.WebReportingService;
@WebMethod(operationName = "registerUDP")
    public boolean registerUDP(
            @WebParam(name = "Friendly Name") String friendlyName,
            @WebParam(name = "Username") String username,
            @WebParam(name = "Password") String password,
            @WebParam(name = "Communication Protocol") CommunicationProtocol communicationProtocol,
            @WebParam(name = "IP Address") String ipAddress,
            @WebParam(name = "Port") int port) {

        Consumer client = new Consumer(friendlyName, username, password, communicationProtocol, ipAddress, port);

ReportingService rs = ReportingService.
        return true;

    }

in “ReportingService rs = ReportingService.” it is not showing me getInstance() method of ReportingService class. I also imported correct packages.

NOTE: both classes are in different packages.

  • 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-12T20:37:01+00:00Added an answer on May 12, 2026 at 8:37 pm

    I think your package names are broken. You seem to have the name of the class at the end of the package – but the name of the class only appears when you import.

    So you would have :

    package myApp.Services;
    
    public class ReportService extends CommonService {/* code goes here */}
    

    but then you would include:

    import myApp.Services.ReportService;
    

    Same goes for the WebReportingService. The package statement should not include the class name

    Edit: if you actually want ReportService in package myApp.Services.ReportService, then you need to import myApp.Services.ReportService.ReportService (or, alternatively, myApp.Services.ReportService.*, but this is not recommended unless you need many classes from the package)

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

Sidebar

Related Questions

I have a bean structure to parse JSon files. I am facing one problem,
I have a public facing website that has been receiving a number of SQL
I'm facing a really strange problem that has me smoked. I have a fairly
i am facing one font problem, my website is to operate in five languages,
I am struggling with this problem since last one week. I have obfuscated exe
I am facing a problem to submit two forms with one JavaScript function. In
I am developing an application based on one library. I am facing problem related
I am facing problem with an Oracle Query in a .net 2.0 based windows
I am facing a problem with .NET generics. The thing I want to do
I'm facing a problem with IE6. I took the toggle function from this website

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.