[Red Hat JIRA] (WFLY-14189) The RunAs annotation doesn't work in EJBs with Elytron
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFLY-14189?page=com.atlassian.jira.plugi... ]
Brian Stansberry closed WFLY-14189.
-----------------------------------
> The RunAs annotation doesn't work in EJBs with Elytron
> ------------------------------------------------------
>
> Key: WFLY-14189
> URL: https://issues.redhat.com/browse/WFLY-14189
> Project: WildFly
> Issue Type: Bug
> Components: EJB, Security
> Affects Versions: 21.0.0.Final
> Reporter: Alessandro Moscatelli
> Assignee: Diana Vilkolakova
> Priority: Major
> Labels: ejb, elytron, regression, runas, security, startup
> Attachments: standalone-full-ha.new.xml, test.zip
>
>
> Role is not correctly assigned when using @RunAs annotation and Elytron Security Domain. Everything works correctly with legacy picketbox Security Domain.
> Wildfly is configured to use default "other" application-security-domain, also using default security domain ApplicationDomain.
> This exception is rised when deploying the application.
> Caused by: javax.ejb.EJBAccessException: WFLYEJB0364: Invocation on method: public abstract void org.visiontech.test.TestInterface.test() of bean: Test2 is not allowedCaused by: javax.ejb.EJBAccessException: WFLYEJB0364: Invocation on method: public abstract void org.visiontech.test.TestInterface.test() of bean: Test2 is not allowed at org.jboss.as.ejb3@21.0.0.Final//org.jboss.as.ejb3.security.JaccInterceptor.hasPermission(JaccInterceptor.java:120)
> Test/Sample project: [^test.zip]
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 8 months
[Red Hat JIRA] (WFLY-14189) The RunAs annotation doesn't work in EJBs with Elytron
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFLY-14189?page=com.atlassian.jira.plugi... ]
Brian Stansberry resolved WFLY-14189.
-------------------------------------
Resolution: Explained
> The RunAs annotation doesn't work in EJBs with Elytron
> ------------------------------------------------------
>
> Key: WFLY-14189
> URL: https://issues.redhat.com/browse/WFLY-14189
> Project: WildFly
> Issue Type: Bug
> Components: EJB, Security
> Affects Versions: 21.0.0.Final
> Reporter: Alessandro Moscatelli
> Assignee: Diana Vilkolakova
> Priority: Major
> Labels: ejb, elytron, regression, runas, security, startup
> Attachments: standalone-full-ha.new.xml, test.zip
>
>
> Role is not correctly assigned when using @RunAs annotation and Elytron Security Domain. Everything works correctly with legacy picketbox Security Domain.
> Wildfly is configured to use default "other" application-security-domain, also using default security domain ApplicationDomain.
> This exception is rised when deploying the application.
> Caused by: javax.ejb.EJBAccessException: WFLYEJB0364: Invocation on method: public abstract void org.visiontech.test.TestInterface.test() of bean: Test2 is not allowedCaused by: javax.ejb.EJBAccessException: WFLYEJB0364: Invocation on method: public abstract void org.visiontech.test.TestInterface.test() of bean: Test2 is not allowed at org.jboss.as.ejb3@21.0.0.Final//org.jboss.as.ejb3.security.JaccInterceptor.hasPermission(JaccInterceptor.java:120)
> Test/Sample project: [^test.zip]
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 8 months
[Red Hat JIRA] (WFLY-14189) The RunAs annotation doesn't work in EJBs with Elytron
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFLY-14189?page=com.atlassian.jira.plugi... ]
Brian Stansberry reopened WFLY-14189:
-------------------------------------
> The RunAs annotation doesn't work in EJBs with Elytron
> ------------------------------------------------------
>
> Key: WFLY-14189
> URL: https://issues.redhat.com/browse/WFLY-14189
> Project: WildFly
> Issue Type: Bug
> Components: EJB, Security
> Affects Versions: 21.0.0.Final
> Reporter: Alessandro Moscatelli
> Assignee: Diana Vilkolakova
> Priority: Major
> Labels: ejb, elytron, regression, runas, security, startup
> Attachments: standalone-full-ha.new.xml, test.zip
>
>
> Role is not correctly assigned when using @RunAs annotation and Elytron Security Domain. Everything works correctly with legacy picketbox Security Domain.
> Wildfly is configured to use default "other" application-security-domain, also using default security domain ApplicationDomain.
> This exception is rised when deploying the application.
> Caused by: javax.ejb.EJBAccessException: WFLYEJB0364: Invocation on method: public abstract void org.visiontech.test.TestInterface.test() of bean: Test2 is not allowedCaused by: javax.ejb.EJBAccessException: WFLYEJB0364: Invocation on method: public abstract void org.visiontech.test.TestInterface.test() of bean: Test2 is not allowed at org.jboss.as.ejb3@21.0.0.Final//org.jboss.as.ejb3.security.JaccInterceptor.hasPermission(JaccInterceptor.java:120)
> Test/Sample project: [^test.zip]
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 8 months
[Red Hat JIRA] (WFCORE-4516) Allow server-identities expression resolution to support Base64 encoded system properties.
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFCORE-4516?page=com.atlassian.jira.plug... ]
Brian Stansberry edited comment on WFCORE-4516 at 1/12/21 2:04 PM:
-------------------------------------------------------------------
I also don't think we should change anything other than the free form text description of the 'value' attribute, and perhaps some docs if that text is driving any docs.
The existing code is designed to handle two cases – Base64 encoded text or an expression which resolves to plain text. AFAICT this works fine. What doesn't work is using an expression that resolves to Base64 encoded text. I don't think we should try and make that work, as there is a tiny chance of it breaking people, and discussion on https://github.com/wildfly/wildfly-core/pull/3814 leads me to believe Darran Lofthouse is not looking to change the functionality of these legacy resources either.
We should not say that expressions are not allowed because they work fine if the expression resolves to a valid plain text password.
We should change
https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/r...
to say
core.management.security-realm.server-identity.secret.value=The secret / password - Base64 encoded text or an expression that resolves to the plain text value.
The fact the current text doesn't say that is a bug, as that's how the software works.
was (Author: brian.stansberry):
I also don't think we should change anything other that the free form text of an attribute, and perhaps some docs if that text is driving any docs.
The existing code is designed to handle two cases – Base64 encoded text or an expression which resolves to plain text. AFAICT this works fine. What doesn't work is using an expression that resolves to Base64 encoded text. I don't think we should try and make that work, as there is a tiny chance of it breaking people, and discussion on https://github.com/wildfly/wildfly-core/pull/3814 leads me to believe Darran Lofthouse is not looking to change the functionality of these legacy resources either.
We should not say that expressions are not allowed because they work fine if the expression resolves to a valid plain text password.
We should change
https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/r...
to say
core.management.security-realm.server-identity.secret.value=The secret / password - Base64 encoded text or an expression that resolves to the plain text value.
The fact the current text doesn't say that is a bug, as that's how the software works.
> Allow server-identities expression resolution to support Base64 encoded system properties.
> ------------------------------------------------------------------------------------------
>
> Key: WFCORE-4516
> URL: https://issues.redhat.com/browse/WFCORE-4516
> Project: WildFly Core
> Issue Type: Feature Request
> Components: Management, Security
> Reporter: Indrajit Ingawale
> Priority: Major
>
> The expression for secret value under server-identities in test-security-realm does not work , even though it shows "expressions-allowed" to true like below .
> ----------------------------
> [standalone@localhost:9990 /] /core-service=management/security-realm=test-security-realm/server-identity=secret:read-resource-description()
> {
> "outcome" => "success",
> .
> .
> "attributes" =>
> {. . . . . }
> ,
> "value" =>
> { "type" => STRING, "description" => "The secret / password - Base64 Encoded.", "expressions-allowed" => true, "required" => true, "nillable" => true, "alternatives" => ["credential-reference"], "min-length" => 1L, "max-length" => 2147483647L, "access-type" => "read-write", "storage" => "configuration", "restart-required" => "no-services" }
> },
> "operations" => undefined,
> "notifications" => undefined,
> "children" => {}
> }
> }
> ----------------------------
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 8 months
[Red Hat JIRA] (WFLY-14285) Serialization Errors with EJB over HTTP
by Brian Stansberry (Jira)
[ https://issues.redhat.com/browse/WFLY-14285?page=com.atlassian.jira.plugi... ]
Brian Stansberry commented on WFLY-14285:
-----------------------------------------
[~ropalka] FYI.
> Serialization Errors with EJB over HTTP
> ---------------------------------------
>
> Key: WFLY-14285
> URL: https://issues.redhat.com/browse/WFLY-14285
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Affects Versions: 21.0.0.Final, 21.0.1.Final, 21.0.2.Final
> Reporter: Adriano Teixeira de Souza
> Assignee: Cheng Fang
> Priority: Major
> Attachments: serialization-wf-21-0-2(2).txt, serialization-wf-21-0-2(4).txt, serialization-wf-21-0-2(5).txt, serialization-wf-21-0-2.txt
>
>
> We are testing our application for upgrade to las version of Wildfly (21.0.2) and on the ejb client over http in a standalone client application we are facing many serialization errors that doesn't have on previous versions (20.0.1 and before)
> It occurs after 6 times executing a function that call remote ejb. The errors is some times like this:
> {code:java}
> Caused by: java.lang.ClassCastException: Cannot cast java.lang.Class to java.util.Date
> at java.lang.Class.cast(Class.java:3605)
> at org.jboss.marshalling.reflect.SerializableField.setObject(SerializableField.java:342)
> at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
> at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1778)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1406)
> ...
> Caused by: an exception which occurred:
> in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem
> {code}
> some times like this:
> {code:java}
> Caused by: java.io.StreamCorruptedException: Unexpected byte found when reading an object: 224
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:839)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:231)
> at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
> Caused by: an exception which occurred:
> in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem{code}
> A complete stacktrace is attached
> The class Peso is like this
>
> {code:java}
> package com.my.company;
> import java.math.BigDecimal;
> import java.util.Date;
> import java.util.Set;
> import javax.persistence.Column;
> import javax.persistence.Entity;
> import javax.persistence.FetchType;
> import javax.persistence.GeneratedValue;
> import javax.persistence.GenerationType;
> import javax.persistence.Id;
> import javax.persistence.JoinColumn;
> import javax.persistence.ManyToOne;
> import javax.persistence.OneToMany;
> import javax.persistence.SequenceGenerator;
> import javax.persistence.Temporal;
> import javax.persistence.TemporalType;
> @Entity
> public class Peso extends AbstractEntity{
> private static final long serialVersionUID = 1L;
> @Id
> @SequenceGenerator(allocationSize = 1, name = "PESO_IDPESO", sequenceName = "IDPESO")
> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESO_IDPESO")
> private Long idPeso;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDBALANCA")
> private Balanca balanca;
> @ManyToOne(fetch = FetchType.EAGER)
> @JoinColumn(name = "IDFLAGTIPOCAPTURAPESO")
> private Flag flagTipoCapturaPeso;
> @Column(precision=15, scale=5)
> private BigDecimal peso;
> @Temporal(TemporalType.TIMESTAMP)
> private Date dataHoraCapturaPeso;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDUSUARIO")
> private Usuario usuario;
>
> @Column(length=255)
> private String justificativaPesagemManual;
>
> @OneToMany(mappedBy = "peso", fetch = FetchType.LAZY)
> private Set<PesagemRodoviariaImagem> pesagemRodoviariaImagens;
>
> get and set ...
> }
> {code}
>
> The class PesagemRodoviariaImage is like this:
> {code:java}
> package com.my.company;
> import java.util.Date;
> import javax.persistence.Entity;
> import javax.persistence.FetchType;
> import javax.persistence.GeneratedValue;
> import javax.persistence.GenerationType;
> import javax.persistence.Id;
> import javax.persistence.JoinColumn;
> import javax.persistence.ManyToOne;
> import javax.persistence.SequenceGenerator;
> import javax.persistence.Temporal;
> import javax.persistence.TemporalType;
> import javax.persistence.Transient;
> @Entity
> public class PesagemRodoviariaImagem extends AbstractEntity{
> private static final long serialVersionUID = 4181136886458805429L;
> @Id
> @SequenceGenerator(allocationSize = 1, name = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM", sequenceName = "IDPESAGEMRODOVIARIAIMAGEM")
> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM")
> private Long idPesagemRodoviariaImagem;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDPESO")
> private Peso peso;
> private String caminho;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDCONFIGURACAOFTP")
> private ConfiguracaoFTP configuracaoFTP ;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDCAMERA")
> private Camera camera;
> @Temporal(TemporalType.TIMESTAMP)
> private Date dataHoraCapturaImagem;
> @Transient
> private byte[] conteudoArquivo;
> ... get and sets
> {code}
> and it super class is
> {code:java}
> public abstract class AbstractEntity extends AbstractState implements Entity {
> private static final long serialVersionUID = 1L;
> public AbstractEntity() {
> }
> public AbstractEntity(EntityState entityState) {
> this();
> this.setEntityState(entityState);
> }
> @Override
> public boolean equals(Object obj) {
> if (this == obj) {
> return true;
> }
> if (obj == null) {
> return false;
> }
> if(!(obj instanceof AbstractEntity)){
> return false;
> }
> AbstractEntity other = (AbstractEntity) obj;
> Long myId = getId();
> Long otherId = other.getId();
> if (myId == null || otherId == null) {
> if(myId == null && otherId == null){
> if(this.getClientId() != null && other.getClientId() != null){
> return this.getClientId().equals(other.getClientId());
> }
> }
> return false;
> }
> return myId.longValue() == otherId.longValue();
> }
> @Override
> public int hashCode() {
> Long id = getId();
> return (id == null) ? super.hashCode() : id.hashCode();
> }
> @Deprecated
> public void validate() throws DCLogicException {
> }
> @Override
> public String toString() {
> String description = getClass().getSimpleName() + "[ID:" + getId()+"]";
> if(this instanceof IDescricaoCustomizada){
> description += "["+((IDescricaoCustomizada)this).getDescricaoCustomizada()+"]";
> }
> if(this instanceof IDescricaoEntidade){
> description += "["+((IDescricaoEntidade)this).getDescricaoEntidade()+"]";
> }
> return description;
> }
> public boolean hasId() {
> return this.getId() != null;
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 8 months
[Red Hat JIRA] (WFLY-14285) Serialization Errors with EJB over HTTP
by Adriano Teixeira de Souza (Jira)
[ https://issues.redhat.com/browse/WFLY-14285?page=com.atlassian.jira.plugi... ]
Adriano Teixeira de Souza updated WFLY-14285:
---------------------------------------------
Description:
We are testing our application for upgrade to las version of Wildfly (21.0.2) and on the ejb client over http in a standalone client application we are facing many serialization errors that doesn't have on previous versions (20.0.1 and before)
It occurs after 6 times executing a function that call remote ejb. The errors is some times like this:
{code:java}
Caused by: java.lang.ClassCastException: Cannot cast java.lang.Class to java.util.Date
at java.lang.Class.cast(Class.java:3605)
at org.jboss.marshalling.reflect.SerializableField.setObject(SerializableField.java:342)
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1778)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1406)
...
Caused by: an exception which occurred:
in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem
{code}
some times like this:
{code:java}
Caused by: java.io.StreamCorruptedException: Unexpected byte found when reading an object: 224
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:839)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:231)
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
Caused by: an exception which occurred:
in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem{code}
A complete stacktrace is attached
The class Peso is like this
{code:java}
package com.my.company;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
public class Peso extends AbstractEntity{
private static final long serialVersionUID = 1L;
@Id
@SequenceGenerator(allocationSize = 1, name = "PESO_IDPESO", sequenceName = "IDPESO")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESO_IDPESO")
private Long idPeso;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDBALANCA")
private Balanca balanca;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "IDFLAGTIPOCAPTURAPESO")
private Flag flagTipoCapturaPeso;
@Column(precision=15, scale=5)
private BigDecimal peso;
@Temporal(TemporalType.TIMESTAMP)
private Date dataHoraCapturaPeso;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDUSUARIO")
private Usuario usuario;
@Column(length=255)
private String justificativaPesagemManual;
@OneToMany(mappedBy = "peso", fetch = FetchType.LAZY)
private Set<PesagemRodoviariaImagem> pesagemRodoviariaImagens;
get and set ...
}
{code}
The class PesagemRodoviariaImage is like this:
{code:java}
package com.my.company;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
@Entity
public class PesagemRodoviariaImagem extends AbstractEntity{
private static final long serialVersionUID = 4181136886458805429L;
@Id
@SequenceGenerator(allocationSize = 1, name = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM", sequenceName = "IDPESAGEMRODOVIARIAIMAGEM")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM")
private Long idPesagemRodoviariaImagem;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDPESO")
private Peso peso;
private String caminho;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDCONFIGURACAOFTP")
private ConfiguracaoFTP configuracaoFTP ;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDCAMERA")
private Camera camera;
@Temporal(TemporalType.TIMESTAMP)
private Date dataHoraCapturaImagem;
@Transient
private byte[] conteudoArquivo;
... get and sets
{code}
and it super class is
{code:java}
public abstract class AbstractEntity extends AbstractState implements Entity {
private static final long serialVersionUID = 1L;
public AbstractEntity() {
}
public AbstractEntity(EntityState entityState) {
this();
this.setEntityState(entityState);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if(!(obj instanceof AbstractEntity)){
return false;
}
AbstractEntity other = (AbstractEntity) obj;
Long myId = getId();
Long otherId = other.getId();
if (myId == null || otherId == null) {
if(myId == null && otherId == null){
if(this.getClientId() != null && other.getClientId() != null){
return this.getClientId().equals(other.getClientId());
}
}
return false;
}
return myId.longValue() == otherId.longValue();
}
@Override
public int hashCode() {
Long id = getId();
return (id == null) ? super.hashCode() : id.hashCode();
}
@Deprecated
public void validate() throws DCLogicException {
}
@Override
public String toString() {
String description = getClass().getSimpleName() + "[ID:" + getId()+"]";
if(this instanceof IDescricaoCustomizada){
description += "["+((IDescricaoCustomizada)this).getDescricaoCustomizada()+"]";
}
if(this instanceof IDescricaoEntidade){
description += "["+((IDescricaoEntidade)this).getDescricaoEntidade()+"]";
}
return description;
}
public boolean hasId() {
return this.getId() != null;
}
}
{code}
was:
We are testing our application for upgrade to las version of Wildfly (21.0.2) and on the ejb client over http in a standalone client application we are facing many serialization errors that doesn't have on previous versions (20.0.1 and before)
It occurs after 6 times executing a function that call remote ejb. The errors is some times like this:
{code:java}
Caused by: java.lang.ClassCastException: Cannot cast java.lang.Class to java.util.Date
at java.lang.Class.cast(Class.java:3605)
at org.jboss.marshalling.reflect.SerializableField.setObject(SerializableField.java:342)
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1778)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1406)
...
Caused by: an exception which occurred:
in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem
{code}
some times like this:
{code:java}
Caused by: java.io.StreamCorruptedException: Unexpected byte found when reading an object: 224
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:839)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:231)
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
Caused by: an exception which occurred:
in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem{code}
A complete stacktrace is attached
The class Peso is like this
{code:java}
package com.my.company;import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;@Entity
public class Peso extends AbstractEntity{ private static final long serialVersionUID = 1L; @Id
@SequenceGenerator(allocationSize = 1, name = "PESO_IDPESO", sequenceName = "IDPESO")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESO_IDPESO")
private Long idPeso; @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDBALANCA")
private Balanca balanca; @ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "IDFLAGTIPOCAPTURAPESO")
private Flag flagTipoCapturaPeso; @Column(precision=15, scale=5)
private BigDecimal peso; @Temporal(TemporalType.TIMESTAMP)
private Date dataHoraCapturaPeso; @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDUSUARIO")
private Usuario usuario;
@Column(length=255)
private String justificativaPesagemManual;
@OneToMany(mappedBy = "peso", fetch = FetchType.LAZY)
private Set<PesagemRodoviariaImagem> pesagemRodoviariaImagens;
get and set ...}
{code}
The class PesagemRodoviariaImage is like this:
{code:java}
package com.my.company;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
@Entity
public class PesagemRodoviariaImagem extends AbstractEntity{
private static final long serialVersionUID = 4181136886458805429L;
@Id
@SequenceGenerator(allocationSize = 1, name = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM", sequenceName = "IDPESAGEMRODOVIARIAIMAGEM")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM")
private Long idPesagemRodoviariaImagem;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDPESO")
private Peso peso;
private String caminho;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDCONFIGURACAOFTP")
private ConfiguracaoFTP configuracaoFTP ;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IDCAMERA")
private Camera camera;
@Temporal(TemporalType.TIMESTAMP)
private Date dataHoraCapturaImagem;
@Transient
private byte[] conteudoArquivo;
... get and sets
{code}
and it super class is
{code:java}
public abstract class AbstractEntity extends AbstractState implements Entity {
private static final long serialVersionUID = 1L;
public AbstractEntity() {
}
public AbstractEntity(EntityState entityState) {
this();
this.setEntityState(entityState);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if(!(obj instanceof AbstractEntity)){
return false;
}
AbstractEntity other = (AbstractEntity) obj;
Long myId = getId();
Long otherId = other.getId();
if (myId == null || otherId == null) {
if(myId == null && otherId == null){
if(this.getClientId() != null && other.getClientId() != null){
return this.getClientId().equals(other.getClientId());
}
}
return false;
}
return myId.longValue() == otherId.longValue();
}
@Override
public int hashCode() {
Long id = getId();
return (id == null) ? super.hashCode() : id.hashCode();
}
@Deprecated
public void validate() throws DCLogicException {
}
@Override
public String toString() {
String description = getClass().getSimpleName() + "[ID:" + getId()+"]";
if(this instanceof IDescricaoCustomizada){
description += "["+((IDescricaoCustomizada)this).getDescricaoCustomizada()+"]";
}
if(this instanceof IDescricaoEntidade){
description += "["+((IDescricaoEntidade)this).getDescricaoEntidade()+"]";
}
return description;
}
public boolean hasId() {
return this.getId() != null;
}
}
{code}
> Serialization Errors with EJB over HTTP
> ---------------------------------------
>
> Key: WFLY-14285
> URL: https://issues.redhat.com/browse/WFLY-14285
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Affects Versions: 21.0.0.Final, 21.0.1.Final, 21.0.2.Final
> Reporter: Adriano Teixeira de Souza
> Assignee: Cheng Fang
> Priority: Major
> Attachments: serialization-wf-21-0-2(2).txt, serialization-wf-21-0-2(4).txt, serialization-wf-21-0-2(5).txt, serialization-wf-21-0-2.txt
>
>
> We are testing our application for upgrade to las version of Wildfly (21.0.2) and on the ejb client over http in a standalone client application we are facing many serialization errors that doesn't have on previous versions (20.0.1 and before)
> It occurs after 6 times executing a function that call remote ejb. The errors is some times like this:
> {code:java}
> Caused by: java.lang.ClassCastException: Cannot cast java.lang.Class to java.util.Date
> at java.lang.Class.cast(Class.java:3605)
> at org.jboss.marshalling.reflect.SerializableField.setObject(SerializableField.java:342)
> at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
> at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1778)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1406)
> ...
> Caused by: an exception which occurred:
> in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem
> {code}
> some times like this:
> {code:java}
> Caused by: java.io.StreamCorruptedException: Unexpected byte found when reading an object: 224
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:839)
> at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:231)
> at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1864)
> Caused by: an exception which occurred:
> in field com.my.company.common.entities.PesagemRodoviariaImagem.dataHoraCapturaImagem{code}
> A complete stacktrace is attached
> The class Peso is like this
>
> {code:java}
> package com.my.company;
> import java.math.BigDecimal;
> import java.util.Date;
> import java.util.Set;
> import javax.persistence.Column;
> import javax.persistence.Entity;
> import javax.persistence.FetchType;
> import javax.persistence.GeneratedValue;
> import javax.persistence.GenerationType;
> import javax.persistence.Id;
> import javax.persistence.JoinColumn;
> import javax.persistence.ManyToOne;
> import javax.persistence.OneToMany;
> import javax.persistence.SequenceGenerator;
> import javax.persistence.Temporal;
> import javax.persistence.TemporalType;
> @Entity
> public class Peso extends AbstractEntity{
> private static final long serialVersionUID = 1L;
> @Id
> @SequenceGenerator(allocationSize = 1, name = "PESO_IDPESO", sequenceName = "IDPESO")
> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESO_IDPESO")
> private Long idPeso;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDBALANCA")
> private Balanca balanca;
> @ManyToOne(fetch = FetchType.EAGER)
> @JoinColumn(name = "IDFLAGTIPOCAPTURAPESO")
> private Flag flagTipoCapturaPeso;
> @Column(precision=15, scale=5)
> private BigDecimal peso;
> @Temporal(TemporalType.TIMESTAMP)
> private Date dataHoraCapturaPeso;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDUSUARIO")
> private Usuario usuario;
>
> @Column(length=255)
> private String justificativaPesagemManual;
>
> @OneToMany(mappedBy = "peso", fetch = FetchType.LAZY)
> private Set<PesagemRodoviariaImagem> pesagemRodoviariaImagens;
>
> get and set ...
> }
> {code}
>
> The class PesagemRodoviariaImage is like this:
> {code:java}
> package com.my.company;
> import java.util.Date;
> import javax.persistence.Entity;
> import javax.persistence.FetchType;
> import javax.persistence.GeneratedValue;
> import javax.persistence.GenerationType;
> import javax.persistence.Id;
> import javax.persistence.JoinColumn;
> import javax.persistence.ManyToOne;
> import javax.persistence.SequenceGenerator;
> import javax.persistence.Temporal;
> import javax.persistence.TemporalType;
> import javax.persistence.Transient;
> @Entity
> public class PesagemRodoviariaImagem extends AbstractEntity{
> private static final long serialVersionUID = 4181136886458805429L;
> @Id
> @SequenceGenerator(allocationSize = 1, name = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM", sequenceName = "IDPESAGEMRODOVIARIAIMAGEM")
> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PESAGEMRODOVIARIAIMAGEM_IDPESAGEMRODOVIARIAIMAGEM")
> private Long idPesagemRodoviariaImagem;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDPESO")
> private Peso peso;
> private String caminho;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDCONFIGURACAOFTP")
> private ConfiguracaoFTP configuracaoFTP ;
> @ManyToOne(fetch = FetchType.LAZY)
> @JoinColumn(name = "IDCAMERA")
> private Camera camera;
> @Temporal(TemporalType.TIMESTAMP)
> private Date dataHoraCapturaImagem;
> @Transient
> private byte[] conteudoArquivo;
> ... get and sets
> {code}
> and it super class is
> {code:java}
> public abstract class AbstractEntity extends AbstractState implements Entity {
> private static final long serialVersionUID = 1L;
> public AbstractEntity() {
> }
> public AbstractEntity(EntityState entityState) {
> this();
> this.setEntityState(entityState);
> }
> @Override
> public boolean equals(Object obj) {
> if (this == obj) {
> return true;
> }
> if (obj == null) {
> return false;
> }
> if(!(obj instanceof AbstractEntity)){
> return false;
> }
> AbstractEntity other = (AbstractEntity) obj;
> Long myId = getId();
> Long otherId = other.getId();
> if (myId == null || otherId == null) {
> if(myId == null && otherId == null){
> if(this.getClientId() != null && other.getClientId() != null){
> return this.getClientId().equals(other.getClientId());
> }
> }
> return false;
> }
> return myId.longValue() == otherId.longValue();
> }
> @Override
> public int hashCode() {
> Long id = getId();
> return (id == null) ? super.hashCode() : id.hashCode();
> }
> @Deprecated
> public void validate() throws DCLogicException {
> }
> @Override
> public String toString() {
> String description = getClass().getSimpleName() + "[ID:" + getId()+"]";
> if(this instanceof IDescricaoCustomizada){
> description += "["+((IDescricaoCustomizada)this).getDescricaoCustomizada()+"]";
> }
> if(this instanceof IDescricaoEntidade){
> description += "["+((IDescricaoEntidade)this).getDescricaoEntidade()+"]";
> }
> return description;
> }
> public boolean hasId() {
> return this.getId() != null;
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
3 years, 8 months