[ANN] Apache Karaf Europe Meetup on April 30th, 2020 in Karlsruhe, Germany

2020-02-28 Thread Jean-Baptiste Onofre
Hi all Apache Karaf enthusiasts !

The first Apache Karaf European Meetup will stand on April 30th, 2020 in 
Karlsruhe, Germany. 

Big thanks to Codecentric (especially Achim) for hosting and sponsoring this 
event.

It’s a great opportunity to meet people behind the Karaf project, share and 
discuss about vision and roadmap and enjoy talks about Apache Karaf use cases.

Don’t forget to register on Meetup: 
https://www.meetup.com/Paris-Apache-Karaf-Meetup-Group/events/269056325/ 


All details about schedule, venue, … will be shared on Meetup and website.

http://karaf.apache.org/news.html 

We are looking forward to see you there !

—
The Apache Karaf Team

Re: Unable to use JPA Attribute converters in karaf

2020-02-28 Thread Erdbeerheld1990
Hi,

yes of course. Seems to be only one feature.

karaf@root()> feature:list | grep jpa
camel-jpa   | 2.18.2   | 
| Uninstalled | camel-2.18.2  |
openjpa3| 3.0.0| 
| Uninstalled | enterprise-4.2.7  | OpenJPA engine support
deltaspike-jpa  | 1.3.0| 
| Uninstalled | org.ops4j.pax.cdi-1.0.0.RC1   | Apache Deltaspike jpa
support
openjpa | 3.0.0| 
| Uninstalled | openjpa-3.0.0 | Apache OpenJPA 3
persistence engine support
deltaspike-jpa  | 1.8.1| 
| Uninstalled | org.ops4j.pax.cdi-1.1.1   | Apache Deltaspike jpa
support
jpa | 2.7.2| 
| Started | aries-jpa-2.7.2   | OSGi Persistence
Container

Best regards
Andreas



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Unable to use JPA Attribute converters in karaf

2020-02-28 Thread Jean-Baptiste Onofre
Hi,

Can you share the features you have installed about jpa ?

Regards
JB

> Le 28 févr. 2020 à 15:38, Erdbeerheld1990  a écrit 
> :
> 
> Hello,
> 
> we are using karaf version 4.2.7 with blueprint. Now the first time we want
> to implement an  Attribute Converter
>    from JPA in order to
> convert the string content of a column to an Object. 
> 
> @Converter(autoApply = true)
> public class DynamicViewConfigurationConverterJson implements
> AttributeConverter {
> 
>  private final static ObjectMapper objectMapper = new ObjectMapper();
> 
>  @Override
>  public String convertToDatabaseColumn(DynamicViewConfiguration
> dynamicViewConfiguration) {
>try {
>  return objectMapper.writeValueAsString(dynamicViewConfiguration);
>} catch (JsonProcessingException ex) {
>  return null;
>}
>  }
> 
>  @Override
>  public DynamicViewConfiguration convertToEntityAttribute(String dbData) {
>try {
>  return objectMapper.readValue(dbData, DynamicViewConfiguration.class);
>} catch (IOException e) {
>  throw new RuntimeException(e);
>}
>  }
> 
> } 
> 
> And this is my entity:
> 
> @Entity
> @Table(name = "CAIS_DYNAMIC_VIEW")
> public class DynamicView {
>  private Long id;
>  private String viewName;
>  private String detailViewRoute;
>  private String translationKey;
>  private String viewCategory;
>  private DynamicViewConfiguration viewConfiguration;
> 
>  public DynamicView() {
>  }
> 
>  @Id
>  @GenericGenerator(name = "id_generator", strategy =
> "com.cedros.cais.persistence.generator.IdGenerator")
>  @GeneratedValue(generator = "id_generator")
>  public Long getId() {
>return id;
>  }
> 
>  public void setId(Long id) {
>this.id = id;
>  }
> 
>  @Column(name = "VIEW_NAME", nullable = false)
>  public String getViewName() {
>return viewName;
>  }
> 
>  public void setViewName(String viewName) {
>this.viewName = viewName;
>  }
> 
>  @Column(name = "DETAIL_VIEW_ROUTE")
>  public String getDetailViewRoute() {
>return detailViewRoute;
>  }
> 
>  public void setDetailViewRoute(String detailViewRoute) {
>this.detailViewRoute = detailViewRoute;
>  }
> 
>  @Column(name = "TRANSLATION_KEY", nullable = false)
>  public String getTranslationKey() {
>return translationKey;
>  }
> 
>  public void setTranslationKey(String translationKey) {
>this.translationKey = translationKey;
>  }
> 
>  @Column(name = "VIEW_CATEGORY")
>  public String getViewCategory() {
>return viewCategory;
>  }
> 
>  public void setViewCategory(String viewCategory) {
>this.viewCategory = viewCategory;
>  }
> 
>  @Column(name = "VIEW_CONFIGURATION", nullable = false)
>  @Convert( converter = DynamicViewConfigurationConverterJson.class)
>  public DynamicViewConfiguration getViewConfiguration() {
>return viewConfiguration;
>  }
> 
>  public void setViewConfiguration(DynamicViewConfiguration
> viewConfiguration) {
>this.viewConfiguration = viewConfiguration;
>  }
> }
> 
> 
> My Unit tests are working fine from spring context. But when i keep the
> @Convert annotation and run it in karaf, my DAOs are not starting. They are
> waiting for the persistence-Context and fail after some time - Declaritive
> Services:
> 
> Status: GracePeriod
> Blueprint
> 28.02.20 15:30
> Missing dependencies:
> (&(osgi.unit.name=caisPersistenceUnit)(objectClass=javax.persistence.EntityManager))
> Declarative Services
> 
> 
> When i remove the @Convert annotation it is not complaining, but then of
> course my attribute converter has not any effect. I would be very pleased
> for your help.
> 
> Best regards,
> Andreas
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html



Unable to use JPA Attribute converters in karaf

2020-02-28 Thread Erdbeerheld1990
Hello,

we are using karaf version 4.2.7 with blueprint. Now the first time we want
to implement an  Attribute Converter
   from JPA in order to
convert the string content of a column to an Object. 

@Converter(autoApply = true)
public class DynamicViewConfigurationConverterJson implements
AttributeConverter {
  
  private final static ObjectMapper objectMapper = new ObjectMapper();

  @Override
  public String convertToDatabaseColumn(DynamicViewConfiguration
dynamicViewConfiguration) {
try {
  return objectMapper.writeValueAsString(dynamicViewConfiguration);
} catch (JsonProcessingException ex) {
  return null;
}
  }

  @Override
  public DynamicViewConfiguration convertToEntityAttribute(String dbData) {
try {
  return objectMapper.readValue(dbData, DynamicViewConfiguration.class);
} catch (IOException e) {
  throw new RuntimeException(e);
}
  }

} 

And this is my entity:

@Entity
@Table(name = "CAIS_DYNAMIC_VIEW")
public class DynamicView {
  private Long id;
  private String viewName;
  private String detailViewRoute;
  private String translationKey;
  private String viewCategory;
  private DynamicViewConfiguration viewConfiguration;

  public DynamicView() {
  }

  @Id
  @GenericGenerator(name = "id_generator", strategy =
"com.cedros.cais.persistence.generator.IdGenerator")
  @GeneratedValue(generator = "id_generator")
  public Long getId() {
return id;
  }

  public void setId(Long id) {
this.id = id;
  }

  @Column(name = "VIEW_NAME", nullable = false)
  public String getViewName() {
return viewName;
  }

  public void setViewName(String viewName) {
this.viewName = viewName;
  }

  @Column(name = "DETAIL_VIEW_ROUTE")
  public String getDetailViewRoute() {
return detailViewRoute;
  }

  public void setDetailViewRoute(String detailViewRoute) {
this.detailViewRoute = detailViewRoute;
  }

  @Column(name = "TRANSLATION_KEY", nullable = false)
  public String getTranslationKey() {
return translationKey;
  }

  public void setTranslationKey(String translationKey) {
this.translationKey = translationKey;
  }

  @Column(name = "VIEW_CATEGORY")
  public String getViewCategory() {
return viewCategory;
  }

  public void setViewCategory(String viewCategory) {
this.viewCategory = viewCategory;
  }

  @Column(name = "VIEW_CONFIGURATION", nullable = false)
  @Convert( converter = DynamicViewConfigurationConverterJson.class)
  public DynamicViewConfiguration getViewConfiguration() {
return viewConfiguration;
  }

  public void setViewConfiguration(DynamicViewConfiguration
viewConfiguration) {
this.viewConfiguration = viewConfiguration;
  }
}


My Unit tests are working fine from spring context. But when i keep the
@Convert annotation and run it in karaf, my DAOs are not starting. They are
waiting for the persistence-Context and fail after some time - Declaritive
Services:

Status: GracePeriod
Blueprint
28.02.20 15:30
Missing dependencies:
(&(osgi.unit.name=caisPersistenceUnit)(objectClass=javax.persistence.EntityManager))
Declarative Services


When i remove the @Convert annotation it is not complaining, but then of
course my attribute converter has not any effect. I would be very pleased
for your help.

Best regards,
Andreas



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Apache Karaf community Meetup in April and CFP

2020-02-28 Thread Serge Huber
I think I will try to join remotely.

cheers,
  Serge...

On Fri, Feb 28, 2020 at 8:14 AM Jean-Baptiste Onofre 
wrote:

> Hi everyone,
>
> As suggested by Christian and Achim, I created Apache Karaf Meetup group
> and announce the European Meetup in Germany:
>
> https://www.meetup.com/Paris-Apache-Karaf-Meetup-Group/events/269056325/
>
> It will be easier for the organisation.
>
> Please don’t forget to register on Meetup.
>
> This Apache Karaf Meetup will be also used for virtual meetup, and next
> "concrete" meetup we will organize.
>
> Regards
> JB
>
> Le 19 févr. 2020 à 12:13, Achim Nierbeck  a
> écrit :
>
> Hi all,
>
> JB and I had a call yesterday trying to organize our first Apache Karaf
> community event.
> As it's already end of February, the date for March has been a bit to
> close for comfort.
> Therefore we decided to move the event to the 30th of April.
> My employer the codecentric AG will host the event in our venue here in
> Karlsruhe.
> Therefore we will start in the early afternoon at 4 p.m.
> JB and I thought about 4 slots of talk and some pauses in between.
> I would like to call for participation in giving a talk.
> Right now we have the following kind of schedule planned:
>
> Start at 4 p.m have 2 talks, and some networking.
> Around 6:30 p.m. we'd like to start with the "second" half of the
> community event which we like to open even further to more people outside
> this community.
> We will advertise the second half with another two talks more broadly in
> the local communities.
>
> One note regarding technical setup, we're evaluating if it's possible to
> have the talks available live via a zoom call. This isn't "fixed" yet, and
> if we're able to create such a setup, people who would like to join
> remotely will only be allowed by invitation.
>
> Hope to get a bunch of feedback by the community :)
>
> thanks, Achim
> --
>
> Apache Member
> Apache Karaf  Committer & PMC
> OPS4J Pax Web  Committer &
> Project Lead
> blog 
> Co-Author of Apache Karaf Cookbook 
>
>
>