Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jersey-dev] [External] : how do I get these features when using Glassfish (payara)

The good news is I got the HttpAuthentication feature working and I also
registered the logging feature. The bad news is it doesn't marshall
correctly and ignores annotations on my object for field names and the
date converter.

I right clicked the "Libraries" for my ejb project and I added
jersey-client.jar, jersey-core.jar, and jersey-media-json-jackson.jar
files. My ejb compiles and runs. I created a helper class that has the
connection details and then I tell it to POST. I tried posting to the
payara channel about how to use these extra libraries in the modules
folder and no response. 

I can see the logging data and posting to the REST service. The problem
now is it ignores the JAXB annotations. :( 

Is there a way to turn on logging for processing of annotations? Below
are two examples of annotations that it misses when marshalling. The
resulting json just comes out with the field names....

@XmlElement(name = "registered_state_abbr")
private String registeredStateAbbreviation;

@XmlElement(name = "disciplinary_action_end_date")
@XmlSchemaType(name = "date")
@XmlJavaTypeAdapter(DateAdapter.class)
private Date end;

Any tips?

Brian


On Fri, Apr 30, 2021 at 03:59:07PM -0700, Ed Bratt wrote:
> Brian,
> 
> Someone here may be able to help you but, if you have not, you might try
> asking on the Payara Forum: https://groups.google.com/g/payara-forum?
> 
> -- Ed
> 
> On 4/30/2021 2:24 PM, Brian E. Lavender wrote:
> > I am using Payara server(payara-5.2020.7) . The thing is, this application is an old Ant
> > application and we have just copied additional jar dependencies in the
> > lib section for the ejb app.
> > 
> > I successfully built a stand alone jersey-client application of the
> > client. Now, I am trying to integrate that logic into the ejb app. Thing
> > is, I seem to have a couple pieces of code for which there seems to be
> > a missing dependency.
> > 
> > One, is using the HttpAuthentication feature. These are the pieces that
> > show errors when I try to use them with my Payara app server.
> > 
> > HttpAuthentication Feature.
> > 
> > ```
> > HttpAuthenticationFeature feature =
> >      HttpAuthenticationFeature.basic(user, pass);
> > client.register(feature);
> > ```
> > 
> > Use the client builder to build the client. Is there a different method
> > for build the client when using Glassfish?
> > 
> > ```
> > client = ClientBuilder.newBuilder()
> >      .property(LoggingFeature.LOGGING_FEATURE_VERBOSITY_CLIENT,
> >      LoggingFeature.Verbosity.PAYLOAD_ANY)
> >      .property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_CLIENT,
> >      "INFO").build();
> > ```
> > 
> > The following are the missing imports when using Glassfish.
> > 
> > ```
> > import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
> > import org.glassfish.jersey.logging.LoggingFeature;
> > ```
> > 
> > Any tips on this?
> > 
> > Brian

-- 
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture


Back to the top