-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stripes ActionBeans not found when jar is built as 'executable' #4310
Comments
Then it's not similar to #3413. I don't know what Ebeans and Stripes are but maybe they need the content to be unpacked in the jar somehow. Have you seen this option? Can you try it on your project? |
Sorry I wasn't clear, its our own classes, already unpacked in the jar, Ebeans is an ORM layer, its used by the Play Framework but we use it Stripes is a web framework like Struts or Spring MVC. Both scan your own code for classes you've written and load them. This worked fine when our code was packages as a war or when we run On Tue, Oct 27, 2015, 3:53 AM Stéphane Nicoll [email protected]
|
@jbcpollak Can you provide a small sample that reproduces the problem please? |
@wilkinsona Please see here: https://github.com/AssuredLabor/spring-boot-issue-4310 the readme for the project is included below for reference and to clarify the problem. I noticed the classloader changes between the two running modes, I assume that is the problem. Code works when run from .class filesFirst run the project from Maven:
In the logs you should see these lines:
The first and last lines above indicate Ebeans was able to scan for the class When you visit http://localhost:8080/page/welcome you will see the text Code is broken when run as a JARNow run the following commands:
In the logs you will see:
The first and last lines indicate Ebeans was unable to find When you visit http://localhost:8080/page/welcome you will get a 500 error in the browser and there will be an exception in your logs:
Notice the WelcomeBean and ErrorBean classes are not listed as registered ActionBeans. |
I debugged into Stripes a bit and found they use the first four bytes of the resource to verify it is a JAR file. So with With executable set to false, Stripes will register the ActionBeans, but when the ActionBean forwards to a JSP, the JSPs can't be resolved. I followed the jsp limitiations advice here and example here. In short, if I put the jsps in In summary, Stripes is compatible with Spring-Boot only if there is a way to get the JSPs working, and you can live with executable=false. Any advice on getting the JSPs working would be appreciated. |
Ebeans version |
Shouldn't you report that issue to the Stripes issue tracker instead please? As for the JSP support, this sounds like a totally unrelated issue so let's not discuss that here please. |
That's a Stripes issue. If you want to continue to use |
It's not the magic bytes that are a problem here, it's Stripes assuming that the archive's name will end with import java.net.MalformedURLException;
import java.net.URL;
import org.springframework.util.ResourceUtils;
import net.sourceforge.stripes.vfs.DefaultVFS;
public class SpringBootVfs extends DefaultVFS {
@Override
protected URL findJarForResource(URL url) throws MalformedURLException {
return ResourceUtils.extractJarFileURL(url);
}
} This seems to work with an In short, I don't think there's anything in Spring Boot that's stopping this from working. I've offered some help to improve Ebeans' classpath scanning. You may want to open a Stripes issue to remove the need for the custom VFS implementation. |
Agreed - This is a Stripes problem, combined with the JSP problem. Is this the best place to track the JSP issue? @wilkinsona - Thanks for the advice, I'll try out the Stripes workaround, but its pointless until the JSPs are fixed. |
With some changes to Stripes and EBeans there won't be a JSP problem as you'll be able to use a .war file run with |
Thanks, I'll give it a shot |
@wilkinsona - I don't want to drag this thread on here, but for anyone else who might come across this I create an issue in Stripes and will continue the conversation there. |
This issue seems to be very similar to #3413.
When we run our project from an IDE (Eclipse) everything works fine and both Ebeans and Stripes are able to scan our packages for the classes they need.
When we build as a jar with configuration in our pom file:
Ebeans fails to find classes annotated with
@Entity
classes and Stripes fails to find classes that implementActionBean
.When I remove the
<executable>
tag as #3413 suggests, there is no change.I've also tried downgrading to the 1.2.7 version of the plugin with no change.
The text was updated successfully, but these errors were encountered: