SOLRJ-6.0.0: la inserción de un objeto bean que asocia la lista de objetos bean da una excepción de puntero nulo

Clase de frijol empleado:

public class Employee2 {

    private String id;
    private String name;
    private String designation;
    private double salary;
    private double totalExperience;
//    private Address2 address2;
    private Collection<Technology2> technologies2;
    private String content_type = "employee2";

    public Employee2() {
        super();
    }

    public Employee2(String id, String name, String designation, double salary, double totalExperience,
            Collection<Technology2> technologies2) {
        super();
        this.id = id;
        this.name = name;
        this.designation = designation;
        this.salary = salary;
        this.totalExperience = totalExperience;
//        this.address2 = address2;
        this.technologies2 = technologies2;
    }

    /**
     * @return the id
     */
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    @Field (value = "id")
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    @Field (value = "name")
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the designation
     */
    public String getDesignation() {
        return designation;
    }

    /**
     * @param designation the designation to set
     */
    @Field (value = "designation_s")
    public void setDesignation(String designation) {
        this.designation = designation;
    }

    /**
     * @return the salary
     */
    public double getSalary() {
        return salary;
    }

    /**
     * @param salary the salary to set
     */
    @Field (value = "salary_d")
    public void setSalary(double salary) {
        this.salary = salary;
    }

    /**
     * @return the totalExperience
     */
    public double getTotalExperience() {
        return totalExperience;
    }

    /**
     * @param totalExperience the totalExperience to set
     */
    @Field (value = "totalExperience_d")
    public void setTotalExperience(double totalExperience) {
        this.totalExperience = totalExperience;
    }

//    /**
//     * @return the address2
//     */
//    public Address2 getAddress() {
//        return address2;
//    }
//
//    /**
//     * @param address2 the address2 to set
//     */
//    @Field (child = true)
//    public void setAddress(Address2 address2) {
//        this.address2 = address2;
//    }

    /**
     * @return the technologies2
     */
    public Collection<Technology2> getTechnologies2() {
        return technologies2;
    }

    /**
     * @param technologies2 the technologies2 to set
     */
    @Field (child = true)
    public void setTechnologies2(Collection<Technology2> technologies2) {
        this.technologies2 = technologies2;
    }

    /**
     * @return the content_type
     */
    public String getContent_type() {
        return content_type;
    }

    /**
     * @param content_type the content_type to set
     */
    @Field(value="content_type_t")
    public void setContent_type(String content_type) {
        this.content_type = content_type;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "Employee2 [id=" + id + ", name=" + name + ", designation=" + designation + ", salary=" + salary +
                ", totalExperience=" + totalExperience + ", technologies2=" + this.getTechnologies(technologies2) +
                ", content_type=" + content_type + "]";
    }

    private String getTechnologies(Collection<Technology2> technologies2) {
        String strTechnologies = "[";
        for(Technology2 technology: technologies2) {
            strTechnologies = strTechnologies+technology.toString();
        }
        return strTechnologies+"]";
    }

}

Clase de tecnología de frijol:

public class Technology2 {

    private String id;
    private String name;
    private int experience;
    private boolean certified;
    private String content_type = "technology2";


    public Technology2() {
        super();
    }

    public Technology2(String id, String name, int experience, boolean certified) {
        super();
        this.id = id;
        this.name = name;
        this.experience = experience;
        this.certified = certified;
    }

    /**
     * @return the id
     */
    public String getId() {
        return id;
    }
    /**
     * @param id the id to set
     */
    @Field(value="id")
    public void setId(String id) {
        this.id = id;
    }
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }
    /**
     * @param name the name to set
     */
    @Field(value="name")
    public void setName(String name) {
        this.name = name;
    }
    /**
     * @return the experience
     */
    public int getExperience() {
        return experience;
    }
    /**
     * @param experience the experience to set
     */
    @Field(value="experience_i")
    public void setExperience(int experience) {
        this.experience = experience;
    }
    /**
     * @return the certified
     */
    public boolean getCertified() {
        return certified;
    }
    /**
     * @param certified the certified to set
     */
    @Field(value="certified_b")
    public void setCertified(boolean certified) {
        this.certified = certified;
    }
    /**
     * @return the content_type
     */
    public String getContent_type() {
        return content_type;
    }
    /**
     * @param content_type the content_type to set
     */
    @Field(value="content_type_t")
    public void setContent_type(String content_type) {
        this.content_type = content_type;
    }
    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "Technology2 [id=" + id + ", name=" + name + ", experience=" + experience + ", certified=" + certified +
                ", content_type=" + content_type + "]";
    }

El método de inserción del bean funciona bien si el bean de empleado tiene un bean de dirección anidado, sin embargo, en nuestro caso, el bean de empleado ha anidado el bean Collection of Technology, está causando una excepción en la línea inferior

Respuesta UpdateResponse = solrClient.addBean (bean);

Método de inserción:

public <T> boolean insert (T bean) {
        try {
            UpdateResponse response = solrClient.addBean(bean);
            System.out.println("insert bean ElapsedTime: " + response.getElapsedTime());
            solrClient.commit();
            return true;
        } catch (IOException | SolrServerException e) {
            e.printStackTrace();
        }
        return false;
    }

Aquí está devolviendo una excepción de puntero nulo, a continuación se muestra el valor toString de Employee2

Empleado2 [id = EE130S, nombre = Vulrp, designación = NjLtK, salario = 127334.59626719051, experiencia total = 49.989444163266164, technologies2 = [Tecnología2 [id = 0TE130S, nombre = uyIOFlh, experiencia = 21, certificado = verdadero, contenido_tipo = tecnología2] [tecnología2] = 1TE130S, nombre = FmZJjak, experiencia = 43, certificado = falso, content_type = tecnología2] Tecnología2 [id = 2TE130S, nombre = ddJbOXg, experiencia = 11, certificado = falso, content_type = tecnología2] Tecnología2 [id = 3TE130S, nombre = rIxumUe , experiencia = 5, certificado = verdadero, tipo_contenido = tecnología2]], tipo_contenido = empleado2]

Está causando a continuaciónexcepción:

java.lang.NullPointerException
    at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.storeType(DocumentObjectBinder.java:243)
    at org.apache.solr.client.solrj.beans.DocumentObjectBinder$DocField.<init>(DocumentObjectBinder.java:183)
    at org.apache.solr.client.solrj.beans.DocumentObjectBinder.collectInfo(DocumentObjectBinder.java:144)
    at org.apache.solr.client.solrj.beans.DocumentObjectBinder.getDocFields(DocumentObjectBinder.java:123)
    at org.apache.solr.client.solrj.beans.DocumentObjectBinder.toSolrInputDocument(DocumentObjectBinder.java:76)
    at org.apache.solr.client.solrj.SolrClient.addBean(SolrClient.java:277)
    at org.apache.solr.client.solrj.SolrClient.addBean(SolrClient.java:259)
    at com.opteamix.buildpal.poc.SampleSolrDAO.insert(SampleSolrDAO.java:62)
    at com.opteamix.buildpal.poc.SampleSolrDAOTest.testEmployees2Insert(SampleSolrDAOTest.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Respuestas a la pregunta(2)

Su respuesta a la pregunta