Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

About AuthenticationEntryPoint

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I create java class "SpringSecurityConfig", But he swears that it is necessary to create a variable "AuthenticationEntryPoint". It must be created in the same package? How to create an AuthenticationEntryPoint


 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I notice that your code is very similar to the tutorial here: Spring Security Basic Authentication. That's a good start. However there's a line very near the beginning which is the answer to your question, and you haven't included that line in your code.
 
Steve Gates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:I notice that your code is very similar to the tutorial here: Spring Security Basic Authentication. That's a good start. However there's a line very near the beginning which is the answer to your question, and you haven't included that line in your code.




 
Paul Clapham
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so you are using that tutorial. In answer to your other question, yes, that code must be in a package. Spring can't autowire classes which aren't in a package.

But back to your main question, which I'm guessing you don't know the answer to yet. (You didn't say that.) Look at lines 5 and 6 of the class where you're getting that error message. Notice how it declares a variable of the right type.
 
Paul Clapham
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also notice the difference between declaring a variable of a type (which you didn't do, hence the error message) and declaring a type (which you did do).
 
Steve Gates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Okay, so you are using that tutorial. In answer to your other question, yes, that code must be in a package. Spring can't autowire classes which aren't in a package.

But back to your main question, which I'm guessing you don't know the answer to yet. (You didn't say that.) Look at lines 5 and 6 of the class where you're getting that error message. Notice how it declares a variable of the right type.



MyBasicAuthenticationEntryPoint.java

CustomWebSecurityConfigurerAdapter.java

they are in one package
 
Paul Clapham
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Steve Gates wrote:they are in one package



Yes, I think that's the best choice. So can I mark this topic as resolved now?
 
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you fixed this?
 
Steve Gates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Steve Gates wrote:they are in one package



Yes, I think that's the best choice. So can I mark this topic as resolved now?




error
 
Ron McLeod
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to escape the quotes inside the string:
 
Steve Gates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:You need to escape the quotes inside the string:



Sorry, I kind of did it right there, how can I write correctly
 
Ron McLeod
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at my last response.  
 
Steve Gates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:Look at my last response.  



Thank YOU)))))
 
Steve Gates
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:Look at my last response.  



Can the last question.
Why does this error come out for me? I kind of wrote it right

 
Ron McLeod
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The last line in the error message seems to indicate you have a problem in your Java code.  Do you see any complaints when you compile?

 
Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
Java Code Review and Psychology
https://coderanch.com/t/714798/java/Java-Code-Review-Psychology
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!