You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Debian9安装CKAN时Jetty启动Solr(3.6.2)抛出NPE异常求助

Fixing Jetty NPE When Deploying Solr 3.6.2 for CKAN on Debian 9

Hey there, I’ve run into similar distro-specific quirks when setting up CKAN on Debian instead of Ubuntu—let’s work through this NullPointerException (NPE) issue step by step. Since Jetty starts and you can access the root test page, the core service is functional, but something’s breaking when it tries to load the Solr webapp. Here’s what to check:

1. First, Grab the Full NPE Stack Trace

The exact line where the NPE occurs is critical for pinpointing the problem. Pull the relevant logs with these commands:

# Check recent Jetty service logs
journalctl -u jetty --since "10 minutes ago"

# Or directly inspect Jetty's log file (path may vary)
cat /var/log/jetty/jetty.log | grep -A 20 "NullPointerException"

Share the full stack trace if the steps below don’t resolve the issue—it’ll help narrow things down fast.

2. Verify Solr Context Configuration

Debian’s solr-jetty package often skips or misconfigures the Jetty context for Solr, which leads to Jetty failing to locate the Solr webapp resources.

  • Check if the Solr context file exists at /etc/jetty/contexts/solr.xml. If not, create it with this content:
    <Configure class="org.eclipse.jetty.webapp.WebAppContext">
      <Set name="contextPath">/solr</Set>
      <Set name="war">/usr/share/solr/webapp</Set>
      <Set name="extractWAR">false</Set>
    </Configure>
    
  • Set proper permissions and restart Jetty:
    chown jetty:jetty /etc/jetty/contexts/solr.xml
    systemctl restart jetty
    

3. Fix Solr Home Directory Configuration

CKAN requires a specific Solr core setup, and Debian’s default solr-jetty config may point to the wrong Solr home path.

  • Open /etc/default/jetty and add/modify these lines to point to your CKAN-configured Solr home (adjust the path to match where you copied CKAN’s Solr config):
    SOLR_HOME="/var/lib/solr/ckan"
    export SOLR_HOME
    
  • Ensure the directory has correct permissions for the Jetty user:
    chown -R jetty:jetty /var/lib/solr/ckan
    
  • Restart Jetty: systemctl restart jetty

4. Manually Deploy the Solr Webapp

Sometimes the package’s auto-deployment logic glitches. Try manually copying the Solr webapp to Jetty’s webapps directory:

# Stop Jetty first
systemctl stop jetty

# Copy Solr webapp to Jetty's webapps folder
cp -r /usr/share/solr/webapp /var/lib/jetty/webapps/solr

# Fix permissions
chown -R jetty:jetty /var/lib/jetty/webapps/solr

# Restart Jetty
systemctl start jetty

5. Confirm CKAN’s Solr Core is Properly Set Up

Double-check that you’ve copied CKAN’s custom Solr configuration to the Solr home directory as per the docs:

# Replace the source path with your CKAN installation's Solr config location
cp -r /usr/lib/ckan/default/src/ckan/ckan/config/solr/solr-3.x/* /var/lib/solr/ckan/
chown -R jetty:jetty /var/lib/solr/ckan/

Ensure the core configuration files (like core.properties or solr.xml in the Solr home) correctly reference this core.

If you still hit the NPE after these steps, share the full stack trace from the logs—we can dig deeper into exactly what’s missing or misconfigured.

内容的提问来源于stack exchange,提问作者S3lvatico

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:21:20