IntelliJ IDEA 15 Play 2.4 reverse routing method parameter "string cannot be applied to java.lang.String" - playframework-2.4

I use IntelliJ IDEA 15.0.4 to develop a Java Play! 2.4.4 application. Since a few months (I think it was because of an IntelliJ update, but not 100% sure) the following problem occurs:
Whenever I call a reverse route from a controller that takes a String as a parameter, the parameter is displayed as an error with the following message:
methodName (string) in ReverseMyController cannot be applied to (java.lang.String)
Here's a code example:
public Result myAction(String myId) {
// Do something...
// Redirect back to referrer
flash("success", "Action was a success");
if(!myId.isEmpty()) return redirect(controllers.routes.MyController.showItem(myId));
return redirect(controllers.routes.MyController.itemList(1));
}
In this example, the parameter myId passed to the method showItem would be error highlighted, like this.
I already tried fiddling with the Project Structure settings and searched Google, but to no avail. I hope somebody is able to help me with this, my OCD-self would really appreciate having a code base with no error hints again ;)

Accepted answer does not solve the problem that is why I am answering this old question.
I had the same problem with Play 2.5.4 and InteliJ 2016.1.3
I removed the type (String) from route declaration in routes file and InteliJ stopped highlighting it as error.
Change following:
GET /path/:string_arg controllers.MyController.myMethod(string_arg: String)
To
GET /path/:string_arg controllers.MyController.myMethod(string_arg)
and it works fine.

Yes, I meet the same issue as what you said. I think it is a bug of the IDEA 15.0.4, Have you tried to change to the older version before 15.0.4?

Related

Microsoft.Maui.IPropertyMapper - The type '' cannot be used as a type parameter... There is no implicit conversion

I'm trying to get maps to work on .net MAUI and found this blog post (linked to from the official MAUI blog). https://www.cayas.de/blog/dotnet-maui-custom-map-handler
I've downloaded the repo linked at the end of the blog but I can't get it to run.
In the blog post the MapHandler code looks like this:
public static IPropertyMapper<IMap, MapHandler> MapMapper = new PropertyMapper<IMap, MapHandler>(ViewMapper)
{ };
But in the repo it looks like this:
public static IPropertyMapper<MapView, MapHandler> MapMapper = new PropertyMapper<MapView, MapHandler>(ViewMapper)
{ };
Neither of which work for me, as I get the error (at runtime) below.
The type 'MapControlDemo.Handlers.MapHandler' cannot be used as type parameter 'TViewHandler' in the generic type or method 'PropertyMapper<TVirtualView, TViewHandler>'. There is no implicit reference conversion from 'MapControlDemo.Handlers.MapHandler' to 'Microsoft.Maui.IElementHandler'
Confusingly there are another couple of errors that shouldn't be errors??
Any ideas? I contacted the author and he suggested it could be my maui version as it works for him, but I'm on the latest.
Perhaps the author was building on a Mac.
I've confirmed that an attempt to build on Windows results in a build error. VS Version 17.3.0 Preview 1.1
The error I got was
Error CS0311 The type 'MapControlDemo.Handlers.MapHandler' cannot be used
as type parameter 'TViewHandler'
in the generic type or method 'IPropertyMapper<TVirtualView, TViewHandler>'.
There is no implicit reference conversion from
'MapControlDemo.Handlers.MapHandler' to
'Microsoft.Maui.IElementHandler'.
MapControlDemo (net6.0-android) C:\...\maui-maps\Handlers\MapHandler.cs 6
HOWEVER, I was able to RUN on Android - by selected an Android emulator as target (so using net6.0-android) and pressing F5 - therefore that error is misleading.
Given that this is only implemented on iOS and Android, I recommend editing .csproj to REMOVE Windows platform. I also removed MacCatalyst (maybe that would work but I was going for simplest test):
Change:
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
To:
<TargetFrameworks>net6.0-android;net6.0-ios</TargetFrameworks>
Then I was able to build.
NOTE: Without adding a Google Maps ID, when ran on Android, the result was an empty map.
tl;dr Easiest way to test is on a Mac, targetting iOS.

Tiki Net_LDAP2 class loading

I have a problem when I tried to integrate tiki with my LDAP server. In the test_ldap.php I wrote the code to debug according to this website (https://doc.tiki.org/LDAP%20authentication). This code returned a success. So I know that my LDAP is working fine. I have a problem at
$entry = Net_LDAP2_Entry::createConnected($this->_ldap, $this->_entry);
In the shiftEntry function in Search.php. When I return debug in here, it goes to ClassLoader.php and it go to
register_shutdown_function(function () {
TikiLib::events()->trigger('tiki.process.shutdown', []);});
In my opinion, maybe the problem is the
spl_autoload_call
The spl_autoload_call function called Net_LDAP2 which extends PEAR somewhere before this line in Search.php. This would lead both Net_LDAP2 and PEAR and PEAR_ERROR... Then when it comes to Net_LDAP2_Entry class, it would also load PEAR.... Would this create a fatal error?
I keep having blank screen in my tiki. Tried to cut the code from Search.php to the test_ldap.php to test. It has the same problem.
I am using:
Version 16.2
OS: Clear OS
Thanks for your help. I am blocked now.
I think this may be a good start: https://dev.tiki.org/item6283. If you look in the comments by albertgi he states changing some function names in PEAR.php. I was having LDAP integration problems and this was one of the key problems.

iTextSharp error, casting IncCell to Rectangle

I've been asked to look at C# code that's returning the following error:
Unable to cast object of type
'iTextSharp.text.html.simpleparser.IncCell' to type 'iTextSharp.text.Rectangle'.
at iTextSharp.text.pdf.PdfDocument.Add(IElement element)
at iTextSharp.text.Document.Add(IElement element)
It looks like they're using iTextSharp v5.0.2 and have not yet moved from HtmlWorker to XmlWorker.
Questions:
What is IncCell? I see it in the source docs but can't find any info about what it is - I'm assuming it's just for internal use.
Is this related to a cell in a table? A need for a Div or Paragraph within a cell?
What can they do to diagnose issues like this down to the HTML source that caused the error? I suspect this is an issue with not conforming to XHTML, but I can't verify that without knowing exactly what IElement that code was working on when it choked. It could be due to bad styling too, I have no idea at this time. Is there any kind of detail logging that will tell us what element is being processed at any given time? Should I just get them to load source and trace through it?
Is it probable that this will be fixed with an update to the latest version (currently 5.5.9), and a re-fit of XmlWorker?
Other recommendations?
Thanks!

I get errors when typing the #SidedProxy. What happened?

I am making a Minecraft Mod with Eclipse Mars and I got errors when typing the following:
#SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
What did I do wrong? It said "the attribute clientSide/serverSide is undefined for the annotation type SidedProxy" .
I cannot run Minecraft to test my mod without it, so I need to fix this error.
For a definitive answer you need to give us more information.
What version of minecraft forge are you using?
Have you correctly imported SidedProxy?
In eclipse, hold ctrl and click on #SidedProxy to open where it is declared, and check that you are using the correct attribute names (it may have changed between versions, so you may need to put something different)

resolving org.apache.jasper.JasperException

I have a small web application written using Java programming language . whenever I am trying to access a jsp page I am getting the following error..................
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /jsp/newInvoice_acct_not_in_db.jsp(101,3) The s:hidden tag declares that it accepts dynamic attributes but does not implement the required interface
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:777)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Validator.validate(Validator.java:1739)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Someone please help me find the solution for it..........
Your jSP has an compilation issue...Check whether your JSP fine
There's something wrong with a hidden tag in your JSP. Check the Struts 2 documentation on hidden tags (http://struts.apache.org/2.2.3/docs/hidden.html) to make sure everything's compliant. Try removing it temporarily, and if that fixes the problem start changing bits and pieces of it until you know what the problem is. Also, are you using Eclipse? If not you should, because it will make it a lot easier to figure out where things have gone wrong with your tags.