Currently I am developing a GWT project by using GWT 2.4.0 in eclipse 3.7. I deploy the app inside Tomcat 7. It run perfectly for the past 2 months.
However, now I am running into a problem which I unable to trace the problem. Here is the source code for "welcomeGWT.html".
<!doctype html>
<!--
The DOCTYPE declaration above will set the browser's rendering engine into
"Standards Mode". Replacing this declaration with a "Quirks Mode" doctype may
lead to some differences in layout.
-->
<html>
<head>
<meta name='gwt:module' content='com.haircare101.cesapp.Main=com.haircare101.cesapp.Main'>
<title>101 HairCare: Customer Excellence System</title>
</head>
<body>
<script type="text/javascript" src="com.haircare101.cesapp.Main/com.haircare101.cesapp.Main.nocache.js"></script>
</body>
</html>
As the tomcat started, I type the corresponding URL into browser and it shows me this page with no error (no error shows inside Tomcat log files). But it unable to direct me to the specified GWT Main Entry Point (I saw this source file when I can "View Source" of browser).
** I have no compilation error, no deployment error or no runtime error.
Can anybody tells me the reason why it stuck in this page? Many thanks and appreciate!
Cheers,
Ryan C.
Besides using google chrome, enable firebug to debug your javascript and find out what's wrong. Apparently you have an array acess problem.
Most probably, it is in your GWT entry point and not in javascript (don't forget that all the client package code is transformed into javascript)
Related
I am trying to start debugging session using built-in WebStorm server after I created a new JavaScript debug configuration. I am using this project:
https://github.com/pauldessert/SeedTip.git
I am experiencing this weird problem that all of my locally referenced .css and .js files:
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">
<script src="js/map.js"></script>
<script src="js/search.js"></script>
...could not be found/loaded by the browser. I show this in bellow image when I pressed F12 to see Chrome Dev tools (this action seems to disconnect WebStorm IDE support extension) and you can see failed requests.
You can see in the console tool window in WebStorm that there were get request for .css and .js local files. When I press any of these links it opens ok in my Chrome browser.
E.g. this file does exist:
http://localhost:63342/SeedTip/css/style.css
When I use an external node server e.g. grunt-serve and create JS debug configuration with URL: http://localhost:9000/index.html pointing to:
F:\Projects\Angular\v2\SeedTip and run this debug it works.
Note: I have the same problem with enabling Angular 2 apps to load with systemjs.
I tried setting but it doesn't help.
I was a known bug, that was fixed in the latest build.
I have followed the instructions to setup and host my own NuGet feed. I am running the web application on a Windows 2012 (IIS 8.5) box.
I build and run the solution and get the default.aspx page...
Which says "You are running NuGet.Server v2.8.60318.667"
and "Click here to view your packages".
When I click on the "here" link I get a "404 - File or directory not found." error.
I can successfully run a nuget.exe push command to put packages on
the Nuget server; however I get a 404 error when attempting to run
nugget.exe list command.
I have restarted IIS and the server
I have rebuilt the NuGet.Server web application from scratch.
I have tried hosting the NuGet.Server on a Windows 7 box with no
success.
The Web.Config has the following entry
<modules runAllManagedModulesForAllRequests="true">
The web.config also has an entry to register the .nupkg extension as mimeType="application/zip"
It seems like the url routing is not working, but I can't seem to pin down what I am doing wrong. Something is preventing the odata feed from working.
I know there are great 3rd party implementations of NuGet server, but I would really like to just get the free one working and it seems like it should be so easy. Any thoughts or troubleshooting tips would be appreciated.
If you create a new empty VB project you will also get a 404 (in Packages and browsing using NuGet Manager).
You appear to have to create the project as C# and it works as advertised!
And yet the source code appears identical :(
This answer expands the comment left on AndrewD's answer.
Like him, I started out with a VB project and I ended up in the same camp as OP. What worked for me however was converting all C# code into VB, within these two files.
Default.aspx
NuGetODataConfig.cs (replaced this one with a new file: NuGetODataConfig.vb)
For the sake of completion, I'm including the post-converted contents of these files below.
Default.aspx
<%# Page Language="VB" %>
<%# Import Namespace="NuGet.Server" %>
<%# Import Namespace="NuGet.Server.App_Start" %>
<%# Import Namespace="NuGet.Server.Infrastructure" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>NuGet Private Repository</title>
<style>
body { font-family: Calibri; }
</style>
</head>
<body>
<div>
<h2>You are running NuGet.Server v<%= Gettype(NuGetODataConfig).Assembly.GetName().Version %></h2>
<p>
Click here to view your packages.
</p>
<fieldset style="width:800px">
<legend><strong>Repository URLs</strong></legend>
In the package manager settings, add the following URL to the list of
Package Sources:
<blockquote>
<strong><%= Helpers.GetRepositoryUrl(Request.Url, Request.ApplicationPath) %></strong>
</blockquote>
<% if string.IsNullOrEmpty(ConfigurationManager.AppSettings("apiKey")) Then %>
To enable pushing packages to this feed using the NuGet command line tool (nuget.exe), set the <code>apiKey</code> appSetting in web.config.
<% else %>
Use the command below to push packages to this feed using the NuGet command line tool (nuget.exe).
<blockquote>
<strong>nuget.exe push {package file} {apikey} -Source <%= Helpers.GetPushUrl(Request.Url, Request.ApplicationPath) %></strong>
</blockquote>
<% end if %>
</fieldset>
<% if Request.IsLocal Then %>
<fieldset style="width:800px">
<legend><strong>Adding packages</strong></legend>
To add packages to the feed put package files (.nupkg files) in the folder
<code><% = PackageUtility.PackagePhysicalPath %></code><br/><br/>
Click here to clear the package cache.
</fieldset>
<% End If %>
</div>
</body>
</html>
NuGetODataConfig.vb
Imports System.Net.Http
Imports System.Web.Http
Imports System.Web.Http.ExceptionHandling
Imports System.Web.Http.Routing
Imports NuGet.Server
Imports NuGet.Server.Infrastructure
Imports NuGet.Server.V2
<Assembly: WebActivatorEx.PreApplicationStartMethod(GetType(MGINuGet.App_Start.NuGetODataConfig), "Start")>
Namespace MGINuGet.App_Start
Public Module NuGetODataConfig
Public Sub Start()
ServiceResolver.SetServiceResolver(New DefaultServiceResolver())
Dim config As HttpConfiguration = GlobalConfiguration.Configuration
NuGetV2WebApiEnabler.UseNuGetV2WebApiFeed(config, "NuGetDefault", "nuget", "PackagesOData")
config.Services.Replace(GetType(IExceptionLogger), New TraceExceptionLogger())
Trace.Listeners.Add(New TextWriterTraceListener(System.Web.Hosting.HostingEnvironment.MapPath("~/NuGet.Server.log")))
Trace.AutoFlush = True
config.Routes.MapHttpRoute(name:="NuGetDefault_ClearCache",
routeTemplate:="nuget/clear-cache",
defaults:=New With {Key .controller = "PackagesOData", Key .action = "ClearCache"},
constraints:=New With {Key .httpMethod = New HttpMethodConstraint(HttpMethod.Get)})
End Sub
End Module
End Namespace
If you name you project Nuget.Server, since your generated dll will be Nuget.Server.dll it will not work because Nuget.Server.dll is the actual dll for the server.
Rename your Assembly name to something else.
FWIW, I made the mistake of trying to fetch the packages from http://[server]/nuget/Packages and got the same error. Removing /Packages from the end of the source URL was the answer, so http://[server]/nuget is the correct url.
I have one answer not mentioned in either of the posts I've found. If you name your project Nuget.Server, even though publishing will work in IIS, ninject will fail to set up the package list route because it will try to load the wrong DLL and error out.
Here are some other possible answers:
Possible Answers 1
Possible Answers 2
I was having this problem today. Actually what I need to do is this in Global.asax:
void Application_Start(object sender, EventArgs e)
{
NuGetRoutes.Start();
}
The NuGet.config file in either %APPDATA%\NuGet or $(SolutionDir).nuget may be referring to unexpected "active source" URLs. For example, the nuget.exe brought by the TFS build agent install might be aware of NuGet v2 protocol only while the URLs refer to v3 protocol. Or the custom NuGet server URL might be missing from NuGet.config.
I was having similar issue and I found a solution! I created a private nuget server following the instructions to create an empty ASP.NET project (I'm on VS2015) and then installing nuget.server (currently v2.11.3.0). I was able to run and see web page except I was not able to use "nuget.exe push" to upload packages. I got the dreaded 404 not found error.
I eventually cloned the nuget.server source code off github and ran that directly which worked fine!? I discovered my web.config was incorrect. For me the key line was
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,PUT,DEBUG" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
in the
<system.webServer>/<handlers>
section.
I suggest anyone having issues should go to github and compare web.config files.
BTW: The nuget.server install is supposed to replace your web.config. This may not have worked correctly for me.
I noticed that you get the 404 error when you try to upload fairly large nuget packages. I upped the maxAllowedContentLength and it helped.
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="31457280"/>
</requestFiltering>
</security>
</system.webServer>
I had this problem with a clean Visual Studio 2017 Web project.
Recreating from Visual Studio 2015 and targeting .NET 4.6.1 sorted it out
In my WebWorks application I have the following in my config.xml;
<feature id="blackberry.invoke.card" />
and in my main page I imported the following JS:
`
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js" type="text/javascript"></script>
<script src="js/BlackBerry-JQM-Init.js" type="text/javascript"></script>
<script src="js/BlackBerry-JQM.js" type="text/javascript"></script>
<script src="local:///chrome/webworks.js" type="text/javascript"></script>
<script src="js/index.js" type="text/javascript"></script>
`
But whenever the code attempts to run blackberry.invoke.card.invokeEmailComposer(...) I get "blackberry is not defined". What am I missing to properuly use the Blackberry libraries, specifically to send an email message? All the examples from Github and other sites also failed to work.
Edit: Re-wrote since you're using WebWorks 2.0 Beta
I see the problem. You're doing things the "old way".
Since WebWorks 2.0 is running on Cordova, a few things have changed. Really quickly, I can see that you're including the 'local:///webworks.js'. That is incorrect for v2.0.
You need to include cordova.js now. Take a look at the sample project that comes with WebWorks 2.0 when you create a new project.
Here's the full Getting Started Guide that should get you up to speed. If you would rather use the command line, take a look at the build instructions at the end of any of the sample apps. Again, feel free to reference or use and adapt any of the sample apps as well # https://github.com/blackberry/BB10-WebWorks-Samples/tree/WebWorks-2.0
I am trying to install SAPUI5 on my local machine using XAMPP.
I copied the files to htdocs.
Starting localhost in Chrome I get the SAPUI5 SDK - Demo Kit Overview page.
After that I copied a sample code of the "HowTo in 20 seconds" code to notepad and saved it as HTML-Document.
Running this file in the browser only brings a white page.
I looked for the developer tools in Chrome and saw something like this:
"failed to preload 'sap.ui.core.library-preload': Not Found - sap.ui.ModuleSystem"
I hope you can help me fix this problem, so I can start with SAPUI5
Useful links regarding this topic, which I could recommend:
Describes how to run UI5 App locally: http://scn.sap.com/community/developer-center/front-end/blog/2014/01/13/ui5-mobile-splitapp-boilerplate
Describes to local Development with Eclipse: http://blog.mypro.de/2014/01/14/ui5-boilerplate-with-eclipse/
They both use the UI5 SplitApp Boilerplate from Github, which is an example app, with a base application structure: https://github.com/6of5/UI5SplitApp-Boilerplate
Perhaps this helps you to start local developement
Open a new notepad file. Save below code with html extension, eg: helloworld.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>SAPUI5 in 20 Seconds</title>
<!- 1.) Load SAPUI5, select theme and control library ->
<script id="sap-ui-bootstrap"
type="text/javascript"
src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_goldreflection"
data-sap-ui-libs="sap.ui.commons"></script>
<!- 2.) Create a UI5 button and place it onto the page ->
<script>
// create the button instance
var myButton = new sap.ui.commons.Button("btn");
// set properties, e.g. the text
myButton.setText("Hello World!");
// attach an action to the button's "press" event (use jQuery to fade out the button)
myButton.attachPress(function() { $("#btn").fadeOut(); });
// place the button into the HTML element defined below
myButton.placeAt("uiArea");
// an alternative, more jQuery-like notation for the same is:
/*
$(document).ready(function() {
$("#uiArea").sapui("Button", "btn", {
text:"Hello World!",
press: function(){ $("#btn").fadeOut(); }
});
});
*/
</script>
</head>
<body class="sapUiBody">
<!- This is where you place the UI5 button ->
<div id="uiArea"></div>
</body>
</html>
Now open the file with any modern browser. FYI, We don't need any server to test this
You can configure Eclipse to work with SAPUI5 and use Apache Tomcat to run your application when working in a local environment.
Install Eclipse - http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunasr2
Install the Java Runtime Enviromnet - http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
Install Apache Tomcat - http://tomcat.apache.org/download-80.cgi
Install SAPUI5 tools in Eclipse
Eclipse > Help > Install New Software
Add a new site in the "Available Software Sites" with the url:https://tools.hana.ondemand.com/luna
Select the new site in the Work with selection.
Expand the UI Development Toolkit for HTML5 & Select UI Development Toolkit for HTML5 (Developer Edition)
Next & Install (An Eclipse restart may be required)
Now that you have the SAPUI5 Tools installed. If you create a new Project, you now get a SAPUI5 Application Development option available.
Configure Apache Tomcat in the Servers
Add a Server, Window > Preferences > Server > Runtime Environment > Add
Select Apache Tomcat 8.0( or whichever version you are using) & select Next.
Select Tomcat installation directory & Finish.
Now you are all set to go. Create a new SAPUI5 Project(say myProject), add some code. To run it on tomcat, right-click on the Project, Run As > Run On Server. Select your Tomcat server, Next & Finish. You project will be up & running on your server at http://localhost:8080/myProject/
The "failed to preload" messges should not be fatal errors; the library preload files are an optional bundled optimization in order to reduce the number of HTTP requests.
https://github.com/SAP/openui5/issues/119
I think you can just ignore this warning. And I encounter Cross origin requests problem when loading Component.js, solved this problem using python -m SimpleHTTPServer. What you need is just a server , choose whatever you like.
Daniel I recommend you SAPUI Walkthrough as a starting point. This is a step by step guide / tutorial on how to build SAPUI5 applications, contains explanation about the cornerstones and best practices. For the basics you will only need an editor and a browser (no webserver). This git repo contains all the Walkthrough steps as separate branches.
SAP UI5 is only bunch of UI libraries that are used to develop your front end, just like other libraries like jQuery. Now, the question is how do you configure your Apache to serve these files? This is a basic Apache configuration to serve files, this page might be a good starting point.
Although I have seen dozens of forum questions relating to "Could not load type", none of the advice in them seemed to apply to my situation.
I wrote a new web application using aspx.net VB 2005. It is tiny, with just 2 pages, 1 of which has no code-behind. It runs aok in the IDE but when I installed it on my pc (and also when installed on the production server), and tried to run it this error came up:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'EMTTrainingDatabase.pageMain'.
Source Error:
Line 1: <%# Page Language="vb" AutoEventWireup="false" CodeBehind="pageMain.aspx.vb" Inherits="EMTTrainingDatabase.pageMain" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: /EMTTrainingDatabase/pageMain.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
I checked the web site properties in IIS and the correct ASP.net version is specified: 2.0.50727.
I checked the virtual path and it looks correct too: /EMTTrainingDatabase
pageMain source code header looks like:
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="pageMain.aspx.vb" Inherits="EMTTrainingDatabase.pageMain" %>
Some posters suggest that the bin is in the wrong folder or the bin doesn't contain the rigt contents. I don't have enough knowledge to evaulate this.
Can someone help?
Thank you.
I was able to find the answer to my problem:
When I added content to the deployment project, the dll was not in the bin. When I dragged it into the bin, the program worked.
For the benefit of others who might have had the same error, it can also come due to the ASP.NET runtime being unable to locate the /bin folder.
For this, make sure you have marked the virtual directory containing your application as a web application root.
e.g. In godaddy web hosting you should mark Set Application Root to the folder/sub-folder containing your application. (Making it a virtual directory is not enough).
Hope it will help someone.
Just replace the CodeBehind attribute with CodeFile