Java调用SOAP WebService遇Class not registered异常求助
Troubleshooting COM Registration Error in Java SOAP WebService Call
Hey there! Even though that REGDB_E_CLASSNOTREG error feels super C#-centric, let's unpack why you're hitting it from a Java client—and how to fix it. The key thing to realize here: this error is coming from the remote SOAP WebService server, not your Java code or generated stubs.
Why This Happens (Even with Java)
- The SOAP service you're calling runs on a Windows-based server (likely ASP.NET or a Windows service) and depends on a COM component. That component with CLSID
{28487481-0A2C-4E61-A198-417335F22895}isn't properly registered on the server, so when the service tries to instantiate it, it fails. - Architecture mismatch: If the server is 64-bit but the COM component is only registered for 32-bit (or vice versa), the service can't locate the component. For example, IIS app pools running in 64-bit mode can't access 32-bit COM components unless explicitly configured.
- Corrupted registration: The component's registry entries might be missing or damaged, even if the DLL/OCX file exists on the server.
Steps to Fix the Issue (All Done on the WebService Server)
Locate the COM component
- On the server, open the Registry Editor (
regedit.exe) and search for the CLSID{28487481-0A2C-4E61-A198-417335F22895}. This will show you the path to the associated DLL or OCX file.
- On the server, open the Registry Editor (
Re-register the component
- Use the
regsvr32.exetool to register the component. Note the bitness:- For 32-bit components on a 64-bit server: Run Command Prompt as Administrator and execute
C:\Windows\SysWOW64\regsvr32.exe "C:\path\to\your\component.dll" - For 64-bit components: Use
C:\Windows\System32\regsvr32.exe "C:\path\to\your\component.dll"
- For 32-bit components on a 64-bit server: Run Command Prompt as Administrator and execute
- You should get a confirmation message if registration succeeds.
- Use the
Check server process architecture
- If the service is hosted in IIS, go to the application pool settings for your WebService. Enable the "Enable 32-bit Applications" option if you're using a 32-bit COM component. Restart the app pool after making changes.
Verify component functionality
- Write a quick test app (even a simple C# console app) on the server to instantiate the COM component directly. This confirms the component works outside the SOAP service context, ruling out any service-specific issues.
Remember: Your Java client and generated stubs are probably fine—this is entirely a server-side configuration issue with the dependent COM component.
内容的提问来源于stack exchange,提问作者sathya
相关产品推荐
相关产品推荐

