Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java 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
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

About AuthenticationEntryPoint

 
Ranch Hand
Posts: 33
  • 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: 24715
59
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: 33
  • 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: 24715
59
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: 24715
59
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: 33
  • 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: 24715
59
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: 2783
367
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: 33
  • 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: 2783
367
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: 33
  • 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: 2783
367
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: 33
  • 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: 33
  • 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: 2783
367
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?

 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!