为何搭建CordApp后访问http://localhost:10007/web/example/返回空响应?
Let’s break down the most likely causes and fixes for your unresponsive http://localhost:10007/web/example/ endpoint, even after successfully building your corapp-example:
Verify your Corda node is actually running
Building the CorDapp doesn’t automatically start the node. Check if the node process is active:- On Linux/macOS: Run
ps aux | grep cordato list related processes. - On Windows: Open Task Manager and look for
java.exeorcorda.exeinstances.
Also, check the node’s log file atnode/logs/node.logfor confirmation. You should see lines likeNode for "O=Example Corp, L=London, C=GB" started up successfullyandStarted Jetty server on port 10007if everything’s working.
- On Linux/macOS: Run
Double-check node configuration for correct web port
Open your node’snode.conffile and verify these settings:rpcSettings { address="localhost:10007" } webServer { address="localhost:10007" }Sometimes the default port might differ (e.g., 10006), or it could have been modified accidentally. Ensure the port in your config matches the one you’re trying to access.
Check for port conflicts or firewall blocks
Port 10007 might be occupied by another application:- On Windows: Run
netstat -ano | findstr :10007to find the process ID using the port, then kill it via Task Manager if needed. - On Linux/macOS: Use
lsof -i :10007to identify the process, then kill it withkill <PID>.
Also, confirm your local firewall isn’t blocking incoming connections on port 10007. Temporarily disabling the firewall (for testing) or adding an allow rule can help rule this out.
- On Windows: Run
Ensure the Web CorDapp is properly deployed
Building the CorDapp generates a.jarfile inbuild/libs/. Make sure this file is copied to your node’scordappsdirectory. After copying, restart the node and check the logs for a line likeLoaded CorDapp: com.example.examplecordapp-<version>.jar—this confirms the CorDapp was loaded successfully.Validate the web endpoint path
The/web/example/path depends on how your CorDapp registers its web routes. Check theWebServerPluginRegistryimplementation in your code; look for a line likeregisterWebApp("example", ...). If the first parameter here is different (e.g.,demo), your endpoint would be/web/demo/instead. You can also scan the node startup logs for route registration messages to confirm the correct path.Test basic web server connectivity
Try accessinghttp://localhost:10007/rpcdirectly with a browser orcurl. If you get a 403 Forbidden response, that means the node’s web server is running—your issue is likely with the CorDapp’s path or deployment. If you get no response at all, the problem is with the node not starting or the port being incorrect.
内容的提问来源于stack exchange,提问作者Deepthi Kr

