question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't rename classes in newly created maven project

See original GitHub issue

Apache NetBeans version

Latest release candidate

What happened

see title, log:

SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.refactoring.spi.impl.ParametersPanel$12
java.lang.IllegalArgumentException: file:/tmp/mavenproject1/src/test/java is not a valid classpath entry; it must end with a slash.
	at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.verify(SimplePathResourceImplementation.java:90)
	at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.verify(SimplePathResourceImplementation.java:43)
	at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.<init>(SimplePathResourceImplementation.java:108)
	at org.netbeans.spi.java.classpath.support.ClassPathSupport.createResource(ClassPathSupport.java:54)
	at org.netbeans.spi.java.classpath.support.ClassPathSupport.createClassPath(ClassPathSupport.java:124)
	at org.netbeans.modules.testng.DefaultPlugin.getOppositeLocation(DefaultPlugin.java:242)
	at org.netbeans.modules.testng.DefaultPlugin.getTestLocation(DefaultPlugin.java:183)
	at org.netbeans.modules.testng.GoToOppositeAction.appliesTo(GoToOppositeAction.java:335)
	at org.netbeans.modules.refactoring.java.ui.RenamePanel$2.run(RenamePanel.java:158)
	at org.netbeans.modules.refactoring.java.ui.RenamePanel$2.run(RenamePanel.java:113)
	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:132)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:116)
	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
	at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:83)
	at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
	at org.netbeans.modules.refactoring.java.ui.RenamePanel.initialize(RenamePanel.java:184)
	at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$12.run(ParametersPanel.java:641)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

How to reproduce

  1. create new maven project (“Java Applicaiton”)
  2. put cursor over class name, press CTRL+R

rename dialog with “please wait…” appears, exception in log.

Did this work correctly in an earlier version?

  • This used to work!

Operating System

linux

JDK

17.0.2

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

java.lang.IllegalArgumentException: file:/tmp/mavenproject1/src/test/java is not a valid classpath entry; it must end with a slash.

Indicates that it is adding the test folder to the cp, but there is no test folder in the new project template.

creating empty ./src/test/java fixes it.

reproducible in 13rc2

Are you willing to submit a pull request?

  • Yes I am willing to submit a PR!

Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
neilcsmith-netcommented, Jan 31, 2022

Closing as issue fixed for 13-rc3.

@mbien added folders is a useful conversation for elsewhere. May benefit from test and resources folders being in initial template. Both seem to cause users confusion at times.

0reactions
ebresiecommented, Jan 28, 2022

Is this a Java 17-sim? I see reference to small change in 17 release notes related to IllegalArgumentException.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven project in netbeans - how to rename a class from a ...
As you can imagine X-GUI depends on X. In X i have a class which i want to rename. I refactor it, of...
Read more >
3. How to Rename Spring Boot Project (Maven Project)
In this session, we are going to see how to rename spring boot or maven project.---------- Other related videos. ----------1.
Read more >
Rename refactorings | IntelliJ IDEA Documentation - JetBrains
Right-click the package you want to rename and from the context menu, select Refactor | Rename ( Shift+F6 ). If you have multiple...
Read more >
539789 – Egit seems to lock pack files => Maven ... - Bugs
Can't rename xxxx" The problem is, that the pack file (inside maven.1538655547236\.git\objects\pack\) seems to be locked by the egit process ...
Read more >
47301 – Refactoring: Can't rename class
Right-clicking on the File node in Explorer and choosing "Refactor->Rename" ends with Fatal error. Only possible workaround was to restart ide.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found