Topic
11 replies Latest Post - ‏2013-06-27T17:55:53Z by Jason@J2EE
SUP3_Tim_De_Vos
SUP3_Tim_De_Vos
16 Posts
ACCEPTED ANSWER

Pinned topic WSDT and code/resource update problems.

‏2012-10-17T12:42:05Z |
Hi,

I try to use Websphere development tools on Eclipse Juno 4.2 but I can't get it working nicely. The project is a Maven project and I followed the procedure as described in https://www.ibm.com/developerworks/wikis/download/attachments/113607155/RAD_m2e.pdf?version=1.

I tried serveral settings:

  • Automatically publish when resources change
  • Run server with resources within workspace
  • Minimize application files copied to the server: off

When I change code the following error occurs:


[17/10/12 14:23:00:036 CEST] 00000051 wtp           E org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl rollUpRoles An error occurred 

while processing the roles in module Web Module        [ org.eclipse.jst.j2ee.application.internal.impl.WebModuleImpl@12e81501 ] URI               [ ubench.war ] Alt DD            [ 

null ] Context Root      [ ubench ] 

for application D:\Programs\IBM\WebSphere_85\AppServer\profiles\AppSrv01\wstemp\st_pub1350476575535\workspace\cells\Tim-PCNode02Cell\applications\ubenchEAR.ear\ubenchEAR.ear, error message=org.eclipse.jst.j2ee.commonarchivecore.internal.impl.FileImpl incompatible with org.eclipse.jst.j2ee.commonarchivecore.internal.Archive [17/10/12 14:23:00:110 CEST] 00000051 FFDCJanitor   I com.ibm.ws.ffdc.impl.FFDCJanitor doCleanupIfNeeded FFDCJANITOR_DELETED_FILES


If I change the publishing mode to "Automatically publish after a build event", the same error occurs.

However, when I change the publishing mode to "Never publish automatically" updates are going well except for JSP and XHTML files. I see that they are not updated in the map D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0.

Am I doing something wrong. What is strange to me is that even I checked "run server with resources within workspace" the files do get copied to D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0. I thought that the point of "resources within workspace" is that nothing needs to get copied.

Does anyone else experience those problems with Maven enabled projects.

Regards,
  • StevenHung
    StevenHung
    21 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-02T21:48:40Z  in response to SUP3_Tim_De_Vos
    I wasn't able to access the RAD_m2e.pdf file, but I believe it would be similar to https://www.ibm.com/developerworks/wikis/download/attachments/113607155/RAD_m2e-Nov.pdf?version=1, so I followed the steps there.

    I wasn't able to get the error you were seeing. Is it possible to attach a project that has this issue? Or describe the project in more detail?

    If you follow the maven resource mappings, it will result in the project becoming non-single root. If you go to your Markers view, you should see warnings like:

    Broken single-root rule: The output folder for a web project must be <root folder>/WEB-INF/classes

    As a result, projects that have this warning will have their files copied from the workspace into the metadata directory. Therefore, even if you make changes in the workspace, it will not be picked up by the server until you do a publish. The publish will copy the files to the metadata directory and the server will be using those files.

    In the case where you have "Never publish automatically", you must press publish on the server, otherwise the changes will not be reflected on the server.

    Thanks
    • Jason@J2EE
      Jason@J2EE
      1 Post
      ACCEPTED ANSWER

      Broken single-root rule: The output folder for a web project must be <root folder>/WEB-INF/classes.

      ‏2013-06-27T17:55:53Z  in response to StevenHung

      I had the same issue regarding broken single-root rule. I imported a project from Eclipse Juno into Rational Application Developer and received the following message: Broken single-root rule: The output folder for a web project must be <root folder>/WEB-INF/classes.

      My assumption, Rational Application Developer IDE had "Default output folder" field with default value of <root folder>/WebContent/WEB-INF/classes. I set up my project as the following: <root folder>/webapp/WEB-INF/. I changed the value by going to Project's properties and edited the value in text input field in Java Build Path under the Source tab to <root folder>/webapp/WEB-INF/classes.

      As an option, you could click on Browse button to select the path to WEB-INF/classes folder. The RAD warning about Broken single-root rule disappeared. This could also be similar issue on other Eclipse IDEs when importing projects but haven't seen one yet except RAD.

  • SUP3_Tim_De_Vos
    SUP3_Tim_De_Vos
    16 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-05T11:04:44Z  in response to SUP3_Tim_De_Vos
    Hi,

    Thanks for your reply. I'll try to clearify the project structure.

    We have a few projects

    ubcommon (contains common code for different EAR projects)
    ubbo (contains database objects)
    ubbusiness (contains business logic)
    ubench (contains XHTML, JSP files, Struts actions and JSF beans)
    ubenchEAR (EAR project with deployment assembly to ubench).
    The is a simple representation of our case. The message of "Broken single root rule" does not appear in the markers of the project.

    What I find strange is the following behaviour:

    If I set to "Never publish automatically" and "Run server with resources within workspace". The files of the ubench project are copied
    to D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0. ubbusiness, ubbo and ubcommon are not copied to
    D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 even not as jar. Now if I make a code change in the method of a
    body (not in the intreface or class structure) WAS picks it up immediatly. Even if I don't publish.
    Those changes can be in ubcommon, ubbo, ubbusiness or ubench. So the eclipse plug-in is able to load all class files of ubbusiness, ubbo and ubcommon
    directly from the workspace. Now I'm pretty sure that the D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 is not used for the class files. Let me clarify this.

    I have a struts action WelcomeAction.class. If I start WAS, choose "Add/Remove..." and add ubench.EAR than D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 is
    filled with the class files of the ubench project. Now let's change in the WelcomeAction a method and add a statement like "System.out.println("Hello World! I'm updated!").
    WAS picks it up immediatly when I call the action and "Hello World! I'm updated!" appears on my console. However If I navigate to
    D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 the timestamp of the WelcomeAction class is not updated. It is only updated in the maven target directory.

    Whenever I right click and choose publish I got the error as mentioned in the initial post. However, if I make a change in a JSP or an XHTML file it does not see the change.
    So for now a temporary workaround I created an ant script which copies the JSP and XHTML files to D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0. but I still
    don't understand why it copies the files to D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 and I'm still not able to do a publish. I always need to
    restart my server and choose "Add/Remove..."

    Thanks for your reply!
  • StevenHung
    StevenHung
    21 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-06T22:28:58Z  in response to SUP3_Tim_De_Vos
    Thank you for explaining the project structure.

    1. If you don't see the "Broken single root rule", then I would assume it's caused by your web project having an output folder that is not the default (that is, I assume it's following Maven, so it's something like "target/classes" instead of the default output folder when creating a web project)

    2. Not all projects will be copied to the metadata directory. If we're able to use the resource directly on the workspace without copying, it will try to do that. That is why ubbusiness, ubbo and ubcommon are not copied. ubench was determined to be non-single root, so files are copied to the metadata directory. This behaviour is expected (this occurs in non-Maven workspaces too). Examples of ways to make it non-single root is to have non-default output folders (I've seen it in web projects), multiple output folders, and linked resources

    2. "Now if I make a code change in the method of a
    body (not in the intreface or class structure) WAS picks it up immediatly." I am assuming you are talking about files in ubbusiness, ubbo and ubcommon?

    This behaviour does seem strange. Are you running the server in debug mode? If so, it will pick up certain changes without doing a publish.

    If you are running in normal run mode (not debug), then a publish is required to pick up the class files.

    3. I believe the behaviour you are describing for WelcomAction.class sounds consistent with having a server in debug mode. This is the situation where the server picks up the change (via hot code replace), but the metadata directory is not updated (can you confirm?)

    4. Is there more to this error than what you pasted in your initial post? Does a dialog pop up saying the publish has failed (with details or a strack trace) and that the application is in a stopped state (you can see via the console whether the application failed to start). If there is a stack trace output to the console, it would be useful to see.

    Thanks
  • SUP3_Tim_De_Vos
    SUP3_Tim_De_Vos
    16 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-07T08:54:35Z  in response to SUP3_Tim_De_Vos
    Hi,

    First I would like to thank you for your well explained professional response. It makes me better understand this plug-in.

    I'm happy to answer your questions:

    1. I checked the output folders:

    
    ubench: ubench/target/classes ubbo: ubbo/target/classes ubbusiness: ubbusiness/target/classes ubcommon: ubcommon/target/classes
    


    2. So if I understand I must make ubench single root. I checked the deployment assembly in the ubenchEAR project and it is defined as follows:

    
    /src/main/application -> /  /target/m2e-wtp/ear-resources -> ubench -> ubench.war
    


    Can I make this single-root? I don't know how I can achieve this.

    3. The server runs in debug mode. The changes are picked up from all projects (ubbusiness, ubbo, ubcommon and even ubench) as long as I
    only change code in the method body. Class definition changes are, of course, not possible.

    4. The server runs in debug mode and the metadata directory is indeed not updated.

    5. There is indeed an error in eclipse:

    
    The publish encountered some problems and the application may not have been installed or it may have been successfully installed but was unable to start. View the Details to display the exceptions and server logs that occurred during the publish.   ======== ubenchEAR ========   The application did not update: The application did not update: For details about the failure, refer to the Console view to see the log output of the server. . [7/11/12 9:38:04:504 CET] 00000065 FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Programs\IBM\WebSphere_85\AppServer\profiles\AppSrv01\logs\ffdc\server1_62b1e551_12.11.07_09.38.04.4994174340787461066321.txt com.ibm.ws.management.application.task.ConfigRepoHelper.getDesiredEarFileFromBinaries 789 [7/11/12 9:38:04:507 CET] 00000065 FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Programs\IBM\WebSphere_85\AppServer\profiles\AppSrv01\logs\ffdc\server1_62b1e551_12.11.07_09.38.04.5071841369133883043209.txt com.ibm.ws.management.application.task.ConfigRepoHelper.getDesiredEarFileFromBinaries 799 [7/11/12 9:38:04:552 CET] 00000065 FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Programs\IBM\WebSphere_85\AppServer\profiles\AppSrv01\logs\ffdc\server1_62b1e551_12.11.07_09.38.04.5103348602029223295846.txt com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTask.performTask 172 [7/11/12 9:38:04:631 CET] 00000065 FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Programs\IBM\WebSphere_85\AppServer\profiles\AppSrv01\logs\ffdc\server1_62b1e551_12.11.07_09.38.04.554730533013334151610.txt com.ibm.ws.management.application.SchedulerImpl.run 328 [7/11/12 9:38:04:633 CET] 00000065 SystemErr     R com.ibm.websphere.management.exception.AdminException: Cannot instantiate ear file 
    
    for ubenchEAR.ear [7/11/12 9:38:04:633 CET] 00000065 SystemErr     R     at com.ibm.ws.management.application.UpdateSchedulerImpl.getEarFileFromBinaries(UpdateSchedulerImpl.java:873) [7/11/12 9:38:04:633 CET] 00000065 SystemErr     R     at com.ibm.ws.management.application.UpdateSchedulerImpl.getEarFileFromBinaries(UpdateSchedulerImpl.java:831) [7/11/12 9:38:04:634 CET] 00000065 SystemErr     R     at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTask.performTask(ServiceIndexServerTask.java:138) [7/11/12 9:38:04:634 CET] 00000065 SystemErr     R     at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:315) [7/11/12 9:38:04:634 CET] 00000065 SystemErr     R     at java.lang.Thread.run(Thread.java:779)
    


    The first 2 log files contain the same message:

    
    [7/11/12 9:38:04:507 CET]     FFDC Exception:com.ibm.websphere.management.exception.AdminException SourceId:com.ibm.ws.management.application.task.ConfigRepoHelper.getDesiredEarFileFromBinaries ProbeId:799 Reporter:java.lang.Class@e7852e0 com.ibm.websphere.management.exception.AdminException: Cannot instantiate ear file 
    
    for ubenchEAR.ear at com.ibm.ws.management.application.task.ConfigRepoHelper.getDesiredEarFileFromBinaries(ConfigRepoHelper.java:797) at com.ibm.ws.management.application.UpdateSchedulerImpl.getEarFileFromBinaries(UpdateSchedulerImpl.java:867) at com.ibm.ws.management.application.UpdateSchedulerImpl.getEarFileFromBinaries(UpdateSchedulerImpl.java:831) at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTask.performTask(ServiceIndexServerTask.java:138) at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:315) at java.lang.Thread.run(Thread.java:779) Caused by: com.ibm.websphere.management.exception.AdminException: ADMA0173E: The EAR file 
    
    for application ubenchEAR is not managed by WebSphere.  Therefore, any operation such as getEarFile that involves changing the EAR file is not allowed. at com.ibm.ws.management.application.task.ConfigRepoHelper.getDesiredEarFileFromBinaries(ConfigRepoHelper.java:787) ... 5 more   CapturedDataElements begin arg0:
    
    null arg1:
    
    null CapturedDataElements end
    


    The last 2 log files contain the following message:

    
    [7/11/12 9:38:04:554 CET]     FFDC Exception:com.ibm.websphere.management.exception.AdminException SourceId:com.ibm.ws.management.application.SchedulerImpl.run ProbeId:328 Reporter:java.lang.Class@e7852e0 com.ibm.websphere.management.exception.AdminException: Cannot instantiate ear file 
    
    for ubenchEAR.ear at com.ibm.ws.management.application.UpdateSchedulerImpl.getEarFileFromBinaries(UpdateSchedulerImpl.java:873) at com.ibm.ws.management.application.UpdateSchedulerImpl.getEarFileFromBinaries(UpdateSchedulerImpl.java:831) at com.ibm.ws.webservices.admin.deploy.ServiceIndexServerTask.performTask(ServiceIndexServerTask.java:138) at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:315) at java.lang.Thread.run(Thread.java:779)   CapturedDataElements begin arg0 BEGIN:com.ibm.ws.management.application.UpdateSchedulerImpl@f5e6ad69 com.ibm.ws.management.application.SchedulerImpl::tc BEGIN:com.ibm.ejs.ras.TraceComponent@3f7b4707 com.ibm.ejs.ras.TraceElement::ivLevel:10 ... truncated ....
    


    The server view says after this

    
    WebSphere Application Server v8.5 at localhost [Debugging, Republish] ->ubenchEAR [Stopped, Publish failed] ->->ubench [Republish]
    


    Thanks for your valuable time! I really appreciate your support.

    Regards,
  • StevenHung
    StevenHung
    21 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-07T22:52:44Z  in response to SUP3_Tim_De_Vos
    Thanks for the logs and additional information.

    Since your server is in debug mode with "Never publish automatically", the behaviour you are seeing is expected for the inconsistency between the metadata directory and what's showing up on the server. Due to hot code replace, certain changes, such as updating method bodies will be picked up automatically without requiring a republish or updating of the metadata directory

    For your other questions, let me get back to you after I do some testing on my side.

    It shouldn't be the case that your project fails because your web project is non-single root. I have a simple Maven project that works fine as a non-single root project (I built from scratch using the Maven project wizard). Therefore, the publishing error you are seeing should not be caused by that.

    The stack traces are helpful, I will need to see if I can reproduce that. I have not come across that error before, so I cannot provide an immediate response to it.

    Thanks
  • SUP3_Tim_De_Vos
    SUP3_Tim_De_Vos
    16 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-08T07:05:35Z  in response to SUP3_Tim_De_Vos
    Hi,

    Thanks for having a look a this issue. My team and I all have the error but as additional information I can maybe say that we created our Maven project using "Import" -> "Checkout Maven Projects from SCM" -> SVN -> ... I'll try
    to make one from scratch (not by using import) and get back to you.

    Thanks again!
  • StevenHung
    StevenHung
    21 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-14T18:34:43Z  in response to SUP3_Tim_De_Vos
    I was unable to create a project that would get the error you had described.

    When you create a simple web application with the Maven project wizard, do you see the same issue?

    Also, one thing to try is opening the server editor and changing the "Publishing settings for WebSphere Application Server" to "Run server with resources on Server". In that case, when you update, do you still get the error?
  • SUP3_Tim_De_Vos
    SUP3_Tim_De_Vos
    16 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-14T21:22:35Z  in response to SUP3_Tim_De_Vos
    Thanks for your valuable time!

    I tried creating the TestWar and MyEar web project in a clean workspace as described in the IBM document. The initial installation via add/remove works
    as before. However the publish gives the following error:

    
    [14/11/12 21:57:10:669 CET] 00000056 ApplicationMg W   WSVR0100W: An error occurred initializing, MyEar com.ibm.ws.exception.ConfigurationWarning: Failed to open D:/maven_test_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/MyEar/MyEar.ear at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:607) at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:432) at com.ibm.ws.runtime.component.ApplicationMgrImpl.initializeApplication(ApplicationMgrImpl.java:395) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2169) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445) ... Caused by: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException: IWAE0037E Could not open D:/maven_test_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/MyEar/MyEar.ear at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.primOpenArchive(CommonarchiveFactoryImpl.java:1727) at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveTypeDiscriminatorImpl.fullOpenArchive(ArchiveTypeDiscriminatorImpl.java:410) at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.RootEARFileDescriminatorImpl.fullOpenArchive(RootEARFileDescriminatorImpl.java:53) at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.openEARFile(CommonarchiveFactoryImpl.java:1599) at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.openEARFile(CommonarchiveFactoryImpl.java:1573) at com.ibm.etools.commonarchive.impl.CommonarchiveFactoryImpl.openEARFile(CommonarchiveFactoryImpl.java:617) at com.ibm.ws.runtime.component.DeployedApplicationImpl$MappableContentsArchive.open(DeployedApplicationImpl.java:1662) at com.ibm.ws.runtime.component.DeployedApplicationImpl$MappableContentsArchive.access$000(DeployedApplicationImpl.java:1584) at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:604) ... 75 more Caused by: java.io.FileNotFoundException: IWAE0036E URI Name: D:/maven_test_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/MyEar/MyEar.ear; File name: D:\maven_test_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\MyEar\MyEar.ear at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.createLoadStrategy(CommonarchiveFactoryImpl.java:989) at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.primOpenArchive(CommonarchiveFactoryImpl.java:1719) ... 83 more
    


    Changing the publish setting to "Run server with resources on Server" does not give the error so it seems it is only a problem when "Run server with resources within workspace" is selected.

    This makes it even more strange to me. The "run server with resources on server" method seems rather slow due to the need to copy the whole application to the WAS directory.
  • StevenHung
    StevenHung
    21 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-19T16:52:51Z  in response to SUP3_Tim_De_Vos
    For the issue you just hit:

    com.ibm.ws.exception.ConfigurationWarning: Failed to open D:/maven_test_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/MyEar/MyEar.ear

    It is caused by the issue described in http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14886007

    The workaround I had described:

    Workaround
    A workaround I found was to disable zero binary copy.

    1. Remove your application from the server
    2. Open the server editor > Publishing settings for WebSphere Application Server > disable "Minimize application files copied to the server"
    3. Try publishing your application, it works for me now

    Unfortunately, this fix isn't available now, so you'll have to use the workaround for now. It will still be faster than running with resources on the server

    Thanks
  • SUP3_Tim_De_Vos
    SUP3_Tim_De_Vos
    16 Posts
    ACCEPTED ANSWER

    Re: WSDT and code/resource update problems.

    ‏2012-11-21T14:37:09Z  in response to SUP3_Tim_De_Vos
    Thanks for pointing this out. The workaround seems to work!

    Thanks again for your time!