JAXB Not Generating Java Objects In IntelliJ 10.0.2

Answered

I'm running IntelliJ 10.02. build #IU 103.72 on Windows XP SP 3.

I'd like to generate objects from an .xsd using JAXB.  I have the web services plug-in installed and enabled.

If I open the .xsd in the editor and right click inside, I walk down to the web services->Generate Java code from XML schema selection and supply an output package name.

The only output I get is an echo of the .xsd; no objects generated.

What did I miss?  What am I doing wrong.  Thanks.

8 comments
Comment actions Permalink

Hello Michael,
  could you please send me your xsd file to kb at jetbrains dot com.

Thank you.

0
Comment actions Permalink

No problem with IntelliJ or JAXB1; the .xsd was the culprit.  There were two elements whose names differed by a single character: one lower case, the other upper.  All was well once I removed the lower case version.  My apologies for the bother.  Sincerely, Duffy

0
Comment actions Permalink

Is there a way to identify what is the error on the file? Intellij doesn't show any error logs, it just finish the task as it succeeded but doesn't generate the classes.

0
Comment actions Permalink

Hello,

Aren't there errors/warnings in idea.log ("Help | Show Log in...")?

 

0
Comment actions Permalink

Hi! No errors is appended in any of those files. Here is the xsd file, XSD analysers found no error on it:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.esocial.gov.br/schema/evt/evtAqProd/v02_04_02" targetNamespace="http://www.esocial.gov.br/schema/evt/evtAqProd/v02_04_02" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
<xs:element name="eSocial">
<xs:complexType>
<xs:sequence>
<xs:element name="evtAqProd">
<xs:annotation>
<xs:documentation>Evento Aquisição de Produção</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="ideEvento" type="TIdeEveFopagMensal">
<xs:annotation>
<xs:documentation>Informações de identificação do evento</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ideEmpregador" type="TEmpregador">
<xs:annotation>
<xs:documentation>Informações de identificação do empregador</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="infoAquisProd">
<xs:annotation>
<xs:documentation>Informação da Aquisição de Produção</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="ideEstabAdquir">
<xs:annotation>
<xs:documentation>Identificação do estabelecimento adquirente da produção</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="tpInscAdq">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Tipo de inscrição do adquirente, conforme tabela 5.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="nrInscAdq">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Indicar o número de inscrição</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\d{11,15}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="tpAquis" maxOccurs="3">
<xs:annotation>
<xs:documentation>Registro preenchido por Pessoa Jurídica em geral, quando o estabelecimento identificado no registro superior efetuar aquisição de produtos rurais de pessoa física. O registro também deve ser preenchido nas seguintes situações:
- Por PF, quando a mesma adquire produção de produtor rural pessoa física ou segurado especial para venda no varejo a consumidor final pessoa física;
- Por Entidade inscrita no Programa de Aquisição de Alimentos (PAA), quando a mesma efetuar a aquisição de produtos rurais no âmbito do PAA, de produtor rural pessoa física ou pessoa jurídica.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="indAquis">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Indicativo da Aquisição</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vlrTotAquis">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor total da aquisição</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ideProdutor" maxOccurs="9999">
<xs:annotation>
<xs:documentation>Registro que identifica os produtores rurais dos quais foi efetuada aquisição da produção pelo contribuinte declarante.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="tpInscProd">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Informar [1] (CNPJ) ou [2] (CPF).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="nrInscProd">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Inscrição do produtor</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\d{11,15}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vlrBruto">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor bruto</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrCPDescPR">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor da Contribuição Previdenciária descontada pelo adquirente</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrRatDescPR">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor da GILRAT incidente sobre a aquisição de produção rural de produtor rural pessoa física.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrSenarDesc">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor da contribuição destinada ao SENAR</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="nfs" minOccurs="0" maxOccurs="9999">
<xs:annotation>
<xs:documentation>Detalhamento das notas fiscais relativas a aquisição de produção do produtor rural identificado no registro superior, não sendo obrigatório nas aquisições de produção de pessoa física/segurado especial.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="serie" minOccurs="0">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Série da Nota Fiscal/Fatura</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="nrDocto">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Número da NF/Fatura</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dtEmisNF">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Data de Emissão da Nota Fiscal/Fatura</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:date">
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vlrBruto">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor bruto</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrCPDescPR">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor da Contribuição Previdenciária descontada pelo adquirente</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrRatDescPR">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor da GILRAT incidente sobre a aquisição de produção rural de produtor rural pessoa física.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrSenarDesc">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor da contribuição destinada ao SENAR</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="infoProcJud" minOccurs="0" maxOccurs="10">
<xs:annotation>
<xs:documentation>Registro preenchido quando o Produtor Rural (pessoa física ou segurado especial), identificado em {ideProdutor}, ou o próprio declarante, possuir processo judicial com decisão/sentença determinando a não retenção, pelo adquirente, das contribuições incidentes sobre a aquisição de produção.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="nrProcJud">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Nr Processo Judicial</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="3"/>
<xs:maxLength value="21"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="codSusp">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Código do Indicativo da Suspensão</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:pattern value="\d{1,14}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrCPNRet">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Valor da Contribuição Previdenciária que deixou de ser retida pelo declarante em decorrência de decisão/sentença judicial. </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrRatNRet">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Vr RAT não retido</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="vrSenarNRet">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Vr Senar não retido</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:totalDigits value="14"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>
<xs:element ref="ds:Signature"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="TIdeEveFopagMensal">
<xs:annotation>
<xs:documentation>Identificação do Evento Periódico</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="indRetif">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Indicativo de Retificação</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="nrRecibo" minOccurs="0">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Recibo arquivo a ser retificado</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="40"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="indApuracao">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Indicativo de período de apuração:
1 - Mensal.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="perApur">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Período ao qual se referem as informações.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="4"/>
<xs:maxLength value="7"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="tpAmb">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Tipo de ambiente</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="procEmi">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Processo de emissão do evento</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="verProc">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Versão do processo de emissão do evento. </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TEmpregador">
<xs:sequence>
<xs:element name="tpInsc">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Tipo de Inscrição, conforme tabela 5.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:byte">
<xs:pattern value="\d"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="nrInsc">
<xs:simpleType>
<xs:annotation>
<xs:documentation>Número de Inscrição</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\d{8,15}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
0
Comment actions Permalink

Here are errors I got when running xjc from command line:

parsing a schema...
[ERROR] Current configuration of the parser doesn't allow a maxOccurs attribute value to be set greater than the value 5 000.
line 86 of file:<FILE_NAME>.xsd

Failed to parse a schema.

parsing a schema...
[ERROR] Current configuration of the parser doesn't allow a maxOccurs attribute value to be set greater than the value 5 000.
line 156 of file:<FILE_NAME>.xsd

Changing values from 9999 to 4000 fixes the issue.

We have related requests on YouTrack to show XJC errors: https://youtrack.jetbrains.com/issue/IDEA-92973, https://youtrack.jetbrains.com/issue/IDEA-148755

 

 

 

1
Comment actions Permalink

Thank you very much for your help!

0
Comment actions Permalink

You are welcome!

0

Please sign in to leave a comment.