PAX-CDI+PAX-WEB: org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308: Unable to resolve any beans for Type

251 views
Skip to first unread message

iJava

unread,
Sep 2, 2016, 8:27:05 AM9/2/16
to OPS4J
Hi all,

I have a very very bad problem with pax-cdi and pax-web. My configuration: jetty 9.3.11.v20160721, weld 2.2.12.Final, pax-cdi 0.13.0-SNAPSHOT, pax-swissbox 1.8.0 , pax-web 6.0.0-SNAPSHOT.

The problem is that the SAME war bundle sometimes works fine, sometimes I get the exception:

org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308: Unable to resolve any beans for Type: class com.example.SomeClass; Qualifiers: [@javax.enterprise.inject.Any()]
    at org
.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:101)

When I set logging level to debug - I see in weld log file that class com.example.SomeClass is found with qualifiers Any and Default.

However, when logging level is set to debug and everything works much slower I don't get this exception. However, when I set
logging level to warn and everything works fast I SOMETIMES get this exception. So it may be about timing???

Please, any help and hints....

iJava

unread,
Sep 3, 2016, 8:35:16 AM9/3/16
to OPS4J
Please, any hint. The problem still not solved...

iJava

unread,
Sep 9, 2016, 4:01:12 PM9/9/16
to OPS4J
I think I've found the problem. I have noticed that classes (Models) which were not found
had one feature - @Inject @OsgiService field. The injected osgi services were DS
OSGI services and I did them this way:
@Component(
    immediate = false,
    scope=ServiceScope.SINGLETON
)

When I changed services to
@Component(
    immediate = true,
    scope=ServiceScope.SINGLETON
)
the problem (as it seems to me) disappeared. So, as I understand there was time lag that when
Model Class which used osgi service was being created the osgi service bean wasn't ready. Thats
why BeanManager could find that bean. Can my explanation be right?

суббота, 3 сентября 2016 г., 15:35:16 UTC+3 пользователь iJava написал:

Achim Nierbeck

unread,
Sep 9, 2016, 4:43:55 PM9/9/16
to op...@googlegroups.com
Hi, 

yes a lazy initialization might lead to that, especially when combined with a proxy based service consumer. 

regards, Achim 


--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply all
Reply to author
Forward
0 new messages