JPA Server Base and Example

693 views
Skip to first unread message

whitew...@gmail.com

unread,
Aug 29, 2017, 8:50:19 AM8/29/17
to HAPI FHIR
Hi James,



I download latest commit from github, and i has been notice that there are anything that not run correctly.

1. There are some class that extends BaseJavaConfigDstu3 or 2 but i not find this classes. In Eclipse I have any error.
2. If I substitute BaseJavaConfigDstu3 or 2 class with BaseDstu3Config or 2 the server start with this error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'subscriptionSecurityInterceptor': Unsatisfied dependency expressed through field 'myDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'ca.uhn.fhir.jpa.dao.IFhirResourceDao<org.hl7.fhir.dstu3.model.Subscription>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=mySubscriptionDaoDstu3)}.....

I have no idea how to solve this problem

James Agnew

unread,
Aug 29, 2017, 9:04:06 AM8/29/17
to whitew...@gmail.com, HAPI FHIR
Hi there,

The class which extends that class is found in specific implementation projects (ie. ones you create). You can see a sample here: https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfigDstu2.java

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/0cf28cc5-91ce-447c-b04f-9363799c3c08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

whitew...@gmail.com

unread,
Aug 29, 2017, 9:23:07 AM8/29/17
to HAPI FHIR, whitew...@gmail.com
I also downloaded this project, but i don't find this extended class. I have many compiler error notify by Eclipse IDE because the class BaseJavaConfigDstu3 not exist in hapi-fhir-jpaserver-example. This class is also used in test classes there are present in hapi-fhir-jpaserver-base.  


Il giorno martedì 29 agosto 2017 15:04:06 UTC+2, James Agnew ha scritto:
Hi there,

The class which extends that class is found in specific implementation projects (ie. ones you create). You can see a sample here: https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfigDstu2.java

Cheers,
James
On Tue, Aug 29, 2017 at 8:50 AM, <whitew...@gmail.com> wrote:
Hi James,



I download latest commit from github, and i has been notice that there are anything that not run correctly.

1. There are some class that extends BaseJavaConfigDstu3 or 2 but i not find this classes. In Eclipse I have any error.
2. If I substitute BaseJavaConfigDstu3 or 2 class with BaseDstu3Config or 2 the server start with this error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'subscriptionSecurityInterceptor': Unsatisfied dependency expressed through field 'myDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'ca.uhn.fhir.jpa.dao.IFhirResourceDao<org.hl7.fhir.dstu3.model.Subscription>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=mySubscriptionDaoDstu3)}.....

I have no idea how to solve this problem

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.

James Agnew

unread,
Aug 29, 2017, 9:33:41 AM8/29/17
to whitew...@gmail.com, HAPI FHIR
The class which extends BaseJavaConfigDstu3 is just just called FhirServerConfig.java. You can see it here: https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfig.java

Cheers,
James

To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.

To post to this group, send email to hapi...@googlegroups.com.

whitew...@gmail.com

unread,
Aug 29, 2017, 9:37:47 AM8/29/17
to HAPI FHIR, whitew...@gmail.com
I see that, but i don't find BaseJavaConfigDstu3.

My IDE say me that "BaseJavaConfigDstu3 cannot be resolved to a type"

James Agnew

unread,
Aug 29, 2017, 10:13:38 AM8/29/17
to whitew...@gmail.com, HAPI FHIR
There should be no references to a class by that name in the latest codebase.

Maybe try doing a fresh clone of the GitHub repository? If that doesn't work, can you please link to the place in the code on GitHub that is giving you issues?

Cheers,
James

To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.

To post to this group, send email to hapi...@googlegroups.com.

whitew...@gmail.com

unread,
Aug 29, 2017, 10:48:26 AM8/29/17
to HAPI FHIR, whitew...@gmail.com

James Agnew

unread,
Aug 29, 2017, 11:03:00 AM8/29/17
to whitew...@gmail.com, HAPI FHIR
Ah ok, the BaseJavaConfigDstu3 that that class refers to is a generated class, created during the HAPI build. Because it's generated code, it's not saved in the repository.

If you have built the entire HAPI FHIR project using Maven (by doing "mvn install" from the root of the project) you'll find it at the following location:

./hapi-fhir-jpaserver-base/target/generated-sources/tinder/ca/uhn/fhir/jpa/config/BaseJavaConfigDstu3.java

Cheers,
James

To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.

To post to this group, send email to hapi...@googlegroups.com.

whitew...@gmail.com

unread,
Aug 29, 2017, 11:07:49 AM8/29/17
to HAPI FHIR, whitew...@gmail.com
Ok Thanks, I'll try this solution!

whitew...@gmail.com

unread,
Aug 30, 2017, 9:57:24 AM8/30/17
to HAPI FHIR, whitew...@gmail.com
Hi James,

I followed your indications and I have compile and start a correct jpa server.
Thank you.

Now I ask you some information about the use of Subscription fhir resource. In particular, when my client update one old active Subscription resource, this update action is manage by yours code?
I mean, when the client update the resource, I expect that the server update the resource on database. But when the update on the database is correctly over; yours code how manage the change?

1) Create one new Subscription in memory for check criteria operation, mantaining the old one (This scenario is a problem for me)
2) Alter the old Subscription in memory, allining it to the saved one (This scenario is best for me)

Thanks in advance.

plum...@gmail.com

unread,
Aug 1, 2018, 2:46:49 AM8/1/18
to HAPI FHIR
Hi James,

I've tried this using IntelliJ and I get the same error after building the project : can't resolve BaseJavaConfigDstu3
Any hints on doing this in IntelliJ?

Regards
Darren

James Agnew

unread,
Aug 1, 2018, 5:32:13 AM8/1/18
to plum...@gmail.com, HAPI FHIR
Did you build the project as described above? Does that class appear in the specified location?

Reply all
Reply to author
Forward
0 new messages