java-ee

what are the java* configuration for oauth2 to return token after authentication

余生长醉 提交于 2020-01-07 02:43:06
问题 Hi I am using spring boot for my project so I am not using xml for any of my configurations, only java. I am using this project on github as a reference https://github.com/techdev-solutions/jaxenter-showcase . When I make a request(http://localhost:8081/oauth/authorize?client_id=web&response_type=token with username and password in header) for the token it returns the redirect html site not the token.. How do I configure oauth2 to return the token in the response. If I send a request using

EJB Rollback does not work with Container Management Transaction or Bean Managament Transaction on commit exception

给你一囗甜甜゛ 提交于 2020-01-07 00:06:22
问题 I spent hours triying to do a rollback with EJB. I have a CDI controller where I want to remove some object. When I try to remove in EJB I get an exception and I Try to do rollback, but It does not work. Every SQL which has been execute with commit before get the exception does not rollback. Obviusly It is not because I get another exception when I try to do the rollback in BMT. Otherwise when I tried with CMT I get an exception of hibernate but I get the same results that BMT. My controller

JPA, are query hints vendor specific?

僤鯓⒐⒋嵵緔 提交于 2020-01-06 23:03:28
问题 Are there JPA - vendor neutral - query hints that can be used ? During my google searches on query hints every mention of it has been a vendor specific query hint. From the doc: Set a query property or hint. The hints elements may be used to specify query properties and hints. Properties defined by this specification must be observed by the provider. Vendor-specific hints that are not recognized by a provider must be silently ignored. Portable applications should not rely on the standard

Performance issue : Resultset Iteration

不打扰是莪最后的温柔 提交于 2020-01-06 21:05:51
问题 I want someone to clarify my below questions. 1) Currently I am calling procedure from java code and getting result set. To iterate 500 hundreds records it is taking 20 secs. I tried various fetchSize like 50, 100, 300, 501, 2000, 4000 but no improvement. Can some one suggest on this. 2)To use query instead of procedure will improve result set iteration performance ? 3) Any other suggestion ? Code Snippet : CallableStatement callableStatement =((SessionImpl)getSessionFactory()

Establishing the URLConnection to another web application does not work with URLConnection .connect()?

对着背影说爱祢 提交于 2020-01-06 20:06:23
问题 Here is the code i am using the open the URLConnection to another webapllication try { URL url = new URL("https://mySecondWebApp/Cart"); HttpsURLConnection conn1 = (HttpsURLConnection) url.openConnection();//line1 conn1 .connect();//line 2 does not establishes the connection conn1.getInputStream();// line 3 works which means that i get control to my app2 in debugger.But this also passes the control to IOException stating error java.io.FileNotFoundException: https://mySecondWebApp/Cart } catch

Upload file on server through rtmps+java

守給你的承諾、 提交于 2020-01-06 20:02:16
问题 I need to upload file on server through flex GUI which send file on server with using rtmps protocol. I tried to send on server just FileReference and request has performed, but on server side i got only empty ObjectMap. I know that I can user URLRequest, but I need exactly rtmps request. My Flex code: public function uploadFile(file:FileReference):void{ NetConnection nc = new NetConnection(); nc.client = this; nc.proxyType = "best"; nc.connect(connectionURL, "3.0", "userName", "password");

Why SingularAttribute is not Serializable?

戏子无情 提交于 2020-01-06 19:42:52
问题 I want to pass a metamodel attribute of a JPA entity as a parameter to the remote interface of a session bean. As you know, type of this object is javax.persistence.metamodel.SingularAttribute . I was using Hibernate previously and there was no problem, but now with EclipseLink, metamodel attributes is not Serializable . It seems that EclipseLink populate attributes with not serializable objects. Why? I am using Glassfish 3.1.2.2 and my project dependencies are as below: <dependency> <groupId

Why JNDI resource can only be called once in Tomcat?

…衆ロ難τιáo~ 提交于 2020-01-06 16:01:32
问题 When I was learning how to use JNDI resources in Tomcat 7, a customized bean factory has been made, called MyBeanFactory . It provides external resources to my web application. At the first time, we assume that it provides the current system timestamp. However, I realised that MyBeanFactory was called only once, at the first request. It seems that the java bean MyBean had be stored in Tomcat after the first execution. Then MyBean is reused by every request. No matter when I retape the URL in

How to creates Tokens in SAML?

流过昼夜 提交于 2020-01-06 15:29:04
问题 I am new to SAML. I want create a TOKEN. Please help me in Creation. what r the steps i have to follow? 回答1: Steps to create SAML token for idp-initiated authentication from salesforce are given here Understand SAML Single Sign-On (SSO) Service here. You will use openSAML libraries which can be found here. 来源: https://stackoverflow.com/questions/6327516/how-to-creates-tokens-in-saml

EntityManager is null inside Pojo class in ejb container

前提是你 提交于 2020-01-06 15:04:36
问题 I have a Java web service module and ejb modulein netbeans (All part of an enterprise application). the web service is consuming the ejb class using @EJB injection. Inside the ejb module i have a TransactionManager class which is not an enterprise bean. just a POJO class. I am trying to inject the EntityManager using @PersistanceContext(unitName = "testPU") EntityManager em; but the em is allways null. I am calling the TransactionManager class from by bean, and if i declare the EntityManager